There is an invalid use of the .dot or ! or invalid parenthses

J

Jack

Hi,
I am using the following code in the form load event to lock a field on a
form based on values of fields in the main and the subform. However when I am
running this form I am getting the above error:
There is an invalid use of the .(dot) or ! operator or invalid parenthesis

I cannot figure out why I am receiving such message. The application
compiles thought. Any help is appreciated. Thanks

CODE:
'Trying to lock the value txtResonseReceivedDate
If (((Len(Nz(Me.memoCause.Value, ""))) = 0) Or _
((Len(Nz(Me![qry6DPermAction subform].Form.txt6DPermAct1.Value, ""))) = 0)
Or _
((Len(Nz(Me![qry6DPermAction subform].Form.txt6DMem1.Value, ""))) = 0) Or _
((Len(Nz(Me![qry6DPermAction subform].Form.txt6DDue1.Value, ""))) = 0)) Or _
((Len(Nz(Me![frmSub7DPAEffect].Form.txt7DPAEffect1.Value, ""))) = 0) Or _
((Len(Nz(Me![frmSub7DPAEffect].Form.txt6DMem1.Value, ""))) = 0) Or _
((Len(Nz(Me![frmSub7DPAEffect].Form.txt6DDue1.Value, ""))) = 0) Then
txtResponseReceivedDate.Locked = True
Else
txtResponseReceivedDate.Locked = False
End If
 
J

Jeff Boyce

Jack

Just inspecting the code, I noticed that the .txt6DDue comparison of the IF
statement ends with two closing parentheses, while all the rest end with
one. Is that significant?

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
J

Jack

Hi Jeff,
That extra parenthesis is wrong. I took that off. Even then I was getting
the same error. One reason was because I was referencing fields that were not
part of corresponding subform. Now I have eliminated all the problems one by
one. However one field which has been giving same trouble is the date field
of the subform with 6 while I have not brought the corresponding date field
of 7. I am not sure why this is bombing out. Lastest code is the following:
If (((Len(Nz(Me.memoCause.Value, ""))) = 0) Or ((Len(Nz(Me![qry6DPermAction
subform].Form.txt6DPermAct1.Value, ""))) = 0) Or ((Len(Nz(Me![qry6DPermAction
subform].Form.txt6DMem1.Value, ""))) = 0) Or ((Len(Nz(Me![qry6DPermAction
subform].Form.txt6DDue1.Value, ""))) = 0) Or
((Len(Nz(Me![frmSub7DPAEffect].Form.txt7DPAEffect1.Value, ""))) = 0) Or
((Len(Nz(Me![frmSub7DPAEffect].Form.txt7DMem1.Value, ""))) = 0)) Then

Jeff Boyce said:
Jack

Just inspecting the code, I noticed that the .txt6DDue comparison of the IF
statement ends with two closing parentheses, while all the rest end with
one. Is that significant?

Regards

Jeff Boyce
Microsoft Office/Access MVP

Jack said:
Hi,
I am using the following code in the form load event to lock a field on a
form based on values of fields in the main and the subform. However when I
am
running this form I am getting the above error:
There is an invalid use of the .(dot) or ! operator or invalid parenthesis

I cannot figure out why I am receiving such message. The application
compiles thought. Any help is appreciated. Thanks

CODE:
'Trying to lock the value txtResonseReceivedDate
If (((Len(Nz(Me.memoCause.Value, ""))) = 0) Or _
((Len(Nz(Me![qry6DPermAction subform].Form.txt6DPermAct1.Value, ""))) = 0)
Or _
((Len(Nz(Me![qry6DPermAction subform].Form.txt6DMem1.Value, ""))) = 0) Or
_
((Len(Nz(Me![qry6DPermAction subform].Form.txt6DDue1.Value, ""))) = 0)) Or
_
((Len(Nz(Me![frmSub7DPAEffect].Form.txt7DPAEffect1.Value, ""))) = 0) Or _
((Len(Nz(Me![frmSub7DPAEffect].Form.txt6DMem1.Value, ""))) = 0) Or _
((Len(Nz(Me![frmSub7DPAEffect].Form.txt6DDue1.Value, ""))) = 0) Then
txtResponseReceivedDate.Locked = True
Else
txtResponseReceivedDate.Locked = False
End If
 
