I have buttons leading to forms that should only be accessed by Users if their ID appears in tblAdmins. How do I correctly format the bolded line:
Private Sub AllRelBut_Click()
On Error GoTo Err_AllRelBut_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "frmButtonsAdminRel"
'Iif Me.UserID is in tbl.Admins Then
DoCmd.OpenForm stDocName, , , stLinkCriteria
Else
MsgBox UserID & " is not authorized to enter the Administrator's section."
Exit Sub
End If
Exit_AllRelBut_Click:
Exit Sub
Err_AllRelBut_Click:
MsgBox Err.Description
Resume Exit_AllRelBut_Click
End Sub
Private Sub AllRelBut_Click()
On Error GoTo Err_AllRelBut_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "frmButtonsAdminRel"
'Iif Me.UserID is in tbl.Admins Then
DoCmd.OpenForm stDocName, , , stLinkCriteria
Else
MsgBox UserID & " is not authorized to enter the Administrator's section."
Exit Sub
End If
Exit_AllRelBut_Click:
Exit Sub
Err_AllRelBut_Click:
MsgBox Err.Description
Resume Exit_AllRelBut_Click
End Sub