Global replace function for table??

NJudson

Who farted?
Local time
Yesterday, 22:40
Joined
Feb 14, 2002
Messages
297
I'm working in Access 2k and I have the task of of renaming all the data in a table with an a.k.a. names but I'd like to do this globally some how rather than line by line through the use of code. For example my Table1 looks like this:

1 2 3 4
4 2 3 1
2 4 1 3

I have a Table2 that has the a.k.a. names that I would like to replace it with their a.k.a. names like this
1 IN040011
2 IN010003
3 MI090017
4 IN060005

which would then make the Table1 look like this
IN040011 IN010003 MI090017 IN060005
IN060005 IN010003 MI090017 IN040011
IN010003 IN060005 IN040011 MI090017

I know how to code this to loop through the tables, but shouldn't there be an easier way to do this. I thought about an update query but Table1 has 19 fields and I'm not sure how to write an update query for more than 1 field. My Table1 is 19 fields by 570 records. Any ideas are greatly appreciated. Thanks.
 
I think I have it working ok now. What a mess though. I got the update query working for 1 field and then opened the SQL viewer and copied and pasted that into the code and copied it 19 times....each one for all 19 fields. Seems to work well now. I just could not get anything like this working before and thought there would be an easier approach. Alas...persistence pays off. :)
 
I glad that you found a solution.
 

Users who are viewing this thread

Back
Top Bottom