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

Populate fields based on value in another table - how to?

Status
Not open for further replies.

tiffjones001

Technical User
May 11, 2010
5
0
0
US
Hi,
Here is the situation:
I have 2 tables, one has part number descriptions and the other does not. Both tables have identical part numbers, so this is the link between the two.
How do I populate the one table's missing part number descriptions with the other table's part number descriptions based on the matching part number ?

This seems so simple.. but I cannot find any solution out there.

Can anyone advise ?

Thanks!
T.Jones
 
UPDATE TablewithoutDiscriptions as without
INNER JOIN TablewithDiscriptions as with
ON without.[part numbers] = [with].[partnumbers]
SET without.[Discriptions ] = [with.Discriptions];
 
Ok I tried it, but just short of actually running the update query because the # of records it would update is far greater than the # of records on "without" table.

Here's what I have:

With Table = 61 rows (the query was going to update 531 rows)

UPDATE [Without table]
INNER JOIN [With table]
ON [Without table].[Part Number] = [With table].[Part Num]
SET [Without table].[Short Description] = [With table].[Category Descr];

Any clues?
 
You don't want to update the "With Table", only the Without table. Can we assume there are 531 records in the Without Table that have matching records in the With Table?

Duane
Hook'D on Access
MS Access MVP
 
So I bravely ran the query.. it worked beautifully! I think it is true that there were 531 records in the with table where those 61 without records showed up. Now why it said that 531 would be updated.. is still a mystery to me.

But the bottom line is.. it worked.

Thank you PWise and dhookom

T.Jones
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top