Data Inserted Into Form is not inserted into the table

  • Thread starter Thread starter pys
  • Start date Start date
P

pys

I would like to ask the solution for this situation:
Table: OrderItem

I created a field ItemPrice in a form, which its value
will be looked up automatically based on ItemID, using
the function DLookup.
The problem is, although this function works properly,
i.e., once I select ItemID in the field, ItemPrice is
automatically displayed in the column in the form.

HOWEVER, the item price is not being inserted
automatically into the OrderItem table. Values in table
still $0.00.
What is the solution?
Thanks.
 
Pys,
That's becuase the Price field is not "bound" to a field in your table.
You probably have a calculation as the ControlSource for Price such as...
= DLookup('lookup the price in the price table)

I'm using example field names... use your own.

Your ControlSource for Price should be the Price field in your table.
= [Price]

Most probably you have something like a PartNumber, or ProductID, that is
a unique identifier for yor Product...
On the AfterUpdate event of unique product identifier, place this code...
[Price] = Dlookup('you're lookup syntax here using the unique
identifier)

The price, at the time the record is filled out, will be "captured" to
your Price field.
 
Back
Top