Column Property

  • Thread starter Coulmn Property
  • Start date
C

Coulmn Property

I am trying to create a form that has a subform. The main
form is the information for a Project. The subform is the
detail cost items related to the project in a many to one
relationship.
So far the form seems to work correctly.
I have created a combo box that is based on a table. It
will be on the subform. The table has a list of items and
prices, each related to the project. My intention is to
use the combo box to select an item from a table and drop
it into the detail table of the subform. For this purpose
I am trying to use the column property.
In the MS Access help there is a description of the use of
the Column Property. I think I understand the process, at
least some. However I can't seem to see where I can enter
the
expression.column(Index,Row).
When I look at the properties of the Combo box I see:

Column Count
Column Heads
Column Widths

are any of these the place to type the expression.column
(Index,Row)
Any suggestions would be appreciated.

Thanks,
Jack
 
C

Cheryl Fischer

Access Help (and VBA Help) could be much better organized! For a better
description of how to use the Column property in a combo box, search the
Index in VBA Help on "column". Probably, you'll see a list containing
"column" and "Column" - select the capitalized item.

Generally speaking, to use a multi-column combo box to supply values to
other controls, you should use the AfterUpdate event of the ComboBox. For
example:

- The combo box on your form is named cboItems
- First column is bound to ItemName
- Additional (second) column is ItemPrice and is unbound

In the AfterUpdate event of the combobox, insert the following code to
update a textbox control named "ItemPrice":

me!ItemPrice = me!cboItems.Column(1)

Note that in VBA the column numbering starts with 0, while on the property
page for the combo box, it starts with 1.

hth,
 

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