Need Urgent Help With Validation - Any Help Appreciated

  • Thread starter Thread starter chris132
  • Start date Start date
C

chris132

Guest
Help With Validation - Any Help Appreciated

How do i create in the validation rule of the table, a way of checking that an email address has an @ sign in the middle of it. and the general format etc?

thanks alot in advance
chris
 
Last edited:
Validation

The following is not perfect, but it's a start, it goes in the Before Update Event of the field.

Private Sub Email_BeforeUpdate(Cancel As Integer)
If InStr(1, Email, "@") = 0 Then
MsgBox " Email Address Invalid! '@' is missing. ", vbOKOnly, """"
Cancel = True
Else

If Right(Email, 3) = "com" Or Right(Email, 3) = "net" _
Or Right(Email, 3) = "gov" Or Right(Email, 3) = "org" Then
Exit Sub
Else
MsgBox "Email Address must end with '.com', '.net' or equivalent! ", vbOKOnly, ""
Cancel = True
End If
End If
Exit Sub
 
Urgent? I don't understand. :confused:

What is urgent? If you want urgency or someone working to deadlines then perhaps hiring somebody would be a better option. :mad:
 
well i would pay someone to make the system for me, but since its for my A level, it is somewhat frowned upon if you get it made for you!

(Thank you everyone for your help)
 

Users who are viewing this thread

Back
Top Bottom