J

Jack

OK Jeff,
I finally have come up with the problem field. I have the following as the
code now (commenting the rest).
If ((Len(Nz(Me![frmSub7DPAEffect].Form.txt6DMem1.Value, ""))) = 0) Then
...
The above is giving error message. So I guess for some reason the expression
is not correct which I cannot figure out why. Any clues?


Jack said:
Hi Jeff,
That extra parenthesis is wrong. I took that off. Even then I was getting
the same error. One reason was because I was referencing fields that were not
part of corresponding subform. Now I have eliminated all the problems one by
one. However one field which has been giving same trouble is the date field
of the subform with 6 while I have not brought the corresponding date field
of 7. I am not sure why this is bombing out. Lastest code is the following:
If (((Len(Nz(Me.memoCause.Value, ""))) = 0) Or ((Len(Nz(Me![qry6DPermAction
subform].Form.txt6DPermAct1.Value, ""))) = 0) Or ((Len(Nz(Me![qry6DPermAction
subform].Form.txt6DMem1.Value, ""))) = 0) Or ((Len(Nz(Me![qry6DPermAction
subform].Form.txt6DDue1.Value, ""))) = 0) Or
((Len(Nz(Me![frmSub7DPAEffect].Form.txt7DPAEffect1.Value, ""))) = 0) Or
((Len(Nz(Me![frmSub7DPAEffect].Form.txt7DMem1.Value, ""))) = 0)) Then

Jeff Boyce said:
Jack

Just inspecting the code, I noticed that the .txt6DDue comparison of the IF
statement ends with two closing parentheses, while all the rest end with
one. Is that significant?

Regards

Jeff Boyce
Microsoft Office/Access MVP

Jack said:
Hi,
I am using the following code in the form load event to lock a field on a
form based on values of fields in the main and the subform. However when I
am
running this form I am getting the above error:
There is an invalid use of the .(dot) or ! operator or invalid parenthesis

I cannot figure out why I am receiving such message. The application
compiles thought. Any help is appreciated. Thanks

CODE:
'Trying to lock the value txtResonseReceivedDate
If (((Len(Nz(Me.memoCause.Value, ""))) = 0) Or _
((Len(Nz(Me![qry6DPermAction subform].Form.txt6DPermAct1.Value, ""))) = 0)
Or _
((Len(Nz(Me![qry6DPermAction subform].Form.txt6DMem1.Value, ""))) = 0) Or
_
((Len(Nz(Me![qry6DPermAction subform].Form.txt6DDue1.Value, ""))) = 0)) Or
_
((Len(Nz(Me![frmSub7DPAEffect].Form.txt7DPAEffect1.Value, ""))) = 0) Or _
((Len(Nz(Me![frmSub7DPAEffect].Form.txt6DMem1.Value, ""))) = 0) Or _
((Len(Nz(Me![frmSub7DPAEffect].Form.txt6DDue1.Value, ""))) = 0) Then
txtResponseReceivedDate.Locked = True
Else
txtResponseReceivedDate.Locked = False
End If
 
J

Jack

This is the correct expression. I guess I am bit stressed out:
If ((Len(Nz(Me![qry6DPermAction subform].Form.txt6DDue1.Value, ""))) = 0) Then
The above field is a date field. Not sure why this simple expression will
not work.

Jack said:
OK Jeff,
I finally have come up with the problem field. I have the following as the
code now (commenting the rest).
If ((Len(Nz(Me![frmSub7DPAEffect].Form.txt6DMem1.Value, ""))) = 0) Then
..
The above is giving error message. So I guess for some reason the expression
is not correct which I cannot figure out why. Any clues?


