Enter date range in a form then run query

  • Thread starter Thread starter karaeloko
  • Start date Start date
K

karaeloko

Hi all,

How can I stop a query from running when I open the form and asking me
for the start and end date, so that I can enter the date range in a
form then click a button to run the query?
 
Presumaby this problem occurs because the form is bound to the query.

Remove the criteria from the query. Instead, apply a Filter to the form when
the date fields are chosen.

This takes a bit of code. Here's a comprehensive example:
Search form - Handle many optional criteria
at:
http://allenbrowne.com/ser-62.html

Or here's a simple example that just handles the dates:
Limiting a Report to a Date Range
at:
http://allenbrowne.com/casu-08.html
Although this example talks about opening a report, the code for the filter
is identical. Instead of the OpenReport, you use:
Me.Filter = strWhere
Me.FilterOn = True
 
Back
Top