hi all,
I need some help with some code i have, i have a button where if the user is an admin (in a table) it opens a form if they're a user it pops up a message box, the problem i'm having is if the user hasn't had any details put in the table it opens the form anyway.
i'm using the fosusername function to dlookup the table but i want a message popping up if the user isn't on the table yet.
any help appreciated
I need some help with some code i have, i have a button where if the user is an admin (in a table) it opens a form if they're a user it pops up a message box, the problem i'm having is if the user hasn't had any details put in the table it opens the form anyway.
i'm using the fosusername function to dlookup the table but i want a message popping up if the user isn't on the table yet.
Private Sub openadmin_Click()
If DLookup("Group", "tblUsers", "Username =""" & fOSUserName & """") <> "Admin" Then
MsgBox "You have insufficient rights to open the Admin Form"
Else: DoCmd.OpenForm "users", acFormDS
End If
End Sub
any help appreciated