How to update set of records (ADP)?

  • Thread starter Thread starter lemes_m
  • Start date Start date
L

lemes_m

Hi all!

I have table "Orders" and also "OrdersDetails" which are related with
field "OrderId". After user enters all data I need to update field
"AvgPrice" in "OrdersDetails" from VBA code after I do some
calculations. I supose it can be done with FOR EACH Statement but I
can't get it work.

Anyone knows the solution?

Regards,

Mirnes Lemes
 
Use the DoCmd.RunSQL command, something like this:

DoCmd.RunSQL "UPDATE OrderDetails SET AvgPrice=" &
your_calculated_new_average & " WHERE OrderID=" & your_order_id
 

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

Back
Top