I have set up an access ID level for the users.
I have a navbar (which loads in a subform) on the top of each page with combobox access to various forms.
Based on the user level, I need the navbar combobox to either allow the user to see and have access to the values... or hide or disallow. (Whatever is easier... but hiding in the preferred way.
Here is a piece of the original navbar code...
Code:
Private Sub CourseComboBox_Click()
Dim strCourseCB As String
If Me.CourseComboBox = "Submit Course" Then
strCourseCB = "1_frmInputCourse"
ElseIf Me.CourseComboBox = "Search Course" Then
strCourseCB = "2_qryCourseFiles"
End If
DoCmd.Close
DoCmd.OpenForm strCourseCB
End Sub
This is what I am TRYING to do... albeit unsuccessfully... (Non-working code in blue)
Code:
Private Sub Form_Open(Cancel As Integer)
On Error GoTo Err_Form_Open
If User.AccessID < 4 Then
Me.CourseComboBox.value = "Search Course".Enabled = True
Else
Me.CourseComboBox.value = "Search Course".Enabled = False
End If
Exit_Form_Open:
Exit Sub
Err_Form_Open:
MsgBox Err.Description
Me.Visible = True
Resume Exit_Form_Open
End Sub
Private Sub CourseComboBox_Click()
Dim strCourseCB As String
If Me.CourseComboBox = "Submit Course" Then
strCourseCB = "1_frmInputCourse"
ElseIf Me.CourseComboBox = "Search Course" Then
strCourseCB = "2_qryCourseFiles"
End If
DoCmd.Close
DoCmd.OpenForm strCourseCB
End Sub