How to reference Combo Box ?

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

Guest

I have a combo box control with 2 columns. How can I reference to the columns? Is it the same as list box? Appreciate someone can show me the codes. Thanks.
 
Check Access VB Help on the Column() Property of the ListBox / ComboBox.

Note that both Columns & Rows are zero-indexed so if you want the first
Column in the first row, you need to use:

Me.ComboBox.Column(0,0)

--
HTH
Van T. Dinh
MVP (Access)


Chris said:
I have a combo box control with 2 columns. How can I reference to the
columns? Is it the same as list box? Appreciate someone can show me the
codes. Thanks.
 
Thanks. I got the run-time error "424" Object Required at 4th line. Any hint? Here is my code

Do Until rst1.EO
Debug.Print rst1!VendorID, rst1!VendorNam
col1 =
Do Until col1 >
Me.VendorID.Column(col1, row1) = rst1!VendorI
col1 = col1 +
Me.VendorID.Column(col1, row1) = rst1!VendorNam
Loo
rst1.MoveNex
row1 = row1 +
Loop
 
Combo boxes (and list boxes, for that matter) are read-only: you can't
update them like that.
 
Back
Top