tags:

views:

31

answers:

1

Hello

I have a form in Access with a combobox on it.

The combobox gets the displayed values through an SQL select statement by means of the RowSource property which is set to something like
select description, id_of_table, col_foo from tblTable

Since I usually need the selected id_of_table, the property BoundColumn is set to 2. So, I can access this value (for example in an AfterUpdate Event) like
var_id_of_table = me.cboWhatever
which works with no problems.

Now, at times, I do not only need id_of_table but also the value of col_foo. So, the question is, how would I go about getting this desired value. I thought I could get it by something like
var_foo = me.cboWhatever("col_foo")
but it didn't work.

I'd appreciate any input on this matter.

Thanks / Rene

+2  A: 

You need:

var_foo = me.cboWhatever.column(n)

Where n is the column number starting from 0.

Remou
Thanks Remou for your help which I appreciate very much.
René Nyffenegger
You are most welcome.
Remou