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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Update Values From Table to Another

Status
Not open for further replies.

Fattire

Technical User
Joined
Nov 30, 2006
Messages
127
Location
US



I have two tables each with two fields:

tbl1: Check_Number, Mailed_Date
tbl2: Check_Number, New_Mailed_Date

I want to change Mailed Date in tbl1 to the New Mailed Date value in tbl2 where the check numbers match and without recordsets, just using Access queries. I can't get the Access queries to do this.



 
UPDATE tbl1 INNER JOIN tbl2 ON tbl1.Check_Number = tbl2.Check_Number
SET tbl1.Mailed_Date = tbl2.New_Mailed_Date

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Or just use VBA with the SQL above and skip the stored query:
DoCmd.RunSQL "UPDATE tbl1 INNER JOIN tbl2 ON tbl1.Check_Number = tbl2.Check_Number
SET tbl1.Mailed_Date = tbl2.New_Mailed_Date"

Ever notice how fast Windows runs? Me neither.
 

Nice!

I was getting a "Enter Parameter Value" window - I think the reason was because tbl1 is a linked table to another database

When I imported the tbl2 into the database tbl1 resides it worked perfectly.

Thanks PHV!

I tried the SQL as well and it also worked.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top