referring to combo boxes

Cereldine

Registered User.
Local time
Today, 02:12
Joined
Aug 4, 2005
Messages
71
hi
if you have a combo box that has two coloums, and you display the second (applicant name) but are bound by the first (applicant id).

how can you refer to the value the secondary coloum contains in your code?

I imagine normally you can use combobox.text but in the function im using this does not return anything. Any other ways?
 
Compliments of Access Help:

Column Property
See AlsoApplies ToExampleSpecificsYou 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. Read-only Variant.

expression.Column(Index, Row)
expression Required. An expression that returns one of the objects in the Applies To list.

Index Required Long. A long integer that can range from 0 to the setting of the ColumnCount property minus one.

Row Optional Variant. An integer that can range from 0 to the setting of the ListCount property minus 1.

This property setting is only available by using a macro or Visual Basic. This property setting isn't available in Design view and is read-only in other views.

Remarks
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)

You can use the Column property to assign the contents of a combo box or list box to another control, such as a text box. For example, to set the ControlSource property of a text box to the value in the second column of a list box, you could use the following expression:

=Forms!Customers!CompanyName.Column(1)
 

Users who are viewing this thread

Back
Top Bottom