Private Sub LockEm()
Dim ctr As Control
For Each ctr In Me.Controls
Select Case ctr.ControlType
Case acTextBox, acListBox, acComboBox
If g_lAccessID = 6 And (left(ctr.Name, 3) = "txt" Or left(ctr.Name, 3) = "cbo" Or left(ctr.Name, 3) = "chk" Or left(ctr.Name, 3) = "l_") Then
ctr.Locked = True
Else
ctr.Locked = False
If g_lAccessID = 6 And left(ctr.Name, 3) = "btn" Then '<---- This part does not work
ctr.Enabled = False
Else
ctr.Enabled = True
End If
End If
End Select
Next ctr
End Sub
|