Combo Box

SRN

Registered User.
Local time
Today, 20:12
Joined
Nov 8, 2002
Messages
21
Hi,

Nice & Easy.

What i have done is based a report on a query defined from the selection of a combo box, the query is in the after update. The combo box holds all departments for the company. so in the query i have [forms]![frmdept]![combo1], once the user has selected a single dept from the Combo box the report is produced.

What i need to do is have the all option in the combo box so if selected it will produce a report with all departments being shown in report.

I have already tried Q128881, but that never seemed to work, i was just getting a blank report.

Am i doing something wrong?
 
try changing
[forms]![frmdept]![combo1]
to
Like iif([forms]![frmdept]![combo1]="all","*",[forms]![frmdept]![combo1])

Or something like that...

Regards
 
Set the criteria as:

[forms]![frmdept]![combo1] Or [forms]![frmdept]![combo1] Is Null
 
Hi!
The combox will allow a blank (null value) so just include that in your tests e.g. I use this SQL where clause on my supplier file where the user wants to enquire on all products supplied by a certain supplier, or blank for all with the selection from a combobox:
WHERE (((Supplier.[Supplier Name])=[Forms]![Supplier Products Query Prompt]![Combo0]) AND (([Forms]![Supplier Products Query Prompt]![Combo0]) Is Not Null)) OR ((([Forms]![Supplier Products Query Prompt]![Combo0]) Is Null))

Hope this helps!
 
Selecting "all" in a ComboBox is explained with example code you can copy in the Developers Solutions database.

Col
 
ColinEssex, the method in the Solutions Database is the same one described in the article number the user posted. I've never tried it, but it seems rather convoluted given that the other option I am aware of is to add "all" using a union query.
 

Users who are viewing this thread

Back
Top Bottom