longestdrive
Programmer
Hi
I have a main form with 2 connected subforms. When a user clicks in a record on subform1 the data in subform2 is updated using requery.
Historical records have a field called locked which is either true or false. Depending on the value of this field I want stop the user editing the record in subform2.
I was expecting to use the code ctlName.locked = true
I've tried to place the code in various places with limited success.
The problem I have is undertanding the events being triggered to ensure that each time the use clicks on the record in subform1, it evaluates the flag and locks or unlocks the controls in subform2.
I've tried ONLOAD in subform2 which only appears to fire the first time the form is loaded, not on each requery
I've tried ON CURRENT in subform1, after the code which requeries subform2. This appears to be firing at each click as expected but does not lock or unlock the controls in subform2.
To test the event is firing and the value of the flag I'm using a message box for now so I can test the evnt and the value.
Any suggestions of the best place and method to lock controls in a subform??
Thank you
I have a main form with 2 connected subforms. When a user clicks in a record on subform1 the data in subform2 is updated using requery.
Historical records have a field called locked which is either true or false. Depending on the value of this field I want stop the user editing the record in subform2.
I was expecting to use the code ctlName.locked = true
I've tried to place the code in various places with limited success.
The problem I have is undertanding the events being triggered to ensure that each time the use clicks on the record in subform1, it evaluates the flag and locks or unlocks the controls in subform2.
I've tried ONLOAD in subform2 which only appears to fire the first time the form is loaded, not on each requery
I've tried ON CURRENT in subform1, after the code which requeries subform2. This appears to be firing at each click as expected but does not lock or unlock the controls in subform2.
To test the event is firing and the value of the flag I'm using a message box for now so I can test the evnt and the value.
Any suggestions of the best place and method to lock controls in a subform??
Thank you