Cannot figure out the error message

J

Jack

Hi,
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. I am not sure where I am
going wrong. Any help is highly appreciated. Thanks.
 
M

Marshall Barton

Jack said:
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top