Parsing and Replacing Data in a Memo Field

padlocked17

Registered User.
Local time
Today, 13:10
Joined
Aug 29, 2007
Messages
275
Good Afternoon All,

I'm working on a database in A2003 that involved me allowing users to insert "Variables" or something similiar to Smarty tags in a Memo field that will be updated in a report with information in the database.

For example, the memo field would look like below:

%%FIRSTNAME%% received the Top Lobo award for class %%CLASS%%

%%FIRSTNAME%% would then be defined and would replace that entire phrase with the First Name of the individual the report is being generated for.

Any ideas on how I could go about this? I need to both find a certain string in a memo field and then replace it with that data in a recordset for the form.

Thanks!
 
There is a function called Replace()

Example

MyText = Replace(MyText,"%%CLASS%%",strClass)

Param 1 = the contents of your memo field
Param 2 = What you are looking to replace
Param 3 = What to replace it with

In the above example it will replace all instances of %%CLASS%% with the contents of strClass string variable.
 

Users who are viewing this thread

Back
Top Bottom