How to show all records when parameter left blank?

arashii

Registered User.
Local time
Today, 02:14
Joined
Feb 12, 2007
Messages
22
Hi guys, I have a query that displays records that fall between 2 dates (using 2 input text fields). How can I make it dispaly all records if the user just leaves the dates blank?

I've searched through some forums and found that I can make this happen by using IS NOT NULL. But when I tried putting it in the OR row in my date field (and all other places), the result is that the query displays all records that have a date value regardless of my other filters.

Can anyone point me in the right direction where I should actually place the IS NOT NULL? I attached my Query view for easier understanding.

Thanks a lot!
 

Attachments

  • Query.JPG
    Query.JPG
    49.8 KB · Views: 338
Hello arashii!

There are many way for do this.
One I often use is this. When you open the
form, the DATE fields are populated. (it means
all records). Look at DEFAULT VALUE in DATE fields.
Look at attachment.
 

Attachments

Hi, thanks a lot, it solves my problem :) .

How about if the field isn't a date or number field though?
 
Hello arashii!

Look at "DemoQrySelectAllA2000.mdb",
it is a simple example, open Form1.
Look at Table1. Query1.
 

Attachments

Users who are viewing this thread

Back
Top Bottom