Combo-Box - Choice for All

smaumau

Registered User.
Local time
Today, 05:00
Joined
Feb 23, 2006
Messages
32
I am trying to use a combo-box on a form to limit/select records to be displayed on report.

I would like to have the option of "All/Any" in the drop-down list. If All/Any is selected I would like the report query to allow all records with any result in that particular field.

I hope this makes sense.

Thanks.
 
Replace your combobox RowSource with this

Code:
SELECT YourField FROM YourTable
UNION SELECT "<All/Any>" FROM YourTable;

filling in your actual field and table names.

Then use this code in the AfterUpdate of your combobox, once again filling in the actual name of your combobox:
Code:
Private Sub YourCombobox_AfterUpdate()
If Me.YourCombobox = "<All/Any>" Then
'Place code here to address selction of <All/Any>
End If
End Sub
 

Users who are viewing this thread

Back
Top Bottom