Full Version: Extracting Text from a Memo Field
UtterAccess Discussion Forums > Microsoft® Access > Access Queries
Mark_Crouch_atos
I am sure this has been requested before but I cannot find anything on the forum. I have a Memo field with varying lengths of text in it. In the middle of the text is a server name I need to extract. The text before the server name is always the same length and the server name is preceded with "Class: " then at the end of the server name is " ," (that's a space and a comma). The left/mid/right function does not work as the server name and the text after the server name is various lengths. Can anyone offer some advice
xteam
Try this:

Trim(Left(Mid(strText,instr(strText,"Class:")+6),Instr(Mid(strText,instr(strText,"Class:")+6),",")-1))

where strText is your variable string.
Mark_Crouch_atos
Works a treak, Thanks
xteam
You're welcome!
mvg
I'm quite new with this so please forgive me if I say something stupid...
Regarding this memo field subject, could you help me on the following?
Have a memo field with several words. I currently have =[specify name] in the criteria so I can choose a different word every time. Well it doens't work. As you probably all know, that only works if all of the field value is inserted in...
Any tips?
Cheers
Thanks
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.