We help IT Professionals succeed at work.

Check out our new AWS podcast with Certified Expert, Phil Phillips! Listen to "How to Execute a Seamless AWS Migration" on EE or on your favorite podcast platform. Listen Now

x

Adding options to a combobox - Access95

sbishop
sbishop asked
on
Medium Priority
423 Views
Last Modified: 2008-02-26
My problem is this.  I have a dropdown combobox with a list of options that have been pulled from a table.  This will be an argument for a query.  The problem is I want to add the option of "ALL" into the combobox(as in wanting to query all of the values in the combobox), but I don't want to hard code the table's values into it the combobox(it must go to the database to get the most up-to-date values, as they can change.)

Also, is there anyway that you can start an Access DB with the Access95 program minimised so it can't be seen(just the forms visible)
Comment
Watch Question

Commented:
sbishop,

Your can find your solution on the Access help file. Type AddAllToList function in the Index Tab-page under help.
Your can also find an example on the sample database "Developer solutions" database which comes with MS Access 97. (It should also be included in access 95.) Open the DeveloperSolutions Form. Select "Work with combo boxes, list boxes, ...", and then choose All "(all)" to a list.

Cheers,
Kinfai.

Author

Commented:
Kinfai,
That doesn't work Kinfai.  Help returns nothing similar to AddAllToList.  I am only running Access95 and it's on a Uni computer, so they don't have any example databases to look at.
Where would this function be written?  In the combobox code for what, OnClick? Thanks.

sbishop
Commented:
Unlock this solution with a free trial preview.
(No credit card required)
Get Preview

Commented:
OK, sbishop,

Here is a much simpler way to solve your problem :

For example, you have a table Customers. In RowSource property of control you write:

SELECT id,name FROM Customers UNION SELECT 0 AS id,'(All)' AS
name FROM Customers ORDER BY name

Thats all! no terrific functions, no errors, no headache.

The solution was suggested by a clever guy called Dmitry Aupuchtin.

Commented:
Nice one !
0 should be changed to '*' thought.

Author

Commented:
Thanks Chanlaw, I used your method.  Much eaiser!

Commented:
No need to thank me. If you do appreciate, send compliments to Dmitry Apuchtin:  damian@ems.ru
Unlock the solution to this question.
Thanks for using Experts Exchange.

Please provide your email to receive a free trial preview!

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.