I am trying to generate a query (by date) by using two textboxes on a form, instead of putting something like ">[StartDate] And <[FinishDate]" in the criteria of the date field in the query.
I have one textbox named SD, and one named FD. I want to be able to query the data by the dates between those two textboxes. Any ideas?
BTW, I have tried to use expression builder to make an expression with the textboxes in, but it doesn't work. I must be doing something wrong.
The following SQL use a form named Form3 where there is two textboxes, txtDate1, txtDate2 containing the date the query use. The Query select statements from the table Table2 using the field TheDate and forms criteria. You must make sure the form is open (or open and invisible), when you run the query.
WHERE (((Table2.TheDate)>=[Forms]![Form3]![txtDate1]) AND ((Table2.TheDate)<=[Forms]![Form3]![txtDate2]));
If you can't make it works, post the SQL code, you may have done a typo mistake