Synttax for opening report with where clause

Monoceros

Registered User.
Local time
Today, 17:26
Joined
Oct 30, 2006
Messages
27
I don't seem to get the right syntax for opening a report with only the records where the field Reference equals UD :

DoComd.OpenReport "rptCosts", acViewPreview, , Reference= "UD"

What's wrong with the syntax ?
 
'strings must have quotes
DoComd.OpenReport "rptCosts", acViewPreview,"[fieldname]='UD'"
or
DoComd.OpenReport "rptCosts", acViewPreview,"[fieldname]='" & txtString & "'"

numbers
DoComd.OpenReport "rptCosts", acViewPreview,"[fieldname]=" & txtNum
 
Thank you.
 

Users who are viewing this thread

Back
Top Bottom