Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

updating a table with data from another table

Status
Not open for further replies.

Awuah

Programmer
May 22, 2002
7
US
I have data in a temporary table. I would like to use that data to update an existing inventory table. I have tried an update query but it does not seem to work. Please help. Both tables have the same fields. I would like to update the inventory table if the primary key = the primary key in the temporary table.
 
Never mind. The update query worked. Thank you.

UPDATE tblInventory INNER JOIN tblScanOrderDetail ON tblInventory.BarCode = tblScanOrderDetail.BarCode SET tblInventory.Barcode = tblScanOrderDetail.BarCode, tblInventory.OrderID = tblScanOrderDetail.OrderID, tblInventory.[TimeStamp] = tblScanOrderDetail.[TimeStamp], tblInventory.BookletStatus = tblScanOrderDetail.BookletStatus, tblInventory.Notes = tblScanOrderDetail.Notes
WHERE (((tblInventory.BarCode)=[tblScanOrderDetail].[Barcode]));


 
You need to place a linking criteria in the primary key of your target table - on that column of your query, it should look like this:

Field : FOO
...
Update to: (leave blank)
Criteria : Target!Foo = OtherTable!Foo
...

Get the picture?















How many of you believe in telekinesis? Raise my hand...
Another free Access forum:
More Access stuff at
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top