Adding additional text to field

G

Gary McCarthy

I am writing standard text to a memo field when a certain process runs.
However, there are occasions when text will already be present in the field.
I have tried several variations of concatenation and variables with no
success.

How can I have additional text added without deleting the old text?

For example, if original text is ABCD and process text is EFGH, then I would
want result in field to be ABCDEFGH.

Thanks.
 
M

Mr. B

Hi, Gary.

I will assume that the process is running behind a form and that the fields
are on the same form.

At the end of your process try something like this:

If not isnull(me.NameOfMemoControl) then
Dim strCurMemoVal as String
Dim strProcessText as String
'assign the current value of the memo control to a variable
strCurMemoVal = me.NameOfMemoControl
'assign the process text to a variable
strProcessText = (here you will have to provide the value)
'add the process text to the original value
strCurMemoVal = strCurMemoVal & strProcessText
'place the new memo value into the memo control
me.NameOfMemoControl = strCurMemoVal

You will have to provide the text from your process as I don't know how or
where it is comming from.
 
F

fredg

I am writing standard text to a memo field when a certain process runs.
However, there are occasions when text will already be present in the field.
I have tried several variations of concatenation and variables with no
success.

How can I have additional text added without deleting the old text?

For example, if original text is ABCD and process text is EFGH, then I would
want result in field to be ABCDEFGH.

Thanks.

"when a certain process runs"? What does that mean? Is that running
VBA code?
Where is that "certain process" taking place?
On the form's Class code sheet?

You do not wish a space or new line between the old and new text?

Me.[MemoField] = Me.[MemoField] & "New Text here"

If by a "certain process" you mean something else, I think you have to
explain yourself a bit better.
 

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