Copy latest price to form and update price history

S

spacerocket

Hi,

I am doing a Purchase Order database where I have a PO form (F_PO) and a
Price History form (F_PH). The PH will record the price of the item each time
a PO is created (ie. Order Date, Item Name and Unit Price). The underlying
table for PO is T_PO and for PH is T_PH.

When the item is selected in the PO form, I need the Unit Price to appear
(where T_PH.ItemID=F_PO.ItemID). The Unit Price must be the latest Unit Price
for the Item in the PH. If there is no order history for the Item, then the
PH will not have data. If that is the case, the user can enter the Unit Price
in the PO form.

Once the PO form is saved, the Unit Price for all the items will be updated
to T_PH, (Order Date and Unit Price will be copied) where
T_PH.ItemID=F_PO.ItemID.

How do I do this?

FYI, I am using a subform in the PO for the ItemID, Quantity, UnitPrice and
TotalPrice. As such, do I need to put a 'Requery' for each ItemID after
update?

Please help.. I've been looking at all the records in this newsgroup and
tutorials but am still cracking my head. Thanks a lot.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top