How do I replace just a part of text in a memo field by value in a

  • Thread starter Earl.AKA J.Alladien in access forum!!
  • Start date
E

Earl.AKA J.Alladien in access forum!!

Hi all,

How do I do a replace/Update qry where just a certain part of text in a memo
field gets replaced by a value in another field from the same table fe:

Name e-mail
message(memo field)

marco wongso (e-mail address removed) "DEAR #NAME#,

U ARE THE BEST!
*becomes*
marco wongso (e-mail address removed) "DEAR marco wongso,

U ARE THE BEST!


Mikal Jordan (e-mail address removed) "DEAR #NAME#,

U ARE THE BEST!
*becomes*
Mikal Jordan (e-mail address removed) "DEAR Mikal Jordan,

U ARE THE BEST!


Is this possible?Please advise and thanks in advance!
 
J

John Spencer

If you are using a Version of Access that supports it you can use the
VBA replace function. Look it up in VBA help

Field: InsertName: Replace([Message],"#NAME#",[Name])

'====================================================
John Spencer
Access MVP 2002-2005, 2007-2009
The Hilltop Institute
University of Maryland Baltimore County
'====================================================
 
E

Earl.AKA J.Alladien in access forum!!

Works perfect John,

Thanks a lot!

John Spencer said:
If you are using a Version of Access that supports it you can use the
VBA replace function. Look it up in VBA help

Field: InsertName: Replace([Message],"#NAME#",[Name])

'====================================================
John Spencer
Access MVP 2002-2005, 2007-2009
The Hilltop Institute
University of Maryland Baltimore County
'====================================================


Earl.AKA J.Alladien in access forum!! said:
Hi all,

How do I do a replace/Update qry where just a certain part of text in a memo
field gets replaced by a value in another field from the same table fe:

Name e-mail
message(memo field)

marco wongso (e-mail address removed) "DEAR #NAME#,

U ARE THE BEST!
*becomes*
marco wongso (e-mail address removed) "DEAR marco wongso,

U ARE THE BEST!


Mikal Jordan (e-mail address removed) "DEAR #NAME#,

U ARE THE BEST!
*becomes*
Mikal Jordan (e-mail address removed) "DEAR Mikal Jordan,

U ARE THE BEST!


Is this possible?Please advise and thanks in advance!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top