Combo boxes

  • Thread starter Thread starter TK
  • Start date Start date
T

TK

I have a combo box on one form with has a row source of
2 fields, an item number and item name.

I item number width is 0 so it only displays the name, I
have another text box that displays the number from the
combo box.

On the other form I want to get the item name from the
combo box but I keep getting the number. How would I do
this? I Even tried SQL statements to select the item
from the item table where the item number from the
original form matched the item number in the table but
couldn't get that to work either.

SQL used: txtName = "SELECT tblItems.ItemName FROM
tblItems WHERE tblItems.ItemNumber = txtItemNumber"
 
To refer to a combobox column you can use Column(i)
property. First column is always index 0, second 1, etc.
For example if combobox name is ItemNumber and it has two
fields second being item name then you can refer to the
item name value as ItemNumber.Column(1). It doesn't matter
whcih column is visible. The order will match the order of
fields in the combobox query/sql statement.

Milan
 
That worked perfect. Thank you

-----Original Message-----
To refer to a combobox column you can use Column(i)
property. First column is always index 0, second 1, etc.
For example if combobox name is ItemNumber and it has two
fields second being item name then you can refer to the
item name value as ItemNumber.Column(1). It doesn't matter
whcih column is visible. The order will match the order of
fields in the combobox query/sql statement.

Milan

.
 
Back
Top