Look up value and insert info in 3 other fields on form?????

  • Thread starter Thread starter jwr
  • Start date Start date
J

jwr

I have an order details form that contains:
CLing
ProductID (look up description of product and populate the following fields)
Product Code (this is pulling info forward)
Product Unit Price (not pulling unit price forward)

Following are the properties of the ProductID field:
SELECT DISTINCTROW Products.* FROM Products ORDER BY Products.ProductName;

Control source for the Product ID is ProductID from the Products table.

Please advise. I seem to be going in circles.
JR
 
Hi, jwr.

I don't know what Product Code is used for, but if it is a static code
pertaining to this particular product, you probably don't need to store it in
the Order Details table, as you can display it on the form, or retrieve it
from a query any time you want. Your call.

As to the Unit Price, however, you need the price as of today. Since the
Price is a column in your ProductID combo box, use the ProductID AfterUpdate
event to copy the value to your textbox. Be sure the textbox' ControlSource
is set to the UnitPrice field of the OrderDetails table.

Assuming that Product Unit Price is the 3rd column of the combo box, in the
AfterUpdate event procedure:

Me!MyUnitPriceTextboxName = Me!MyComboBox.Column(2)

Sprinks
 
Back
Top