ComboBox question

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

Guest

There a ComboBox that contains a list of words in my data entry form.
Each of the words is put into correspondence with a certain number.
I need to save the number associated with the selected element
in the table field which is bound to the ComboBox without
saving the whole element (the whole word). How can I do this?
 
Ensure that the RowSource for your combobox contains both the Id and the
Word. Set the combobox as having 2 columns, but set the width of the Id
field to 0. Set the bound column of the combobox to the Id field.
 
It's depend on the column location that the Id is in, you'll need to set the
BoundColumn property of the combo.

For example
if the rowsource of the combo is

Select WordField , IdField From TableName

Then, In the BoundColumn property of the combo, you need to define 2,
becuase the Id located on the second column
=========================================
Select IdField, WordField From TableName

Then, In the BoundColumn property of the combo, you need to define 1,
becuase the Id located on the First column
 
Jimmy Ionic said:
There a ComboBox that contains a list of words in my data entry form.
Each of the words is put into correspondence with a certain number.
I need to save the number associated with the selected element
in the table field which is bound to the ComboBox without
saving the whole element (the whole word). How can I do this?

Is the number always the first character in the combo? If so, use the
"Left" function is a bit of code to isolate and save it.

Regards,
Keith.
www.keithwilby.com
 
Back
Top