Search and replace 
Author Message
 Search and replace

Hi

I am looking for a simple search and replace on a recordset.

If fieldX = "A" Make FieldX="B"

There may be lots of ocurrances of "A" and I want all replaced with "B"

I looked at the Find method but this has no replace and only does one record
at a time.

TIA

John



Tue, 26 Oct 2004 17:56:02 GMT  
 Search and replace
Can't u just use a query? something like:

conn.execute ("Update recordset set fieldX = 'B' where fieldX = 'A'")

--
andrew


Quote:
> Hi

> I am looking for a simple search and replace on a recordset.

> If fieldX = "A" Make FieldX="B"

> There may be lots of ocurrances of "A" and I want all replaced with "B"

> I looked at the Find method but this has no replace and only does one record
> at a time.

> TIA

> John



Tue, 26 Oct 2004 22:20:10 GMT  
 Search and replace
Try this

connection.execute "UPDATE tablename SET fieldx = 'B' WHERE Fieldx = 'A'"

Tim.



Quote:
> Hi

> I am looking for a simple search and replace on a recordset.

> If fieldX = "A" Make FieldX="B"

> There may be lots of ocurrances of "A" and I want all replaced with "B"

> I looked at the Find method but this has no replace and only does one
record
> at a time.

> TIA

> John



Tue, 26 Oct 2004 22:10:42 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Search and replace, how to replace with special characters

2. slow search and replace...

3. Search and Replace

4. VB character Search and Replace

5. Search an replace in memo fields

6. search and replace problem

7. Search and Replace in strings, possible?

8. Search and Replace

9. Large Memo field search and replace error

10. Using VBA for Search and Replace

11. search and replace characters in table

12. search and replace in Access 97

 

 
Powered by phpBB® Forum Software