Enter date range in a form then run query

  • Follow


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?

0
Reply karaeloko 4/8/2007 8:56:15 PM

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

-- 
Allen Browne - Microsoft MVP.  Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

<karaeloko@gmail.com> wrote in message
news:1176065775.140969.218400@w1g2000hsg.googlegroups.com...
>
> 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? 

0
Reply Allen 4/9/2007 4:20:16 AM


1 Replies
606 Views

(page loaded in 0.188 seconds)

Similiar Articles:
















7/25/2012 6:05:37 PM


Reply: