John,
Here is a function I use. I don't suppose it is perfect, but I think it
will catch most invalid syntax entries ...
**********
Public Function EmailCheck(EmAdd As String) As Boolean
Dim Tester As Boolean
If Len(EmAdd) = 0 Then
Tester = False
Else
Tester = True
Tester = Tester And InStr(EmAdd, "@") > 0
Tester = Tester And InStr(EmAdd, ",") = 0
Tester = Tester And InStr(EmAdd, ";") = 0
Tester = Tester And InStr(EmAdd, " ") = 0
Tester = Tester And InStr(Mid(EmAdd, InStr(EmAdd, "@") + 1),
"@") = 0
Tester = Tester And InStr(Mid(EmAdd, InStr(EmAdd, "@") + 1),
".") > 0
Tester = Tester And Right(EmAdd, 1) <> "."
End If
EmailCheck = Tester
End Function
***********
Put this code in a standard module, and then on your form, on the After
Update event of your email address control, put something like this...
If Not IsNull(Me.YourEmailAddress) Then
If EmailCheck(Me.YourEmailAddress) = False Then
MsgBox "Email address not valid"
End If
End If