Adding Items to List Boxes

joesmithf1

Registered User.
Local time
Today, 15:45
Joined
Oct 5, 2006
Messages
56
This is a somewhat complicated question to explain, so please bare with me.

I have a form with a ‘list box.’ The box is populated using a Table/Query Row Source Type method. The table I am grabbing the list from is “Department,” where it contains a list of my company’s departments(ie. Accounting, HR, Payroll, etc.).

Now, the only thing this table does not have is the word “ALL.” I need this word in the “List Box” because I want users to have the option to select ALL.

Is there anything in VBScript code wise or in Row Source that I can do to include this word?

I know I can manually go into the Department table to simply add the word, but this is not the point, because there is more to that(I have different list boxes that are grabbing lists from different tables, AND I have to refresh these tables twice a week). Please help.

Thank you.

Joe
 
You can use a union query as the RowSource for the combo. That will allow you to add a value "on the fly" to the list. However, if your users EVER use filters or sort the form's recordsource, the union query will make the form not-updatable. I don't know why but it does.

The solution I use is that I assume null to be "All". To do that, modify your query:

Where somefield = Forms!yourform!yourCombo OR Forms!Yourform!yourcombo Is Null;
 

Users who are viewing this thread

Back
Top Bottom