read the value in a combo box

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I think this is a good question?
How would you read the value in a combo box?
A text box is simple enough Y = Me.txtBox1.Value
But a combo box with a column count set to 2 or higher.
Y = Me.cboBox1.Value will only give you the value in the first column, how
would you read the 2nd or 3rd.
 
I think this is a good question?
How would you read the value in a combo box?
A text box is simple enough Y = Me.txtBox1.Value
But a combo box with a column count set to 2 or higher.
Y = Me.cboBox1.Value will only give you the value in the first column, how
would you read the 2nd or 3rd.
Regarding:
Y = Me.cboBox1.Value will only give you the value in the first column,<

cboBox1.Value will give you the value of whatever column is the bound
column, which may or may not be the first column.

To read the 2nd column:
Y = Me![cboBox1].Column(1)

To read the 3rd column:
Y = Me![cboBox1].Column(2)

Combo boxes are 0 based, so column(1) is the 2nd column, column(2) is
the 3rd,
 
Back
Top