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!

Using Two Combo Box updating each others source based on same Table

Status
Not open for further replies.

bn2335813

Programmer
Oct 8, 2001
10
IL
1. I'm using a Form for generating a Report based on a Query.
2. I would like to have on the Form two Combo Box (CmbA & CmbB) based on the same Record of Table\Query but different fields.
3. The CmbA and CmbB should operate like this :
a. When changing the Record selection on CmbA to a new one,it will change the content of CmbB field (based on the same new Record).
b When changing the Record selection on CmbB to a new one,it will change the content of CmbA field (based on the same new Record).

tanks in advance !!
 
It looks like you want at least one multicolumn combobox and connect the two comboboxes to the same field in the database.

Use a query containing more than one field as the rowsource for the combobox, set the bound column to the first row and set the width of the first column to zero.

Good luck
 
First thanks for the reply !. Second Please read carefully , I would like to have TWO Combo Box each one of them having a different field of the same Record.Changing the selection on One Combo (By this changing the Record) will change the Content of the Second Combo (that have the other field ) to the same Record as the first Combo but to show the new content.
 
It seems that you want the record selected based kindof on a WHERE statement like:

WHERE FieldA = CmbA or FieldB = CmbB depending upon whichever was just entered.

you might be able to do this by having the OnChange event of each combo box set itself into the WHERE satement

On open event for CmbA sets WHERE to read:

WHERE FieldA = CmbA

and the On Open event for CmbB sets the WHERE to read:

WHERE FieldB = CmbB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top