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

Why does 9 mean SUM in SUBTOTAL?
It is because Sum is the 9th alphabetically in Average, Count, CountA, Max, Min, Product, StDev.S, StDev.P, Sum, VAR.S, VAR.P.

Forum statistics

Threads
1,225,531
Messages
6,185,486
Members
453,297
Latest member
alvintranvcu123

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