Find and replace using VBA?

rnickels

Registered User.
Local time
Today, 08:46
Joined
Dec 8, 2006
Messages
48
Hello,
Is it possible to do a find and replace using VBA or SQL.
I would like to be able to replace fields (the attendee's name) in my attendance_table.

Each attendee's name appears multiple times in the attendance_table, so I am thinking that a loop would be the answer but I do not how to do a loop.

For example:

If a person changes their name (by marriage for example), I would like to be able to find all instances where the previous name appears in the attendance table and replace it with their new married name.

I hope this is possible.

Thank you for your time.
 
One way would be an update query:

UPDATE TableName
SET FieldName = "Jones"
WHERE FieldName = "Smith"
 
Yup.

But what if you have two people with the same name? How are you going to differentiate between them?
 
You can't. I don't like the design; I'd have an attendees table, and only be storing an ID in the attendance table. That said, the SQL given is what the OP asked for.
 
Yeah I just asked the question to get the OP to recognize an issue with the design :)
 

Users who are viewing this thread

Back
Top Bottom