Link to home
Start Free TrialLog in
Avatar of Murray Brown
Murray BrownFlag for United Kingdom of Great Britain and Northern Ireland

asked on

Access update a column using DLookup or something similar

Hi

I have the two Access tables shown in the image. I want to update the LicenceNumberFK field using the correct values in the second table that I imported from Excel t_Arms2. I want to do this by looking up the LicenceNumberFK field in t_Arms2 using the ArmPK field

User generated image
Avatar of John Tsioumpris
John Tsioumpris
Flag of Greece image

Why don't you join the two tables by LicenceNumberFK  and ArmPK?
Join the tables on ArmPK and update t_arms.licenceNumberFK = t_arms2.licenceNumberFK

UPDATE t_arms INNER JOIN t_arms ON t_arms2.armpk= t_arms.armpk SET t_arms.licenceNumberFK = t_arms2.licenceNumberFK 

Open in new window


assuming the armpk will identify your records.
perhaps ryb this on your test system first to test the result
In your other thread on this topic, you said that you were simply trying to display the LicenseNumber on a second form.  You said you weren't storing the data twice.  I guess you didn't mean that.
ASKER CERTIFIED SOLUTION
Avatar of Ryan Chong
Ryan Chong
Flag of Singapore image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Murray Brown

ASKER

Thanks very much