Query Report results from combo box

Dimples

Registered User.
Local time
Today, 17:03
Joined
Aug 19, 2005
Messages
15
I prompt users for different values and my report prints off what values the user chooses from the combo boxes. However, how do I get it to recognize that I want it to print ALL records for that category if the user doesnt select anything?
 
Try in the underlying Query Criteria of the Field that the combo box is filtering

IIf(IsNull([Forms]![YourForm].[yourCombobox]),"*",[Forms]![yourForm].[your combobox])
 
Still Trouble in Paradise

Thanks for the suggestion but that didnt seem to work.

If I make a selection then it will pull records. However, if I make no selection then no records are pulled for the report. Any other ideas of what may be going on here?
 
Thanks! Got it!!

:o Nevermind. Got it! I was just being an idiot. I left a key word out. Thanks!!
 
I've faced that situation myself. The solution I used was to use the Criteria options when developing the query.

I set a where statement in the query that checks the combo box eg:
[Forms]![DateRangeForm]![managerList]
Where
Is Null

In the field that you are testing the combo box against leave the criteria blank.

This accounts for the unselected option in the combo box.

On the next line I leave the combo box criteria blank but on the field that has to match the combo box selection I enter the criteria of
[Forms]![DateRangeForm]![managerList]

or I set it to Like "[Forms]![DateRangeForm]![managerList]*" or whatever you need to get your desired results.

There might be faster running methods but using this method I can test across multiple combo boxes to be blank or filled in any combination to select all or limit the selection greatly.
 

Users who are viewing this thread

Back
Top Bottom