Multi Column Combobox - Select Case

  • Thread starter Thread starter jake
  • Start date Start date
J

jake

I have a combobox with several columns
dr name; address; city; state; zip

Question - can I use "Select Case" to populate all of the following
fields with data from the multiple column combo?

Thanks, Jake
 
You would not use a Select Case, rather, the code you are
looking for is:

With Me
.txtDrName = .comboMyComboBox.Column(0)
.txtAddress = .comboMyComboBox.Column(1)
.txtCity = .comboMyComboBox.Column(2)
.txtState = .comboMyComboBox.Column(3)
.txtZip = .comboMyComboBox.Column(4)
End With
 
jake said:
I have a combobox with several columns
dr name; address; city; state; zip

Question - can I use "Select Case" to populate all of the following
fields with data from the multiple column combo?


I'm not sure what you're asking here, but I don't think a
Select Case is needed. You can just refer to the other
columns in the combo box using the Column property.

Me.txtCity = Me.combobox.Column(2)

But the data in the combo box's RowSource should be in a
table with a primary key and the only data saved in the
form's table should be that primary key (i.e. the combo
box's bound column).
 
Back
Top