Good Evening Everyone,
I am having a problem getting this code below to work
Basically, what i am trying to do is when a user who is not classified as an admin should get the error "You do not have access to this form", if they are admin, then they can open it.
Thank you,
I am having a problem getting this code below to work
Code:
Private Sub btnAdminTools_Click()
On Error GoTo Err_btnAdminTools_Click
If admin = True _
Then
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "frmallinonereport"
DoCmd.OpenForm stDocName, , , stLinkCriteria
Else
MsgBox "You Do Not Have access to this Form"
Exit_btnAdminTools_Click:
Exit Sub
Err_btnAdminTools_Click:
MsgBox Err.Description
Resume Exit_btnAdminTools_Click
End If
End Sub
Basically, what i am trying to do is when a user who is not classified as an admin should get the error "You do not have access to this form", if they are admin, then they can open it.
Thank you,