Default control from a different forms control

W

WoodyAccess

I have a control - UnitPrice - in an OrderDetails form. After selecting the
Product from a combo box in the OrderDetails form I want the relevant unit
price for that product to appear. I have tried =[Forms]![Add or Delete
Products]![UnitPrice] in the Unit Price default box but that does not work.

How can I do this!?

Will I have to go back and change the order details table so that UnitPrice
matches the Product table Unit Price?
 
K

Klatuu

The easiest way to do this would be to change your combo box to a multi
column combo that will include the product unit price as a column. Then, in
the After Update event of the combo, populate the unit price control:

Me.[Unit Price] = Me.MyProductCombo.Column(1)
 
M

Marshall Barton

WoodyAccess said:
I have a control - UnitPrice - in an OrderDetails form. After selecting the
Product from a combo box in the OrderDetails form I want the relevant unit
price for that product to appear.


Change the combo box's RowSource query so it includes both
the product name and price fields. Adjust the combo box's
ColumnCount and ColumnWidths properties accordingly. Once
that is done, you can get the price value from the combo
box's second field by referring to combobox.Column(1)
 
W

WoodyAccess

Thanks for that worked perfectly - and managed to do it for UnitType as well
--
Thanks
WoodyAccess


Klatuu said:
The easiest way to do this would be to change your combo box to a multi
column combo that will include the product unit price as a column. Then, in
the After Update event of the combo, populate the unit price control:

Me.[Unit Price] = Me.MyProductCombo.Column(1)

WoodyAccess said:
I have a control - UnitPrice - in an OrderDetails form. After selecting the
Product from a combo box in the OrderDetails form I want the relevant unit
price for that product to appear. I have tried =[Forms]![Add or Delete
Products]![UnitPrice] in the Unit Price default box but that does not work.

How can I do this!?

Will I have to go back and change the order details table so that UnitPrice
matches the Product table Unit Price?
 

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