Problem with accessing a subform control from form load

G

gamaz

Hi,
I have a form load event that is trying to reference a field in a subform to
the main form. The field is a text box for adding date.
However when I am opening the form I am getting the following error message:
There is an invalid use of the .(dot) or ! operator or invalid parenthesis

The following is the code:
If ((Len(Nz(Me![qry6DPermAction subform].Form.txt6DMem1.Value, ""))) = 0)
Then
txtResponseReceivedDate.Locked = True
Else
txtResponseReceivedDate.Locked = False
End If


I appreciate any help to resolve this. Thanks
 
J

Jeanette Cunningham

Hi gamaz,

try breaking it up into its parts and check each part like this

Nz(Me![qry6DPermAction subform].Form.txt6DMem1.Value, "")

Len(Nz(Me![qry6DPermAction subform].Form.txt6DMem1.Value, ""))

If Len(Nz(Me![qry6DPermAction subform].Form.txt6DMem1.Value, "")) = 0 Then

It appears that your code has 2 brackets before the Len that are not needed.
And matching not needed brackets at the end of the statement.


Jeanette Cunningham MS Access MVP -- Melbourne Victoria Australia
 
B

bhicks11 via AccessMonster.com

Try this:

If ((Len(Nz(Me![qry6DPermAction subform].Form!txt6DMem1.Value, ""))) = 0)

Bonnie
http://www.dataplus-svc.com
Hi,
I have a form load event that is trying to reference a field in a subform to
the main form. The field is a text box for adding date.
However when I am opening the form I am getting the following error message:
There is an invalid use of the .(dot) or ! operator or invalid parenthesis

The following is the code:
If ((Len(Nz(Me![qry6DPermAction subform].Form.txt6DMem1.Value, ""))) = 0)
Then
txtResponseReceivedDate.Locked = True
Else
txtResponseReceivedDate.Locked = False
End If

I appreciate any help to resolve this. Thanks
 

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