Is there a way you can hide a form element such as a action button based on the Location setting. If not, what about by IP address. Like anything that does not start with 178. This would be used for a Time Log databse that we only want users to sign-in when they are in the office.
Subject: Hiding Form Elements based on Location
doing it by location realy depends on what you mean by “location”. Do you mean physically where they are or do you mean what Location document they are switched to? I am assuming the former since the latter really is not going to be all accurrate. You can use some API calls in the db’s PostOpen event to get the computer’s IP address and write it to an environment variable. If you search this forum you will find the code. If you cannot find it then let me know and I will see if I can locate it.
Subject: RE: Hiding Form Elements based on Location
Hi PaulI am looking for best practices. Again we have an Employee Time Log database that we do not want user to log in from home with their laptop or home desktop, and then drive to work or vica-versa. We do have a specific “Internet” location document selection in the client for remote use. However a savvy user may create a different location document using the remote connection entry and use that to circumvent the hide when formula. So I guess were talking IP address. We use 3 different octets 172.16.x.x , 10.x.x.x, 192.168.x.x. If I get the users IP and check it against these 3 octets can I assume that if it is not one of these, then they are not in one of our offices. Maybe not. My guess is that it could be possible that the ISP the use may have a DNS that dishes out theses octets as well. So if this is the case I am back to Location document. My goal is simple; hide Time In button or error out when the user is not in our offices .
Bob
Subject: RE: Hiding Form Elements based on Location
Hi Robert
I have had a similar situation previously.
When staff are “in” the office in my situation they login to a windows domain.
You can extract this from the environment ( userdomain ) & write to a Env variable & hide against that. If they are not logged into a domain ( COMPUTERNAME = USERDOMAIN ) - from memory & they are not “in” the office.
Subject: RE: Hiding Form Elements based on Location
O.K. If that works then I can use that.However I am treading on new ground here.
Could you please walk me through this?
Any script examples would be greatly appreciated.
Thanks for the time and knowledge.
Bob