Re: Adding where command or filter into code??

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



Hi Carl, Thank You
Ive put it where you said, Im pressuming that the Client Field is that name
of the field from the main table that the report is created from
In the main table the client field is called ....Client Name
So I am putting in
......
End If

Debug.Print strWhere 'For debugging purposes only.

strWhere = strWhere & " AND Client Name ='" & clientdatecombo & "'"

DoCmd.OpenReport strReport, acViewPreview, , strWhere

I keep getting the error message...

Run Time Error 3075
Syntax error (missing operator) in query expression '(DateJobReceivedBetween
#01/10/2000# And #01/01/2020# AND Client Name = 'Barracuda Ltd')'.

The date is what i put in to test, Barracuda is what I selected from the drop-
down box.

When I click Debug, it highlights in yellow the DoCmd... Line

Any Ideas?

Thanks Again for all your help I really appreciate it !!


Carl Rapson wrote:
You should put it right after the last End If, just before you call
OpenReport. I just made up the name of the Client field; you'll need to put
in your actual field name.

Carl Rapson

Hi Carl, thank you for replying!
I have one slight problem, I cant get it to work. Maybe Im putting it in
[quoted text clipped - 28 lines]

Thank You For Your Help !!!!

--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/Forums.aspx/access-forms/200703/1

.