Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Setting values of 2 combo boxes w/ same row source and eliminating dup

Status
Not open for further replies.

etalent

Programmer
Jun 9, 2003
23
0
0
US
I've got two combo boxes that work really closely to what I want, but they've still got 2 problems:

(1) When you make a selection with one combo box, the value of the other combo box should be (programatically) set, but as it is now I have to select the right value from each combo box individually.

Both combo boxes get their values from the same table, same record, but different columns, so it seems easy that when the value of one combo box gets set, the other should too automatically.

(2) Both combo boxes have duplicates in their drop down lists. How do I fix that?

My database is only 250 KB. Pleaes let me send it to you.
-Thanks!
 
To eliminate duplicates in the combo box, make the Row Source of the combo box look something like this:

SELECT DISTINCT fieldName FROM tableName.

To automatically update comboBox2, you will need to write some code in one of the events for comboBox1. I find that the AfterUpdate event is usually a good choice.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top