DLookup() - Will that work?

  • Thread starter Thread starter Jim May
  • Start date Start date
J

Jim May

In my Subform - I'd like to use a default-value in my
UnitPrice field. ProductID is in the Record source field list and a control
for ProductID is in the form.

My tblProducts has ProductID and UnitPrice.
Can I put a Dlookup() expression in the Default Value
of my UnitPrice Control property sheet? I might accept the amt or override
it..
Tks,
 
Default Value is not suitable, because it is applied before the new record
is started. At that time, there is no ProductID to lookup.

Use the AfterUpdate event of ProductID to lookup the price. For an example
of how to do that, open the Northdwind sample database that installed with
Access. Open the Order Details subform. It has a combo box for ProductID,
and the code is in its AfterUpdate event.
 
Back
Top