Have you created the Get Permission Function? The code will bomb out with out this function as there is a call for it in the code. Compare your code to mine which works in a db currently
Code:
Private Sub Form_Load()
Dim sPermit As String
Dim iAccess As Integer
Dim Ctl As Access.Control
Me.txtUser = Environ("username")
If isNothing(Me.txtUser) Then
sPermit = "ReadOnly"
Else
sPermit = GetPermission(Me.txtUser)
End If
Select Case sPermit
Case "Edit"
iAccess = 2
Case "Admin"
iAccess = 3
Case Else
iAccess = 1
End Select
Me.txtLevel = iAccess
Me.LstMenu.Requery
End Sub
Private Function GetPermission(sUser As String)
If (isNothing(DLookup("Permissions", "tblStaff", "Login='" & Forms!frmMainMenu!txtUser & "'"))) Then
GetPermission = "ReadOnly"
Else
GetPermission = DLookup("Permissions", "tblStaff", "Login='" & Forms!frmMainMenu!txtUser & "'")
End If
End Function
You will naturally have different table and field names.
Alan