Unitprice

  • Thread starter Thread starter Sixthtrout via AccessMonster.com
  • Start date Start date
S

Sixthtrout via AccessMonster.com

Hi all
Apologies if this is fairly basic but i'm new to this so be gentle with me.
I am creating a waste disposal database. The part i'm stuck on is similar to
the Northwind example. I have created the form for entering the order with
the order details in a subform and I am trying to get the unitprice field to
bring up the correct price from the products table and to log it in the order
details table. The product is selected from a combo box and i want the
unitprice to appear automatically. I have the table relationship set up fine
but im obviously missing something simple.
Thanks for any help
 
In Northwind, the Order Details subform, the ProductId combo has code in its
AfterUpdate event procedure.

The code uses DLookup() to get the current UnitPrice from the Products table
where the ProductID is the one in fhe form. If you get stuck with DLookup(),
see:
Getting a value from a table: DLookup()
at:
http://allenbrowne.com/casu-07.html

Another approach is to put the UnitPrice in a secondary column of the combo,
and then assign the price from there (using the Column() property of the
combo.)
 
Thanks very much for that the afterupdate proceudre worked great.
 
Back
Top