Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I get the value of an unbound column in a combo box?

Tags:

ms-access

How can I get the value from an unbound column in a combo box into a VBA variable?

I've got a combo box called cmbEmps that has a Row Source that looks like this

ID   Name    Active
1    Bob     -1
2    Jim     -1
3    Jane    0

It's bound to a field on my form on column 1, and my column Widths have been set to 0";1";0" so that only the name is displayed.

What I'd really like to do, is when Jane is selected, find out out that the Active column (3) is 0.

How can I do this?

like image 971
BIBD Avatar asked Jun 07 '12 21:06

BIBD


1 Answers

Refer to the third column in your combo box. Column numbering is zero-based.

YourVariable = Me.cmbEmps.Column(2)
like image 185
HansUp Avatar answered Oct 23 '22 08:10

HansUp