How do I create combo box composed of previous data entries?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,

I just want to have a combo box where the options are all the previous
entries not unlike the drop down box for website addresses in the IE address
bar.

Ideally, it would be good if these values were from another table so that
the other table automatically updates if a new value is entered in the table
with the combo box.

Any ideas?

Josh
 
Hi,

I just want to have a combo box where the options are all the previous
entries not unlike the drop down box for website addresses in the IE address
bar.

Use a Query such as

SELECT DISTINCT fieldname FROM yourtable
WHERE fieldname IS NOT NULL
ORDER BY fieldname;

as the RowSource property of the combo box.
Ideally, it would be good if these values were from another table so that
the other table automatically updates if a new value is entered in the table
with the combo box.

You can use the "Not In List" event of the combo to set this up.
Create the table you describe; base your combo on a query sorting
those values, and set its Limit to List property to True. See
http://www.mvps.org/access and search for "Not In List" for sample VBA
code.

John W. Vinson[MVP]
 
Back
Top