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 Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Adding All to a combobox list

Status
Not open for further replies.

TruthAndBeauty

Technical User
Jun 4, 2001
38
US
I want the list to include an "All" option to my combo box listing.
My combo box source is a select distinct EmplType from tbl_Emp. I want the combo box to capture type from a table rather than hard code the listing.

I prefer not to use a list box but perhaps it's a limitation.

Any help would be appreciated.
 
In general, I never add an "all" option. I tell my users that if they want "all" for this particular criteria then just leave the combo box selection empty.

Then, where you have your VBA code to pull from the combo box, just wrap it with a...
If Not(IsNull(me!combobox)) Then
Criteria = "blah blah blah = " me!combobox
End if

Maq [americanflag]
<insert witty signature here>
 
I thought of using a option group with the combo box the apporach seems so bulky.

I understand what you're suggesting but then I would be depending on my user to infer that a blank value means something (ALL, None, etc.) unless I use up addtional space on the form to explain the concept rather than have &quot;All&quot; (All males, &quot;All females&quot;, or &quot;None&quot;) as the default on my list.

Why do you avoid putting ALL in the list?

Is it possible to append words to a combo box that is using a select statement?

 
I suppose it really depends on what you are using the combo box for.

For my needs, when I put combo boxes on a form they are either bound to a table where it doesn't matter whether or not a user ignores them, or I have a bunch of combo and text boxes which my users will fill in and then click a button to execute a search or report.

Normally, I'll have 5 or more boxes with criteria options and the users will only be using 1 or 2 at a time to pick criteria. Since they don't want to have to mess with the criteria they don't need to filter, I just tell them that anything they leave blank will default to &quot;all&quot;.

Anyways, I suppose that is more than you wanted to know. To answer your question, I don't use an 'All' option because of the hassles you're already running into and because putting one in there would be more work for my particular users. And these are folks who complain about having to click buttons rather than having the database read their minds and automatically open what they need. (I tell them, that's in phase 2 of the project.)

I believe I just saw another thread in the Microsoft Access forms forum which could answer your original question. Someone there asked about putting an 'N/A' option in his combo boxes. I think this is the correct link.
thread702-651152

Maq [americanflag]
<insert witty signature here>
 
I answered this not 2 minutes ago in the Access Forms forum ... thread702-651152
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top