M Monoceros Registered User. Local time Today, 17:26 Joined Oct 30, 2006 Messages 27 Mar 21, 2016 #1 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 ?
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 ?
Ranman256 Well-known member Local time Today, 12:26 Joined Apr 9, 2015 Messages 4,348 Mar 21, 2016 #2 'strings must have quotes DoComd.OpenReport "rptCosts", acViewPreview,"[fieldname]='UD'" or DoComd.OpenReport "rptCosts", acViewPreview,"[fieldname]='" & txtString & "'" numbers DoComd.OpenReport "rptCosts", acViewPreview,"[fieldname]=" & txtNum
'strings must have quotes DoComd.OpenReport "rptCosts", acViewPreview,"[fieldname]='UD'" or DoComd.OpenReport "rptCosts", acViewPreview,"[fieldname]='" & txtString & "'" numbers DoComd.OpenReport "rptCosts", acViewPreview,"[fieldname]=" & txtNum
M Monoceros Registered User. Local time Today, 17:26 Joined Oct 30, 2006 Messages 27 Mar 21, 2016 #3 Thank you.