If DLookup("UserGroup", "tblPersonnel","UserID = " & gUserID) <> Admin then
Me.cmdAdminForm.Enabled = False
Me.cmdMgmtForm.Enabled = False
Open in new window
Private Sub Form_Open(Cancel as integer)
If DLookup("UserGroup", "tblPersonnel","UserID = " & gUserID) <> Admin then Cancel = True
On Error goto EH
If err.num = 2501 then
msgbox "The form could not be opened -- due to insufficient group permissions or to some othere cause"
msgbox "Error " & err.number & ": " & err.description
IT issues often require a personalized solution. With Ask the Experts™, submit your questions to our certified professionals and receive unlimited, customized solutions that work for you.