DoCmd.OpenReport Where Syntax error

eRed

Registered User.
Local time
Yesterday, 21:43
Joined
Oct 27, 2010
Messages
15
This is about a Command Association with a button in a subform

COMMAND
DoCmd.OpenReport "AR", acViewPreview, , "[ar].[ltcfname]=" & Me.ltcfname.Value

When I run the code I get the following error:

Run-time error '3075':

Syntax error (missing operator) in query expression
'[ar].[ltcfname]=Arlington Heights'.

This filter works in the report
([ar].[ltcfname]="Arlington Heights")

the report's name is "AR"

can someone tell me what the heck I am doing wrong??:(
 
If ltcfnamery is a text value it will need to be enclosed in double quotes try;
Code:
DoCmd.OpenReport "AR", acViewPreview, , "[ar].[ltcfname]=" & CHR(34) & Me.ltcfname.Value & Chr(34)
 
Last edited:
....and Welcome to the forum :)
 
John Big Booty you are the man, thanks :)
 

Users who are viewing this thread

Back
Top Bottom