Update column in table based on another table

robsworld78

Registered User.
Local time
Yesterday, 21:00
Joined
May 31, 2011
Messages
99
Hi, I'm trying to use VBA to update a new column in a table with info I already have in another table.

The table I want to update is an inventory details table, it has around 25,000 records. I added a column called "UnitCost", of course the column is empty for all 25,000 records so I would like to fill it easily using DoCmd.RunSQL "UPDATE" feature.

I use that through-out the program however I'm unable to connect the dots for this one.

What it needs to do is update "UnitCost" in "InventoryDetails" from "Products" where "InventoryDetails.ProductNumber" = "Products.ProductNumber"

The "Products" table has all the different unit cost, it just need to be placed in the "InventoryDetails" table for every record. Of course product1 needs products1 unit cost and product2 needs products2 unit cost, etc...

Any ideas?
 

Users who are viewing this thread

Back
Top Bottom