updating tables with relationships

rikklaney1

Registered User.
Local time
Today, 11:14
Joined
Nov 20, 2014
Messages
157
Okay guys, I'm having a brainfreeze. I have 2 tables. Parts and supermarkets. Supermarkets has 42 records. One field is superdesc and another is smname. Parts has thousands of records and they all have a superdesc that matches the Supermarkets table but no value in the smname field. How can I make the smname field in parts match the smname field in supermarkets? Thanks.
 
You shouldn't need to. Join the two tables on the SuperDesc and pull in the smname. You shouldn't store the same data twice.
 
An update query like

Code:
UPDATE supermarkets, Parts SET Parts.smname = [supermarkets]![smname]
WHERE (((Parts.superdesc)=[supermarkets]![superdesc]));

I assume you want to make smname the foreign key in parts and will be deleting the superdesc column.
 

Users who are viewing this thread

Back
Top Bottom