Jack said:
Hi Jeff,
That extra parenthesis is wrong. I took that off. Even then I was getting
the same error. One reason was because I was referencing fields that were not
part of corresponding subform. Now I have eliminated all the problems one by
one. However one field which has been giving same trouble is the date field
of the subform with 6 while I have not brought the corresponding date field
of 7. I am not sure why this is bombing out. Lastest code is the following:
If (((Len(Nz(Me.memoCause.Value, ""))) = 0) Or ((Len(Nz(Me![qry6DPermAction
subform].Form.txt6DPermAct1.Value, ""))) = 0) Or ((Len(Nz(Me![qry6DPermAction
subform].Form.txt6DMem1.Value, ""))) = 0) Or ((Len(Nz(Me![qry6DPermAction
subform].Form.txt6DDue1.Value, ""))) = 0) Or
((Len(Nz(Me![frmSub7DPAEffect].Form.txt7DPAEffect1.Value, ""))) = 0) Or
((Len(Nz(Me![frmSub7DPAEffect].Form.txt7DMem1.Value, ""))) = 0)) Then

Jeff Boyce said:
Jack

Just inspecting the code, I noticed that the .txt6DDue comparison of the IF
statement ends with two closing parentheses, while all the rest end with
one. Is that significant?

Regards

Jeff Boyce
Microsoft Office/Access MVP

Hi,
I am using the following code in the form load event to lock a field on a
form based on values of fields in the main and the subform. However when I
am
running this form I am getting the above error:
There is an invalid use of the .(dot) or ! operator or invalid parenthesis

I cannot figure out why I am receiving such message. The application
compiles thought. Any help is appreciated. Thanks

CODE:
'Trying to lock the value txtResonseReceivedDate
If (((Len(Nz(Me.memoCause.Value, ""))) = 0) Or _
((Len(Nz(Me![qry6DPermAction subform].Form.txt6DPermAct1.Value, ""))) = 0)
Or _
((Len(Nz(Me![qry6DPermAction subform].Form.txt6DMem1.Value, ""))) = 0) Or
_
((Len(Nz(Me![qry6DPermAction subform].Form.txt6DDue1.Value, ""))) = 0)) Or
_
((Len(Nz(Me![frmSub7DPAEffect].Form.txt7DPAEffect1.Value, ""))) = 0) Or _
((Len(Nz(Me![frmSub7DPAEffect].Form.txt6DMem1.Value, ""))) = 0) Or _
((Len(Nz(Me![frmSub7DPAEffect].Form.txt6DDue1.Value, ""))) = 0) Then
txtResponseReceivedDate.Locked = True
Else
txtResponseReceivedDate.Locked = False
End If
 
M

Mike Painter

If you did it it gets a bang. (created a form or field or ...)
If MSFT did it it gets a dot.

EG
Me![qry6DPermAction subform].Form.txt6DDue1.Value
should be
Me![qry6DPermAction subform]!Form.txt6DDue1.Value
 
J

Jack

Thanks for your help Mike. However it did not work and gave me the following
error message:
System cannot find the field 'Form' referred to in your expression

Mike Painter said:
If you did it it gets a bang. (created a form or field or ...)
If MSFT did it it gets a dot.

EG
Me![qry6DPermAction subform].Form.txt6DDue1.Value
should be
Me![qry6DPermAction subform]!Form.txt6DDue1.Value


Hi,
I am using the following code in the form load event to lock a field
on a form based on values of fields in the main and the subform.
However when I am running this form I am getting the above error:
There is an invalid use of the .(dot) or ! operator or invalid
parenthesis

I cannot figure out why I am receiving such message. The application
compiles thought. Any help is appreciated. Thanks

CODE:
'Trying to lock the value txtResonseReceivedDate
If (((Len(Nz(Me.memoCause.Value, ""))) = 0) Or _
((Len(Nz(Me![qry6DPermAction subform].Form.txt6DPermAct1.Value, "")))
= 0) Or _
((Len(Nz(Me![qry6DPermAction subform].Form.txt6DMem1.Value, ""))) =
0) Or _ ((Len(Nz(Me![qry6DPermAction subform].Form.txt6DDue1.Value,
""))) = 0)) Or _
((Len(Nz(Me![frmSub7DPAEffect].Form.txt7DPAEffect1.Value, ""))) = 0)
Or _ ((Len(Nz(Me![frmSub7DPAEffect].Form.txt6DMem1.Value, ""))) = 0)
Or _ ((Len(Nz(Me![frmSub7DPAEffect].Form.txt6DDue1.Value, ""))) = 0)
Then txtResponseReceivedDate.Locked = True
Else
txtResponseReceivedDate.Locked = False
End If
 
