Multiple column combo-box

J

Jim

I have a combo box in my "Inventory Transaction" form
which displays two columns ("Item Code" and "Description")
from the "inventory item" table. I want to be able to
select an item from the combo-box and populate both
fields in the related table "Inventory Transactions".
When I set up the combo-box using the wizard, Access only
allows for storing information in one field.

Any ideas?
 
P

Phill

You can reference each column in VBA
Me.comboboxname.Column(n) where n is the column number
you want.
 
J

Jim

Well here's what I tried. I placed the following syntax
in the Control Source of the Textbox where I want to
display my Item Description (column 2 of the combo box
named "cboItemCode"):
=[cboItemCode].[Column (2)]
however it returns #NAME?
What isn't working?
 
A

Andy

Column numbering starts with 0. So the second column is index 1.

hth,
Andy

Jim said:
Well here's what I tried. I placed the following syntax
in the Control Source of the Textbox where I want to
display my Item Description (column 2 of the combo box
named "cboItemCode"):
=[cboItemCode].[Column (2)]
however it returns #NAME?
What isn't working?
-----Original Message-----
You can reference each column in VBA
Me.comboboxname.Column(n) where n is the column number
you want.


.
 

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