Digging out an email address

  • Thread starter Thread starter Bunky
  • Start date Start date
B

Bunky

I have a rather thorny problem that I am sure can be solve using VB code but
I am not that good with VB code yet.

I have a 60 character text string that contains an email address. What I
think I need to do is find the end of the line and work back left until I hit
the 1st space after it finds the @ sign. In scanning the input data, the
email address is always the last thing entered on the line.

Please help!
 
Look into the InStrRev function.

Assuming the text string that contains the e-mail address is named strText,
try something like:

Mid(strText, InStrRev(strText, " ", InStrRev(strText, "@")) + 1)
 
Thank you Doug, It worked like a champ!

Douglas J. Steele said:
Look into the InStrRev function.

Assuming the text string that contains the e-mail address is named strText,
try something like:

Mid(strText, InStrRev(strText, " ", InStrRev(strText, "@")) + 1)


--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)





.
 
Back
Top