November 20, 200718 yr I have a db which can be opened with several accounts with different privilege sets. I would like to set it up so that it opens to a specific layout depending on the user name. Ie. Admin would log in and see the Master DB layout Tech would log in and see the Maintenance DB layout Is this possible?
November 20, 200718 yr Create a script and then run it when the file opens. File>File Options: Open/Close Tab, check the Perform Script box and select the script to run.
November 20, 200718 yr The script that runs on Open System would have a section such as (pseudo-script) If Get (AccountName) = "Admin" Go to Layout (Master DB Layout) elseif get (accountname) = "Tech" Go to Layout ( Maintenance DB layout) else Go to Layout ( User Main Main) endif
November 21, 200718 yr Author How do I get the field AccountName to reflect the current user? I tried using gUsername field and my script looks like this but always opens with Master DB layout. Insert Current User Name [select; Users::gUsername] If (gUsername) = "Admin" Go to Layout (Master DB Layout) elseif (Username) = "Tech" Go to Layout ( Maintenance DB layout) endif
November 21, 200718 yr My script works as is without the use of a global. There is no field AccountName. You do have users login on startup, right? Remember, AccountName is what is entered in the login dialog, but UserName is what is entered in FM's Edit Preferences (and is really never used).
November 29, 200718 yr Author Thank you. I got it to work. The final script looks like this. If [Get (AccountName) = "Admin"] Go to Layout (Master DB Layout) elseif [get (accountname) = "Tech"] Go to Layout ( Maintenance DB layout) else Go to Layout ( User Main Main) endif Thanks again for your help.
Create an account or sign in to comment