Private Sub Email_BeforeUpdate(Cancel As Integer)
If Me!EmailAdr Like "*[ !$%^&*()]*" Then
MsgBox "Invalid characters in EMail address", vbOKOnly
Cancel = True
End If
If Not (Me!EmailAdr Like "*@*.*") Then
MsgBox "EMail should be in the format na...@server.domain", vbOKOnly
Cancel = True
End If
End Sub
(Like "*@*.*" And Not Like "*[ !$%^&*()]*") Or Is Null
in the Validation Rule of the Field in the DesignView of
the Table?
HTH
Van T. Dinh
MVP (Access)
>.
>
When I applied it to my existing DB, I got one error message indicating that
there was a problem with an existing e-mail address. Since I got just one
message, I presume there was only one bad e-mail in the file (only 1700
records). Is that correct?
Is there a way to find out which record had the error? What happened to the
e-mail address for that record?
"Van T. Dinh" <VanThi...@discussions.microsoft.com> wrote in message
news:0efc01c4ab4a$91a92ed0$a601...@phx.gbl...
I guess you can use a select Query with the negation of the validation rule
as the selection criteria to select Records that have bad e-mail addresses.
The criteria should be:
(Not Like "*@*.*") Or (Like "*[ !$%^&*()]*")
--
HTH
Van T. Dinh
MVP (Access)
"Bob Richardson" <bobr at whidbey dot com> wrote in message
news:066dne6iNNe...@whidbeytel.com...
Field: ( Pats, Mickey)
What about "Smith, Bobby Jo"
Or "Thorne Smith, Courtney"
Or "Johnson, J.R."
Lots of variables with names.
About the best you could do is verify that there is a comma and verify that
the length is at least X characters. I knew a guy who's last name was "O".
The airline computers required a length of two characters or more, so all
his tickets said "OO" :-)
Rick B
"Mickey Pats" <Mickey Pa...@discussions.microsoft.com> wrote in message
news:AEA29935-7EA5-4CAC...@microsoft.com...
If it were me, I'd have two separate fields. One for first, and one for
last. You will stull not be able to get rid of special characters.
O'Conner
Rick B
"Mickey Pats" <Mickey Pa...@discussions.microsoft.com> wrote in message
news:AEA29935-7EA5-4CAC...@microsoft.com...
=InStr([contact response 1].[Value],",")>0 And InStr([contact response
1].[Value],",")<Len([contact response 1].[Value])
Contact response is my field for Last name and first name.