Linking a Text Box

Stemdriller

Registered User.
Local time
Today, 10:09
Joined
May 29, 2008
Messages
187
Hi All

On a form I have a Combo Box which lists SupplierName and SupplierID

The user selects SupplierName.

On an unbound TextBox I want to record the SupplierID, using
=SupplierName.Column(2).

However when I enter this, Access immedatley puts [] around SupplierName and Column, and thus does not work.

I've done this in another DB and it works perfectly.

Any ideas??

Regards

Gareth
 
Try after modifying the expression as below:

Code:
=Me.SupplierName.Column(2)
 
On a form I have a Combo Box which lists SupplierName and SupplierID...Iwant to record the SupplierID, using =SupplierName.Column(2).
If the combobox only has 2 columns, there is no Column(2) which is the reason it isn't working! The column index is Zero-based, so reading from left-to-right, the first column is Column(0) and the second column is Column(1).

If you're doing this in the Control Source of the unbound textbox, the square brackets belong around the combobox name, which is why Access puts them there.

You cannot use Me.SupplierName in a Control Source. The Me. construct can only be used in VBA code in the form's code module.

Linq ;0)>
 
Last edited:

Users who are viewing this thread

Back
Top Bottom