Query Selection Criteria

TheNoocH

Well-known Member
Joined
Oct 6, 2004
Messages
3,482
I have a form that has 2 text boxes...Item From and Item To
I have a query that i want to set up to read the two boxes as my search criteria...
I have it working using the following...
Between [forms]![frmInv]![txtItemFr] And [forms]![frmInv]![txtItemTo]
I tried putting in an * into both the from and to in an effort to show all records....but that didn't work....any ideas? my goal is to default the text boxes to show all records...thanks
 

Excel Facts

What is =ROMAN(40) in Excel?
The Roman numeral for 40 is XL. Bill "MrExcel" Jelen's 40th book was called MrExcel XL.
What kind of field is this? Is it a date field? If so may need txtItemFr and txtItemTo to be formatted as dates, or handled a little differently.
 
Upvote 0
It is a text field...it accepts item numbers...
my workaround was to default the from = 0 and the to = zzzzzzzz
it appears to work but i thought there might be an easier way to do it to ensure it's all encompassing
 
Upvote 0
Wildcards only work with the LIKE operator that is why typing "*" did not work for you. Your work-around should work well, except that it will ignore nulls. Post back if you have null values and need to come up with a more all encompassing solution
 
Upvote 0

Forum statistics

Threads
1,214,585
Messages
6,120,399
Members
448,957
Latest member
Hat4Life

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top