Update target table column value when source table column value is different

I have an access table tbl_Items_UPC (Target Table) with a QTYONHND column that I want to only update from dbo_SSG_UPC_SCAN (Source Table) when the source value changes. I work mostly with SQL and it has a MERGE function that does that very well. I suspect that I would have to use an update query in access to accomplish this, I have tried a couple of queries but it didn't seem to work. I am using Access 2016
skull52IT director Asked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Paul Cook-GilesAccess/VBA/SQL Database DeveloperCommented:
Sounds like you need a select query that joins tbl_Items_UPC to dbo_SSG_UPC_SCAN on the key field(s) and has a criteria in the dbo_SSG_UPC_SCAN.QTYONHND column  <> tbl_Items_UPC.QTYONHND .  That should return the rows in dbo_SSG_UPC_SCAN that have QTYONHND  values different from those in tbl_Items_UPC.  Then make it an update query and set the tbl_Items_UPC.QTYONHND update cell to dbo_SSG_UPC_SCAN.QTYONHND.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Hamed NasrRetired IT ProfessionalCommented:
Agree with Paul's comment.
Here is an application to table a(aid, f) as source, and table b(aid, f1) as target.
Need to update f1 in target when f1 is different.
UPDATE b AS target INNER JOIN a AS source ON target.aid = source.aid SET target.f1 = source.f1
WHERE (((target.f1)<>[source].[f1]));

Open in new window

1
skull52IT director Author Commented:
Thanks Paul, I should have figured that out, that is how I would have done in in SQL if I didn't use  SQL's MERGE Function
1
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Access

From novice to tech pro — start learning today.