Can a ComboBox be auto updated & Sorted

P

Parvaiz

Hi Everyone,
I'm using Access 2007 and I'm very new to Access.
I know that a you can only select the set values from a ListBox.
I know that with a ComboBox you can either select the values "On Offer" OR
enter your own value in a field.
My question is as follows:
If I create a ComboBox (Via a Lookup table or manually) and its all nicely
sorted A to Z, and a user chooses to enter thier own value - Then

[1]: Is there any way that, my ComboBox can be automatically updated to
include this new entrythat the user inputed? and;
[2]: Can the updated ComboBox still maintain its A to Z sort order?

Many thanx to all you GURU's out there.
 
D

Douglas J. Steele

To control the sequence of items in the combo box, base it on a query that
has the appropriate ORDER BY clause.

Yes, you can add items to the combo box and have them appear correctly. To
do this, you set the combo box's LimitToList property to True, and put code
in its NotInList event to add the new entry to the underlying table.
http://www.mvps.org/access/forms/frm0015.htm at "The Access Web" shows a
simple example. Sometimes, though, you need additional information to enable
you to make the insertion into the table, so you have to prompt the user for
additional information using the InputBox function, or even opening an
additional form to allow them to input the required information.
 
Top