Query Criteria from CMBbox: showing ALL data when CMB is empty

JCamara

New Member
Joined
Jan 14, 2015
Messages
38
Hello!

My situation is: i have a form based on a query, and the query's criteria are based on combo boxes inside de form.
fair enough, i can make it filter the results based on what i input on the CMBbox.


problem 1: when that CMBbox is empty (when you launch the form), there's no results, all query's (and therefore form's) lines get blank. When you fill the box, it shows filtered results.
I'd like it to show ALL data when there's nothing sellected. when filling one of the boxes, it'd filter the whole thing.

problem2: if i put more than one combo-box they only work together. i want each one to act as a separate filter, but it only works when all boxes are filled.
I think that solving problem 1 this problem is also solved.


here are my approaches:
-trying to use "*" somewhere on query's criteria (e.g.: like "*[forms]![myform]![myCMB]*" )
-trying to use boolean logic on query's criteria (e.g.: iif([forms]![myform]![myCMB]="";"*";[forms]![myform]![myCMB])

none of them seemed to work...

thanks in advance!
 

Excel Facts

Can you sort left to right?
To sort left-to-right, use the Sort dialog box. Click Options. Choose "Sort left to right"

Forum statistics

Threads
1,215,831
Messages
6,127,143
Members
449,363
Latest member
Yap999

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