search form -date range

rob.low

Access Nutter
Local time
Today, 11:24
Joined
Dec 27, 2007
Messages
96
Hi all,

I have a Search form that i am useing (downloaded from here a few years ago) and dont know who wrote it orginaly?

Any way it works fine I have 2 search fields that i can search
"make" And "model"

The problem starts here... i have Added 2 More unbound Textboxes To the form 1 named "startdate" and the other "enddate"

I cant work out the vba code required to preform the search on the form behind the search button? on table "clients" field Installdate"

any help or pointers would be apprechaited verry much :)

database attached.

Regards
Rob :)
 

Attachments

Rob,

Take a look at the attached, modified version of your database file.

You had it very close but you had missed having the " AND" at the end of the assignment of the Where part of the sql statement for the dates.

You can compare what you had with what is there now.
 

Attachments

Hi Mr. B ,

Thanks For your help with this ... As you say I was so close yet so far loll
cant belive i missed the and :rolleyes:
would you belive i spent all day yesterday looking at it and never found the mistake :o

Thanks again for your help
Regards
Rob :)
 
Rob,

It is very easy to miss something like that. Just FYI, the way to find things like this is to place a break point just prior to the end of the routing and place the entire variable string that produces the entire sql statement in the Immedate window and have it provide you with the actual sql statement. Then copy that entire sql statement and open the QBE window with an empty query. I will open in SQL view. Just paste in the sql statement for the Immediate window. Then try to open the query. It will tell you where the problem is. This is especially nice when you are reading the statement and just cannot find that one comma or othere punctuation mark.

Just my thoughts.

Good luck with your project.
 

Users who are viewing this thread

Back
Top Bottom