Question : Save unbound combobox column value in Access 2007

I have a combobox that has two columns. Column 0 contains the index number and is bound, column 1 contains the description and is displayed. I need to be able to reference both values, but I cannot seem to reference the unbound column.

I would expect something like this to work:
[Forms]![MyForm]![MyCombobox]![Column](1)
But Access does not recognize the Column property. Anyone have a thougt?

Answer : Save unbound combobox column value in Access 2007

The Column() property is mistaken for a function by the Jet expression evaluator. You cannot use it in a query. Instead, you can use =MyCombobox.Column(1) in a text box, and refer to that text box in your query. Better yet, refer to the column directly, meaning outside of the quotes, while building your query. For example:

DoCmd.RunSql "INSERT INTO Table1(Field1) VALUES('" & MyCombobox.Column(1) & "')"

(°v°)
Random Solutions  
 
programming4us programming4us