hi, as per correspondence in this link: https://www.accessforums.net/forms/s...ems-46893.html
I manually created a switchboard form and then, put below code, in the On_Click event of each button. The code is supposed to open a form once the login ID passes clearance but it is not loading the form. What am I doing wrong...?
Develop and Administrator have AccessLevelID 1
Dim CatID As Long
Dim lUser As Long
Dim UserLevel As Long
If DLookup("AccessLevelID", "tblAccess", "UserID=" & Forms!frmLogin!cmbUser.Column(0) & "") <> 1 ThenIf IsNull(DLookup("UserID", "tblAccess", "CategoryID=122 AND UserID=" & Forms!frmLogin!cmbUser.Column(0) & "")) Then
**If user not assigned to this category****
MsgBox "You are not authorized to view this form"
Cancel = True
Else
DoCmd.OpenForm "CardiacForm"
With Me
.DataEntry = True
.AllowEdits = True
.AllowDeletions = False
.AllowAdditions = True
.AllowFilters = False
End With
End If
End If