If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

Re:why is this happen?

[Originally posted by Tom Lewandowski]

If your string in the question is exactly the same as as the code in your app, it may have something to do with the two single quotes after the 'BookType=' and before the 'AND'.˙ Try putting only a single quote at these places.

With two single quotes, I actually get an error. If I change it to one single quote at each place, the query works fine.

Re:Re:Re:why is this happen?

[Originally posted by Tom Lewandowski]

I don't know what the DataReport1 object is.˙ I am not familiar with that control.˙ I create recordsets using the DAO OpenRecordset method.

I am wondering why you changed the '#' before and after your dates to a single quote.˙ If you use the '#' before and after a date string, the database driver should return the correct records.˙ Copy and paste the following code into you program and see if it works.

Re:Tom , there is an error

[Originally posted by Tom Lewandowski]

The problem is you were using a datepicker control in your first example then it looks like you changed it to a string.˙ I assumed the start and end dates were still date pickers.˙ The problem is the sStartDate is not an object so sStartDate.Value will produce and error.˙ Try the following instead.