Query Criteria: Perform a BETWEEN 2 numbers from a form

NickLes518

Registered User.
Local time
Today, 17:52
Joined
Mar 12, 2010
Messages
11
I'm am trying to write criteria for a query to display records with a value between 2 numbers on my form. Also, if these boxes are Null, I want to display all records.

I have done a similar thing with all of my other criteria in the query. I used the criteria:

Like [Forms]![FormName].[ControlName] & "*"

Is there a way to do basically the same thing, but with a Between Statement??

I attached the database if that makes it easier to review.
 

Attachments

You can cheat the between by using the following

Bewteen Nz([StartNo],0) And nz([EndNumber],100000000) Or Is Null

Effectively if the user does not enter anything in the referenced control the nz() substitues it with either 0 for the start and 10m for the end. Also by adding is not null captures all the empty records as well.
 
Awesome!! Worked perfectly. Thanks for the help!
 
Glad it worked. I had never thought about that method before you asked. So hope it helps others as well.:)
 

Users who are viewing this thread

Back
Top Bottom