TDebb8594 Posted November 20, 2007 Posted November 20, 2007 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?
sbg2 Posted November 20, 2007 Posted November 20, 2007 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.
bcooney Posted November 20, 2007 Posted November 20, 2007 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
Newbies Bspellman Posted November 20, 2007 Newbies Posted November 20, 2007 Would this script be instant web compatable? Thanks
TDebb8594 Posted November 21, 2007 Author Posted November 21, 2007 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
bcooney Posted November 21, 2007 Posted November 21, 2007 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).
TDebb8594 Posted November 29, 2007 Author Posted November 29, 2007 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.
Recommended Posts
This topic is 6205 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now