Hello,
I'm using this bit of code to lock my controls on a form
I have a "Edit" button that will run the opposite code to unlock the controls which works fine. My problem is that I want txt_SearchBox in the header to remain enabled to search the continuous form but it remains locked until I hit the "Edit" button. Any ideas?
I'm using this bit of code to lock my controls on a form
Code:
Private Sub Lock_Controls()
'Locks the controls to prevent editing
Dim ctrl As Control
For Each ctrl In Me.Controls
If TypeOf ctrl Is TextBox Then
ctrl.Locked = True
End If
If TypeOf ctrl Is CheckBox Then
ctrl.Locked = True
End If
If TypeOf ctrl Is ComboBox Then
ctrl.Locked = True
End If
Next
txt_SearchBox.Enabled = True
End Sub
I have a "Edit" button that will run the opposite code to unlock the controls which works fine. My problem is that I want txt_SearchBox in the header to remain enabled to search the continuous form but it remains locked until I hit the "Edit" button. Any ideas?