The codes are working in admin account, but in user account once the Main form is close and open again all the button are already enabled.
Please help. thanks
Please help. thanks
Code:
Private Sub Form_Load()
On Error Resume Next
If Not IsNull(Me.OpenArgs) Then
Me.lblUserType.Caption = Me.OpenArgs
Me.cmdLogout.SetFocus
Me.Caption = " "
Call Disabled
End If
End Sub
Public Sub Disabled()
On Error Resume Next
If (Me.lblUserType.Caption) <> "Admin" Then
Me.cmdAdmin.Enabled = False
Me.cmdInventory.Enabled = False
Else
Me.cmdAdmin.Enabled = True
Me.cmdInventory.Enabled = True
End If