Let’s make similar changes to the Order Details controller. We’ll make the ProductID lookup open in search mode upon creating a new order detail. When selecting a product, the Unit Price will also copy over into the order detail.
On the Controllers tab of the Project Explorer, double-click on OrderDetails / Fields / ProductID (Int32) –> Products field node.
![ProductID field in OrderDetails controller in the Project Explorer. ProductID field in OrderDetails controller in the Project Explorer.](/blog/2012/10/order-form-samplepart-16/image02.png)
Change the following settings:
Property | New Value |
Data Value Field | ProductID |
Data Text Field | ProductName |
Copy | UnitPrice=UnitPrice |
Search on Start | True |
Activate if Blank | True |
Lookup window description | Select a product. |
Press OK to save the field, and press Browse in the top left corner.
Navigate to the Order Form page, and select any order. Create a new order detail record. A lookup will open prompting you to select a product.
![When creating a new order detail, the product lookup opens in search mode. When creating a new order detail, the product lookup opens in search mode.](/blog/2012/10/order-form-samplepart-16/image04.png)
Select a product, and you will see that Unit Price of the product has been copied into the order detail.
![When a product is selected, the Unit Price of the product is also copied over. When a product is selected, the Unit Price of the product is also copied over.](/blog/2012/10/order-form-samplepart-16/image06.png)