J

Jeff Boyce

If that's a date/time data type field, you might need to compare to a null.

Regards

Jeff Boyce
Microsoft Office/Access MVP

Jack said:
This is the correct expression. I guess I am bit stressed out:
If ((Len(Nz(Me![qry6DPermAction subform].Form.txt6DDue1.Value, ""))) = 0)
Then
The above field is a date field. Not sure why this simple expression will
not work.

Jack said:
OK Jeff,
I finally have come up with the problem field. I have the following as
the
code now (commenting the rest).
If ((Len(Nz(Me![frmSub7DPAEffect].Form.txt6DMem1.Value, ""))) = 0) Then
..
The above is giving error message. So I guess for some reason the
expression
is not correct which I cannot figure out why. Any clues?


Jack said:
Hi Jeff,
That extra parenthesis is wrong. I took that off. Even then I was
getting
the same error. One reason was because I was referencing fields that
were not
part of corresponding subform. Now I have eliminated all the problems
one by
one. However one field which has been giving same trouble is the date
field
of the subform with 6 while I have not brought the corresponding date
field
of 7. I am not sure why this is bombing out. Lastest code is the
following:
If (((Len(Nz(Me.memoCause.Value, ""))) = 0) Or
((Len(Nz(Me![qry6DPermAction
subform].Form.txt6DPermAct1.Value, ""))) = 0) Or
((Len(Nz(Me![qry6DPermAction
subform].Form.txt6DMem1.Value, ""))) = 0) Or
((Len(Nz(Me![qry6DPermAction
subform].Form.txt6DDue1.Value, ""))) = 0) Or
((Len(Nz(Me![frmSub7DPAEffect].Form.txt7DPAEffect1.Value, ""))) = 0) Or
((Len(Nz(Me![frmSub7DPAEffect].Form.txt7DMem1.Value, ""))) = 0)) Then

:

Jack

Just inspecting the code, I noticed that the .txt6DDue comparison of
the IF
statement ends with two closing parentheses, while all the rest end
with
one. Is that significant?

Regards

Jeff Boyce
Microsoft Office/Access MVP

Hi,
I am using the following code in the form load event to lock a
field on a
form based on values of fields in the main and the subform. However
when I
am
running this form I am getting the above error:
There is an invalid use of the .(dot) or ! operator or invalid
parenthesis

I cannot figure out why I am receiving such message. The
application
compiles thought. Any help is appreciated. Thanks

CODE:
'Trying to lock the value txtResonseReceivedDate
If (((Len(Nz(Me.memoCause.Value, ""))) = 0) Or _
((Len(Nz(Me![qry6DPermAction subform].Form.txt6DPermAct1.Value,
""))) = 0)
Or _
((Len(Nz(Me![qry6DPermAction subform].Form.txt6DMem1.Value, ""))) =
0) Or
_
((Len(Nz(Me![qry6DPermAction subform].Form.txt6DDue1.Value, ""))) =
0)) Or
_
((Len(Nz(Me![frmSub7DPAEffect].Form.txt7DPAEffect1.Value, ""))) =
0) Or _
((Len(Nz(Me![frmSub7DPAEffect].Form.txt6DMem1.Value, ""))) = 0) Or
_
((Len(Nz(Me![frmSub7DPAEffect].Form.txt6DDue1.Value, ""))) = 0)
Then
txtResponseReceivedDate.Locked = True
Else
txtResponseReceivedDate.Locked = False
End If
 
J

Jack

Jeff,
Can you show an example of your suggestion. Thanks.

Jeff Boyce said:
If that's a date/time data type field, you might need to compare to a null.

Regards

Jeff Boyce
Microsoft Office/Access MVP

