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

Update string in a memo field

Status
Not open for further replies.

Mike3333

Programmer
Jan 18, 2005
32
US
How do you change any instance of a string and only that string instead of changing the whole field?

Example:
"This is my string is what to change"
"I only want to change the word string"

I want to change the word "String" in the above to lines to let's say "Data"

Any ideas?
 
Look in books on line for string functions like replace(), substring().. etc. It will also list all string functions available.

Jim
 
I know those functions, and they won't do what i'm asking. I want to create something like the find and replace function in Access. Where it will search throw a string of text for a certain field and replace ONLY the word I want to change and leave the rest of the string intact.
 
For what you are asking in your original post, you can use Replace(). However, Replace() will change all words in the string matching what you want. Not sure if that will help.
 
Replace does work for the most part, except for one thing. It takes out the breaks or carriage returns that the front end application creates. Is there a way to put in breaks?

I think i'm going to have to use an ODBC from access and do the find and replace manually, which I was trying to avoid.
 
It should only replace the text you supply and nothing else. you can always add in the carriage return and line feed with char(10) and char(13)
 
Not as elagant as i'd like but it works, thanks for your help!

[thumbsup]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top