All option on combo box

pofe333

Registered User.
Local time
Yesterday, 20:45
Joined
Mar 9, 2009
Messages
42
Hello, hopefully there is an easy answer to this. I have a form with a combo box linked to a query containing department names. I used code I found named AddAllToList to create an "all" option in the combo box. Everything shows up fine, but the problem is I have another query that uses the department selected on the combo box in the form and no results show up when all is selected. Each individual department works okay

It seems like maybe it is looking for a department named "all" (for which there are none), is this correct? What am I missing for it to treat "all" as if no parameters were entered for the department field of the query? Thanks for any help!
 
Not sure how you added "All", but this technique:

http://www.mvps.org/access/forms/frm0043.htm

would use this one:

http://www.mvps.org/access/queries/qry0001.htm

I think what I used would be close to the callback function, but either way the second link you provided gets the results I needed. It doesn't work when "all" is selected, but it does when the top blank row is. So I'll just put a note to leave blank if wanting unfiltered results. Thanks!
 
No problem. I usually do the same thing.
 
in the way a combobox is NORMALLY used, the value selected is a foreign key in an associated table.

now if you add the value <ALL> with a union query - quite clearly there will be no matches for the FK of <ALL> - so you need another technique to seelct records, when you select the <ALL> item in the combo box.
 
In the technique I referenced, the bound column would contain Null, so the second technique should work when All is selected.
 

Users who are viewing this thread

Back
Top Bottom