Jack said:
This is the correct expression. I guess I am bit stressed out:
If ((Len(Nz(Me![qry6DPermAction subform].Form.txt6DDue1.Value, ""))) = 0)
Then
The above field is a date field. Not sure why this simple expression will
not work.

Jack said:
OK Jeff,
I finally have come up with the problem field. I have the following as
the
code now (commenting the rest).
If ((Len(Nz(Me![frmSub7DPAEffect].Form.txt6DMem1.Value, ""))) = 0) Then
..
The above is giving error message. So I guess for some reason the
expression
is not correct which I cannot figure out why. Any clues?


:

Hi Jeff,
That extra parenthesis is wrong. I took that off. Even then I was
getting
the same error. One reason was because I was referencing fields that
were not
part of corresponding subform. Now I have eliminated all the problems
one by
one. However one field which has been giving same trouble is the date
field
of the subform with 6 while I have not brought the corresponding date
field
of 7. I am not sure why this is bombing out. Lastest code is the
following:
If (((Len(Nz(Me.memoCause.Value, ""))) = 0) Or
((Len(Nz(Me![qry6DPermAction
subform].Form.txt6DPermAct1.Value, ""))) = 0) Or
((Len(Nz(Me![qry6DPermAction
subform].Form.txt6DMem1.Value, ""))) = 0) Or
((Len(Nz(Me![qry6DPermAction
subform].Form.txt6DDue1.Value, ""))) = 0) Or
((Len(Nz(Me![frmSub7DPAEffect].Form.txt7DPAEffect1.Value, ""))) = 0) Or
((Len(Nz(Me![frmSub7DPAEffect].Form.txt7DMem1.Value, ""))) = 0)) Then

:

Jack

Just inspecting the code, I noticed that the .txt6DDue comparison of
the IF
statement ends with two closing parentheses, while all the rest end
with
one. Is that significant?

Regards

Jeff Boyce
Microsoft Office/Access MVP

Hi,
I am using the following code in the form load event to lock a
field on a
form based on values of fields in the main and the subform. However
when I
am
running this form I am getting the above error:
There is an invalid use of the .(dot) or ! operator or invalid
parenthesis

I cannot figure out why I am receiving such message. The
application
compiles thought. Any help is appreciated. Thanks

CODE:
'Trying to lock the value txtResonseReceivedDate
If (((Len(Nz(Me.memoCause.Value, ""))) = 0) Or _
((Len(Nz(Me![qry6DPermAction subform].Form.txt6DPermAct1.Value,
""))) = 0)
Or _
((Len(Nz(Me![qry6DPermAction subform].Form.txt6DMem1.Value, ""))) =
0) Or
_
((Len(Nz(Me![qry6DPermAction subform].Form.txt6DDue1.Value, ""))) =
0)) Or
_
((Len(Nz(Me![frmSub7DPAEffect].Form.txt7DPAEffect1.Value, ""))) =
0) Or _
((Len(Nz(Me![frmSub7DPAEffect].Form.txt6DMem1.Value, ""))) = 0) Or
_
((Len(Nz(Me![frmSub7DPAEffect].Form.txt6DDue1.Value, ""))) = 0)
Then
txtResponseReceivedDate.Locked = True
Else
txtResponseReceivedDate.Locked = False
End If
 
J

Jeff Boyce

If IsNull([YourField])...

Jeff

Jack said:
Jeff,
Can you show an example of your suggestion. Thanks.

Jeff Boyce said:
If that's a date/time data type field, you might need to compare to a
null.

Regards

Jeff Boyce
Microsoft Office/Access MVP

Jack said:
This is the correct expression. I guess I am bit stressed out:
If ((Len(Nz(Me![qry6DPermAction subform].Form.txt6DDue1.Value, ""))) =
0)
Then
The above field is a date field. Not sure why this simple expression
will
not work.

:

OK Jeff,
I finally have come up with the problem field. I have the following as
the
code now (commenting the rest).
If ((Len(Nz(Me![frmSub7DPAEffect].Form.txt6DMem1.Value, ""))) = 0)
Then
..
The above is giving error message. So I guess for some reason the
expression
is not correct which I cannot figure out why. Any clues?


