Form load / disabled button

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • htugay
    New Member
    • Dec 2016
    • 6

    Form load / disabled button

    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
    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
    Last edited by Frinavale; Feb 10 '17, 09:22 PM.
Working...