Find and Replace Question

Tsango

Registered User.
Local time
Today, 07:26
Joined
Mar 31, 2006
Messages
64
Anyone know how to search for a line of text and replace it with 2 lines?

i.e.

Search for:

Set cnn = CurrentProject.Connection

and replace it with:

Set cnn = CurrentProject.Connection
cnn.CursorLocation = adUseServer
 
If you don't find a way to do this directly, I got around the problem a little while back by replacing the first line with the second two separated by a space, using Replace, e.g.

Set cnn = CurrentProject.Connection

became

Set cnn = CurrentProject.Connection cnn.CursorLocation = adUseServer

I then went through the code again, using 'Find', and manually dropped the second part down to the next line.

Not as fast as running through the code once, I know, but still works.
 
Matt Greatorex said:
If you don't find a way to do this directly, I got around the problem a little while back by replacing the first line with the second two separated by a space, using Replace, e.g.

Set cnn = CurrentProject.Connection

became

Set cnn = CurrentProject.Connection cnn.CursorLocation = adUseServer

I then went through the code again, using 'Find', and manually dropped the second part down to the next line.

Not as fast as running through the code once, I know, but still works.

Yes, I did it this way before and it seems to be the only option :(
 

Users who are viewing this thread

Back
Top Bottom