Quering with parametes

DevAccess

Registered User.
Local time
Yesterday, 21:00
Joined
Jun 27, 2016
Messages
321
Hello

I am opening one query based on button click event. Now query takes parameters and first and last date and customer code so I have it on form. Now I have also All option on my form which should display all records from query in datasheet view despite of the criteria given in form and in query.

So I was wondering how shall I use same query to have this kind of functionality I mean it should take parameters as well as it should display all records when clicked on All.

By default query design is to take parameters first and last date and customer code and I want these parameters ignored when clicked on "All" Options

Any help would be appriciated.
 
create an ALL query, qsDataAll the runs if the date range is null.
Code:
if IsNull(txtStartDate) then
  docmd.openquery "qsDataAll"
else
  docmd.openquery "qsDataRange"
endif
 

Users who are viewing this thread

Back
Top Bottom