:

Hi Jeff,
That extra parenthesis is wrong. I took that off. Even then I was
getting
the same error. One reason was because I was referencing fields that
were not
part of corresponding subform. Now I have eliminated all the
problems
one by
one. However one field which has been giving same trouble is the
date
field
of the subform with 6 while I have not brought the corresponding
date
field
of 7. I am not sure why this is bombing out. Lastest code is the
following:
If (((Len(Nz(Me.memoCause.Value, ""))) = 0) Or
((Len(Nz(Me![qry6DPermAction
subform].Form.txt6DPermAct1.Value, ""))) = 0) Or
((Len(Nz(Me![qry6DPermAction
subform].Form.txt6DMem1.Value, ""))) = 0) Or
((Len(Nz(Me![qry6DPermAction
subform].Form.txt6DDue1.Value, ""))) = 0) Or
((Len(Nz(Me![frmSub7DPAEffect].Form.txt7DPAEffect1.Value, ""))) = 0)
Or
((Len(Nz(Me![frmSub7DPAEffect].Form.txt7DMem1.Value, ""))) = 0))
Then

:

Jack

Just inspecting the code, I noticed that the .txt6DDue comparison
of
the IF
statement ends with two closing parentheses, while all the rest
end
with
one. Is that significant?

Regards

Jeff Boyce
Microsoft Office/Access MVP

Hi,
I am using the following code in the form load event to lock a
field on a
form based on values of fields in the main and the subform.
However
when I
am
running this form I am getting the above error:
There is an invalid use of the .(dot) or ! operator or invalid
parenthesis

I cannot figure out why I am receiving such message. The
application
compiles thought. Any help is appreciated. Thanks

CODE:
'Trying to lock the value txtResonseReceivedDate
If (((Len(Nz(Me.memoCause.Value, ""))) = 0) Or _
((Len(Nz(Me![qry6DPermAction subform].Form.txt6DPermAct1.Value,
""))) = 0)
Or _
((Len(Nz(Me![qry6DPermAction subform].Form.txt6DMem1.Value,
""))) =
0) Or
_
((Len(Nz(Me![qry6DPermAction subform].Form.txt6DDue1.Value,
""))) =
0)) Or
_
((Len(Nz(Me![frmSub7DPAEffect].Form.txt7DPAEffect1.Value, "")))
=
0) Or _
((Len(Nz(Me![frmSub7DPAEffect].Form.txt6DMem1.Value, ""))) = 0)
Or
_
((Len(Nz(Me![frmSub7DPAEffect].Form.txt6DDue1.Value, ""))) = 0)
Then
txtResponseReceivedDate.Locked = True
Else
txtResponseReceivedDate.Locked = False
End If
 
D

Dirk Goldgar

Mike Painter said:
If you did it it gets a bang. (created a form or field or ...)
If MSFT did it it gets a dot.

That's not strictly true. Bang denotes that what follows is a member of a
collection, while dot denotes that what follows is a property or method.
Access blurs the distinction by making both controls and fields (members of
the Controls and Recodset.Fields collections, respectively) available as
properties of the form, where their names do not conflict with existing
properties.
Me![qry6DPermAction subform].Form.txt6DDue1.Value
should be
Me![qry6DPermAction subform]!Form.txt6DDue1.Value

No, the original version should work, so long as "txt6DDue1" is a control on
the form or a field in its recordsource. More precise would be:

Me![qry6DPermAction subform].Form!txt6DDue1.Value

Your suggested replacement won't work, because "Form" in this context is a
property of the subform control, not a member of any collection.
 
A

AccessVandal via AccessMonster.com

Nz(Me![qry6DPermAction subform].Form.txt6DDue1.Value

This Non Zero function by itself is attemping to change the value to "Blank"
to the control.

Is your table and the column is Index or is there any validation is
preventing it from editing?
This is the correct expression. I guess I am bit stressed out:
If ((Len(Nz(Me![qry6DPermAction subform].Form.txt6DDue1.Value, ""))) = 0) Then
The above field is a date field. Not sure why this simple expression will
not work.
 

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