problem with mulit-column value list combo box

D

David G.

I am trying to read the values of 2 columns of the selected item in a
multi-column combo box.

cboField1 is the multi-column combo box

cboField1.rowsource=r1c1;r1c2;r2c1;r2c2;r3c1;r3c2.....
cboField1 Row Source Type=Value List
cboField1 Column Count=2

Me("cboField1").ItemData(2)
gives me the value for column #1 in row #2

Me("cboField1").Column(1)
gives me the value for column #2 in row #1

I can't find the syntax for getting the value for column #2 in row #2.

Thanks for any help!
THANKS!
David G.
 
T

Tom van Stiphout

On Tue, 24 Nov 2009 21:38:31 -0500, David G. <[email protected]>
wrote:

Split(Me.cboField1.rowsource,";")(3)

Typically Access applications are only interested in the column values
of the selected row, which you can get via .Column(x).

-Tom.
Microsoft Access MVP
 
J

John Spencer

From Access 97 Help File

You can use the Column property to refer to a specific column, or column and
row combination, in a multiple-column combo box or list box. Use 0 to refer to
the first column, 1 to refer to the second column, and so on. Use 0 to refer
to the first row, 1 to refer to the second row, and so on. For example, in a
list box containing a column of customer IDs and a column of customer names,
you could refer to the customer name in the second column and fifth row as:

Forms!Contacts!Customers.Column(1, 4)


John Spencer
Access MVP 2002-2005, 2007-2009
The Hilltop Institute
University of Maryland Baltimore County
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top