On 9 Feb 2004 08:58:45 -0800, MatGyver wrote:
I am going nuts trying to figure this out, any help will be
appreciated.
I have an existing table called "Parts". And in this table I have the
following columns:
"ID" "Part Number" "Part Description" "Part Cost"
I am trying to build an order form that will have "Part Number" and
"Part Cost" both on the form and in that forms specific table.
This is what I want to accomplish: When I am filling out the order
form, I want a drop down box with the list of the Part Numbers from
the Parts table. When I select the part number, I want the Part Cost
field to auto fill with the corresponding part cost. In addition to
this, once I get past that hurtle, I'd like to be able to choose
multiple parts.
I've seen this on an existing access db, but can not figure out how
it's being done.
Thanks in advance!
I think what you are trying to do here is usually setup as a detail section
of an Order Header -> Order Detail scenario. Usually the order header is on
a main form, and the deatils are in a subform (datasheet or otherwise).
Using a datasheet or continuous form on the details table allows you to
select multiple items for the order, adding a new row for each new item.
To make your combobox, add one to the form, set it's RowSource to following
SQL...
SELECT tp.ID, tp.[Part Number], tp.[Part Description], tp.[Part Cost] FROM
Parts tp;
Set whatever other properties you need like the BoundColumn, Columns,
Column Widths etc. In the AfterUpdate event add...
(Assuming combo is called Part Number and there is a textbox called Part
Cost)
Me![Part Cost] = Me![Part Number].Column(1) 'Gets value in sec. column
--
Mike Storr
veraccess.com