简体   繁体   中英

Access, Use a linked table to update a local table

I have two tables and would like tbl2 to update tbl1.

tbl1 lives on a back end database on our network drive. It contains project information, regularly updated by a half dozen users.

tbl2 lives on a remote users laptop. It is a copy of tbl1 which he updates throughout the day. When he tries to access tbl1 over the VPN it is unusably slow.

The information on the remote users laptop is not terribly time sensitive. So I'm going to have him just export his table to the network drive at the end of each day.

I've trained the user to import tbl1 each morning and export tbl2 to the network drive each night.

So the coding part comes in at the end of the day. I need to pull his updates from tbl2 into tbl1.

I'm trying to accomplish this with an SQL query using this post as my guide. But I keep getting weird results.

SELECT tbl1.thing1, tbl2.thing1, tbl1.thing2, tbl2.thing2, tbl1.thing3, tbl2.thing3, tbl1.thing4, tbl2.thing4, tbl1.thing5, tbl2.thing5
FROM tbl1
FULL OUTER JOIN tbl2
ON (tbl1.thing1= tbl2.thing1) 
AND ( tbl1.thing2 = tbl2.thing2)
AND (tbl1.thing3 = tbl2.thing3) 
AND (tbl1.thing4 = tbl2.thing4)
AND (tbl1.thing5 = tbl2.thing5)
;

Is this possible? Am I going at it the wrong way?

After some further research this looks closer to right, but still not functional.

UPDATE [tbl1] INNER JOIN [tbl2]
ON (tbl1.Thing1=tble2.thing1),
(tbl1.thing2 = tbl2.thing2),
(tbl1.thing3 = tbl2.thing3),
(tbl1.thing4 = tbl2.thing4),
(tbl1.thing5 = tbl2.thing5)
SET AND ( tbl1.thing2 = tbl2.thing2)
AND (tbl1.thing3 = tbl2.thing3) 
AND (tbl1.thing4 = tbl2.thing4)
AND (tbl1.thing5 = tbl2.thing5);

Any other thoughts? Thank you!

It looks like my problem was solved indirectly in a different one of my questions . Thank you, Beth.

UPDATE tbl1 
INNER JOIN  tbl1 
ON Tbl1.ID = Tbl2.ID SET Tbl2.[thing1] = [Tbl1].[thing1], Tbl2.[ thing2] = [Tbl1].[thing2], Tbl2.[thing3] = [Tbl1].[thing3], Tbl2.[thing4] = [Tbl1].[ thing4], Tbl2.[ thing5] = [Tbl1].[thing5];

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM