Hey again! This forum is awesome.
I have code I want to modify (found on this forum)
Private Sub Form_Open(Cancel As Integer)
On Error GoTo Err_Form_Open
If User.AccessID = 1 Then
Me.cmdUserSettings.Enabled = True
Else
Me.cmdUserSettings.Enabled = False Then
End If
Exit_Form_Open:
Exit Sub
Err_Form_Open:
MsgBox Err.Description
Me.Visible = True
Resume Exit_Form_Open
Basically, its a login form, that chooses whether to allow the user or not to view a portion of that form. Lets say my other control is called Command76, how would I throw that in the if statement?:
If User.AccessID = 2 Then
Me.Command76.Enabled = True
Else
Me.Command76.Enabled = False
Private Sub Form_Open(Cancel As Integer)
On Error GoTo Err_Form_Open
If User.AccessID = 1 Then
Me.cmdUserSettings.Enabled = True
Else
Me.cmdUserSettings.Enabled = False Then
End If
Exit_Form_Open:
Exit Sub
Err_Form_Open:
MsgBox Err.Description
Me.Visible = True
Resume Exit_Form_Open
End Sub