belly0fdesire
Registered User.
- Local time
- Today, 11:03
- Joined
- Dec 1, 2005
- Messages
- 11
I'm still new at this, so bear with me, please...
I want the database to open to different forms for different users.
I have a table that's called "users" with 3 fields: RealName, UsNm and Level.
I want the Level to be what determines the formt that's opened, based on the username they are logged on with. I got it to figure out what the user's username is, but it just opens the same form for every user.
fOSUserName() is the username the user is logged on with, then I have 2 more functions that I'm trying to use to make this happen...
Here's one of the functions:
And here's the other, rather ghetto function that I'm using:
Then I put "Run Code" in the Autoexec macro and Starter() as the code to run.
Can someone help me with this?
I want the database to open to different forms for different users.
I have a table that's called "users" with 3 fields: RealName, UsNm and Level.
I want the Level to be what determines the formt that's opened, based on the username they are logged on with. I got it to figure out what the user's username is, but it just opens the same form for every user.
fOSUserName() is the username the user is logged on with, then I have 2 more functions that I'm trying to use to make this happen...
Here's one of the functions:
Code:
Public Function lookuplevel2()
lookuplevel2 = DLookup("[Level]", "users", "[UsNm] = fOSUserName()")
End Function
And here's the other, rather ghetto function that I'm using:
Code:
Public Function starter()
Dim stdocument1 As String
Dim lvl As String
lvl = lookuplevel2()
stdocument1 = "mainman"
stdocument2 = "mainarm"
stdocument3 = "mainstaff"
If lvl = "3" Then GoTo man
If lvl = "2" Then GoTo rev
If lvl = "1" Then GoTo staf
man:
DoCmd.OpenForm stdocument1
GoTo enditall
rev:
DoCmd.OpenForm stdocument2
GoTo enditall
staf:
DoCmd.OpenForm stdocument3
GoTo enditall
e:
End Function
Then I put "Run Code" in the Autoexec macro and Starter() as the code to run.
Can someone help me with this?