On Mon, 09 Feb 2004 14:24:55 -0800, bender <larry@netgeexdotcom>
wrote:
Public Function EmailOK(ByVal Email As String) As Boolean
If Email Like "*@*" And (Email Like "*.com" Or Email Like "*.net")
Then EmailOK = True
End Function
Public Function EmailPart(ByVal Email As String, Part As Boolean) As
String
Dim Pos As Integer ' @ position
If Not EmailOK(Email) Then Exit Function ' if not valid address, exit
Pos = InStr(1, Email, "@") ' get @ position
If Part = True Then ' if user name part
EmailPart = Left$(Email, Pos - 1) ' return user name
Else ' if domain part
EmailPart = Right$(Email, Len(Email) - Pos) ' return domain
End If ' if user name part
End Function
Hi. Sorry if this is an old question, but....
i have a table that includes an e-mail address
in a query, i would like to create two columns with expressions for
the hostname and the username.
what function(s) would i use to split the e-mail address to what comes
before the @ and what comes after?
thanks,
Larry
- - - - - - - - - - - - - - - - - -
"Forget it, Jake. It's Chinatown."