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 wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

All comboBox's change with one.

Status
Not open for further replies.

richself

Technical User
Jun 27, 2005
37
US
I have several comboBox's on a form. They are all loaded from an Access Database. One table with several columns. Each box loads one column. They all load fine but when I selected an item from one, they all change to that row of the table. If I pick the 4th one down, they all show the 4th one down. Below is my code. I'm sure I'm missing something easy. I'm rather new at all this. Thanks

codesDataAdapter.Fill(DataSet2)

With processComboBox
.Items.Clear()
.DataSource = DataSet2.Tables("codes")
.DisplayMember = ("General")
End With

With maintenanceComboBox
.Items.Clear()
.DataSource = DataSet2.Tables("codes")
.DisplayMember = "Process"
End With

Codes is my Table within the database and "Process" and "General" are fields.
 
I would create a different DataSet for each comboBox. One dataSet only contain one column.
 
The behaviour you experience is to be expected, as they are all bound to the same datasource.

You could populate the combos manually use items.add, and not databind them.


Sweep
...if it works dont f*** with it
...if its f****ed blame someone else
...if its your fault that its f***ed, say and admit nothing.
 
The items would change from time to time so I thought it easier to load from a Access file.

I have taken wangdong's suggestion and used seperate DataSets and it works great. Thanks

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top