Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Replace character in textbox

Status
Not open for further replies.

Jacksparrow87

Technical User
Jun 29, 2008
93
GB
Hi people,

I was hoping someone could offer me a little bit of help please. Currently I have a coding and when executed the text in the textboxes are shown in the body of an email.

Part of the coding is as follows:

Code:
   body = body & "%0A" & Label15.Text & " " & txtcuscall.Text
            body = body & "%0A"
            body = body & "%0A" & Label19.Text & " " & txtsum.text
            body = body & "%0A"
            body = body & "%0A" & Label21.Text & " " & txtsolutions.Text

Now the problem im facing is that when the '&' character is entered into the textbox the email stops and does not include any character after that chracter in the email for some reason. Would it be possible to replace this character?

I have tried replacing that line of coding above with:

Code:
    body = body & "%0A" & Label19.Text & " " & Replace(txtsum.Text, "&", "&&")

However it does not work, any help please?

Thanks
 
How exactly does it not work?

But you can do this instead.
Code:
body = body & "%0A" & Label19.Text & " " & txtsum.Text.Replace("&", "&&")

-I hate Microsoft!
-Forever and always forward.
-My kingdom for a edit button!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top