Lookup Values

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a combo box (items) on my subform which is using values from the Item
column of the following table (Stock). However, I want it to lookup the
corresponding Unit Price values (when I select an item from the combo box)
and display it in the unit price field on my subform. How do I achieve this?
Stock
Item Quantity Unit Price
Computer 9 2000000
Handbag 50 150000
Jean 20 200000
Jumpdrive 5 500000
 
Use DLookup(). There is an example in the Northwind sample database.

Open Northwind.
Open the Order Details subform.
Look at the AfterUpdate event procedure for the ProductID combo.

If you need an explanation of how use supply the correct things for
DLookup() see:
Getting a value from a table: DLookup()
at:
http://members.iinet.net.au/~allenbrowne/casu-07.html

BTW, does a Jumpdrive allow your computer to go to warp speed? :-)
 
Back
Top