We are developing a form and one of the drop down boxes needs to contain
about 50 items. The lady that is doing this is using 2003. She tried the
above web site and keeps getting an error ('Load data into ComboBox error).
It worked for me fine, but I used 2002 (XP).
Mary Lou
> >We are developing a form where we need to add a drop down box for many
> >choices. I guess I am not very technical with this question.
[quoted text clipped - 8 lines]
>
> John W. Vinson[MVP]
Jeff Boyce - 15 Jul 2005 16:36 GMT
While you can (technically) "add items to a combo box", what you end up with
is a list of items embedded within the properties of that combo box. This
makes the list more difficult to maintain/edit.
A common way to handle a combo box/drop-down box is:
* first, be working in a form, not directly in a table.
* next, create a new table to which you can add new items, edit existing
items, etc.
* now create a form and add a combo box. When prompted by the combo box
wizard, point to the new table from which you'll be looking up valid choices
in your combo box. (even more preferred, first create a query based on that
'lookup' table and use the query as the row source for the combo box)
* to limit the user to only selecting items from that combo box's list,
set the LimitToList property.
* to give the user the ability to add new items to the list WHILE using
the combo box, create an procedure to run in the combo box's NotInList
event -- this will require some coding.
Check Access HELP on combo box, LimitToList, NotInList for examples of
required syntax & code.
Good luck
Jeff Boyce
<Access MVP>
> We are developing a form and one of the drop down boxes needs to contain
> about 50 items. The lady that is doing this is using 2003. She tried the
[quoted text clipped - 15 lines]
>>
>> John W. Vinson[MVP]
John Vinson - 15 Jul 2005 17:06 GMT
>We are developing a form and one of the drop down boxes needs to contain
>about 50 items. The lady that is doing this is using 2003. She tried the
>above web site and keeps getting an error ('Load data into ComboBox error).
>It worked for me fine, but I used 2002 (XP).
You say "the above web site" but I see no reference to any website -
nor do I know of any reason to use a website to create a combo box.
Could you explain?
Normally one would simply create a small "lookup" table with one field
(the values that you want to insert), or perhaps two (an autonumber ID
and the text field); manually type in the 50 rows; and use the table
as the Row Source of a combo box. It seems you're doing something
else, but I cannot dope out what!
John W. Vinson[MVP]