Jack wrote:
[Quoted Text] >I have a subform named frmSub6DPermAction which has a control named >txt6DPermAct1 >This subform is in a main form named frmActionRequest. > >I have a procedure in the open event of the main form as: > >If _ >((Len(Nz(Me.memoCause.Value, "")) = 0) Or _ >(Len(Nz(Me!frmSub6DPermAction.Form!txt6DPermAct1.Value, "")) = 0)) Then > txtResponseReceivedDate.Locked = True >Else > txtResponseReceivedDate.Locked = False >End If > >As I am stepping through the above code I am getting an error stating that >the systemcannot find the field frmSub6DPermAction.
[Note that you need to use the name of the subform control (on the main form) instead of the name of the form object the subform control will display.]
The Open event is too early to be chacking values. Try moving your code to the main form's Load event.
If that doesn't do everything you need, then I think the code should be in the subform's Current event and look more like:
Parent.txtResponseReceivedDate.Locked = _ Len(Nz(Parent.memoCause, "")) = 0 _ Or Len(Nz(Me!txt6DPermAct1, "")) = 0
-- Marsh MVP [MS Access]
|