dan-cat
Registered User.
- Local time
- Today, 01:16
- Joined
- Jun 2, 2002
- Messages
- 3,433
I am having trouble setting the lock property of a field to true.
I have a combo field called "Type" in the Main Order form. I want to lock this field whenever there is a record within the Sub Order form. Here is what I have written so far - with ProductCode being the field within the subform.
Private Sub ProductCode_AfterUpdate()
[Forms]![frmOrders]![Type].Locked = True
End Sub
However I get the following error:
"Run-time error - '2166' you can't lock a control whilst it has unsaved changes"
I have a combo field called "Type" in the Main Order form. I want to lock this field whenever there is a record within the Sub Order form. Here is what I have written so far - with ProductCode being the field within the subform.
Private Sub ProductCode_AfterUpdate()
[Forms]![frmOrders]![Type].Locked = True
End Sub
However I get the following error:
"Run-time error - '2166' you can't lock a control whilst it has unsaved changes"