Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Show all when nothing selected from Combo Box????

Status
Not open for further replies.

Dineedshelp

Technical User
Sep 27, 2002
44
GB
Hi

I have classic combo boxes that look up various fields where users can make their selection and open the required report.

What I can't find out, and I know this is possible as I have found it once before, is that if one of the combo boxes doesn't have anything in, i.e. the user doesn't want to make a selection, how can I get the combo box to show all the fields in the report.

Does this make sense??!!
 
Hi
How does your report work? For example, are you using sql with the combos or a Where statement with On Open or ...?
 
Here's the code:

SELECT [x Apex Charge branch Query].Branch FROM [x Apex Charge branch Query] ORDER BY [Branch];
 
How about this?

Instead of making the report criteria be WHERE value = comboBox.Value try something along the lines of WHERE value LIKE comboBox.Value & '*'

Then, if nothing is selected the LIKE statement will look for all records that match the '*' wildcard pattern, i.e. everything.

[pc2]
 
Another idea is in code do an if statement.

If IsNull(combobox) or combobox = "" Then
Open report will all results....
Else
Open report passing in the criteria of the combobox.
End If

Good Luck!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top