I added a locked field to my main table and added the following code to the main forms on current and also the 'locked' checkbox's after update events:
Dim c As Control
On Error Resume Next
If Me.LockedCB = True Then
For Each c In Me.Controls
If c.Name = "LockedCB" Or c.Name = "CTU PI Name Search" Then
Else
c.Locked = True
End If
Next
Else
For Each c In Me.Controls
If c.Name = "LockedCB" Then
Else
c.Locked = False
End If
Next
End If
End Sub
It locks all the controls if the 'locked' checkbox is checked, including the subforms which is what I needed except I want staff to be able to access one unbound combo box (KP Name Search)in order to 'find' various subform records.
I have played with adding an 'Or c.Name="KP Name Search" or (c.Parent.Name="KP COI Subform" And c.Name="KP Name Search") without any luck of having this field lock setting set to false. I also tried to set it's own event properties and the related subform events to set it to be unlocked.... Is there some other way to do this?
Dim c As Control
On Error Resume Next
If Me.LockedCB = True Then
For Each c In Me.Controls
If c.Name = "LockedCB" Or c.Name = "CTU PI Name Search" Then
Else
c.Locked = True
End If
Next
Else
For Each c In Me.Controls
If c.Name = "LockedCB" Then
Else
c.Locked = False
End If
Next
End If
End Sub
It locks all the controls if the 'locked' checkbox is checked, including the subforms which is what I needed except I want staff to be able to access one unbound combo box (KP Name Search)in order to 'find' various subform records.
I have played with adding an 'Or c.Name="KP Name Search" or (c.Parent.Name="KP COI Subform" And c.Name="KP Name Search") without any luck of having this field lock setting set to false. I also tried to set it's own event properties and the related subform events to set it to be unlocked.... Is there some other way to do this?