Replacing a portion of a text string with a field value

Falchthehunter

New member
Local time
Today, 10:03
Joined
Nov 24, 2016
Messages
3
I am attempting to use VB code to eval. the text in the Field [Notes] to find a key word "outbound" and replace it with the value in a form field.

I had thought that the replace function would be the way to get this done but my attempts thus far have failed. I have searched for examples in the forums but can not find an example that dose quite what I am trying so I'm probably going about this the wrong way so here it is.

Replace [Notes], "outbound", [Forms]![main log]![log shifts]![out team]

This method dose not work nor dose it generate any errors. :banghead:
 
Its a function so it returns a value, but the code you posted doesn't show you using that value in any way. I would expect to see code like...
Code:
    dim txt as string

    txt = "Initial Text"
    txt = Replace(txt, "Initial", "Final")[COLOR="Green"]  'here we assign the return value to a variable[/COLOR]
    msgbox txt
See how the result of the function is assigned to the variable 'txt?'
 

Users who are viewing this thread

Back
Top Bottom