link two fields on a form

F

FL

How can I link two fields on a form. Example: I have a drop down list
(combo box) for Product Description and another field with a drop down list
(combo box) which shows the Product ID number. I want to select the Product
Description from one list and have the Product ID show up in the other field
list automatically. Each Product Description has a unique Product ID.
Records may show the same Product Description and Product ID or different
ones.

Any idea how to link these two fields on my form?
 
J

Jeff Boyce

Rather than use two comboboxes, consider using a single combobox (?to select
Product Description) and having an unbound textbox display the ProductID
belonging to that product.

In the query that feeds your (single) combobox, include both description and
id fields.

In the AfterUpdate event of the combobox, include something like:

Me!txtProductID = Me!cboProductDescription.Column(1)

where .Column() is zero-based ... start counting columns in the query at "0"

Good luck

Regards

Jeff Boyce
Microsoft Office/Access MVP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top