select combobox value form 2nd column

  • Thread starter Thread starter mcnewsxp
  • Start date Start date
M

mcnewsxp

i need to show the value from the 2nd column if my combobox.
i'll be matching a string value to the 2nd column.
how to?
tia,
mcnewsxp
 
mcnewsxp said:
i need to show the value from the 2nd column if my combobox.
i'll be matching a string value to the 2nd column.
how to?
tia,
mcnewsxp

For code running in the form's module:

strVar = Me.ComboName.Column(1)

For code running in a separate module:

strVar = Forms!FormName!ComboName.Column(1)

Listbox and combobox columns are zero-based arrays, so 1 = 2nd column.
 
mcnewsxp said:
i need to show the value from the 2nd column if my combobox.
i'll be matching a string value to the 2nd column.
how to?


More details please.

Check the BoundColumn and ColumnWidths properties in VBA
Help. OTOH, maybe you want to use the Column property?
 
For code running in the form's module:

strVar = Me.ComboName.Column(1)

For code running in a separate module:

strVar = Forms!FormName!ComboName.Column(1)

Listbox and combobox columns are zero-based arrays, so 1 = 2nd column.

i need the opposite
forms!FormName!ComboBoxName.<selection> = me.ControlName.Value
where ControlName Value would be equal to on of the values in the 2nd
column of the conmbobox.
 
Back
Top