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

Find Empty Fields in a Table and Propagate Them?

Status
Not open for further replies.

dtrahokie

Programmer
May 10, 2004
25
US
Is there any way (using a Macro, VBA, or otherwise) to find empty fields in a table (tableX) and propagate all of those fields with a single field of another table (tableY). Basically what I am looking for is a way to do the following:

One table lists updates performed on a computer (update_table)
One table lists the update number (unumber_table)
I want to fill the empty rows for the field Update_Number in update_table with the last Update_Number in table unumber_table.

Can this be done?

THanks in advance for your help!

Matt
 
Good evening dtrahokie:

I had to make the assumption that the last Update Number was the Maximum value and that the two tables were not joined. Note, this query is unique to MS Access only. The T-SQL version for Update does not work for MS Access in this instance, thus the use of the "DMax" function.

Code:
UPDATE update_table
SET Update_Number = DMax("[Update_Number]", "uNumber_table")
WHERE (((Update_Number ) Is Null))

Good luck and I hope this works for you.

Smuckers

May your hysterical randomness be cured!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top