By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,380 Members | 3,074 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,380 IT Pros & Developers. It's quick & easy.

validation of email address field which it's data type is not Hyperlink.

P: 1
How to validate an email address field about including the @ sign
which is not a Hyperlink field.
Jul 25 '07 #1
Share this Question
Share on Google+
2 Replies

Expert Mod 10K+
P: 12,366
You'll want to take a look at the InStr() function.
Jul 25 '07 #2

Expert 2.5K+
P: 3,532
This will check for the ampersand, but to really check the validity of an email address you also need to check for the appropriate (to your work environment) extensions, such as .com, .org, .edu and so forth. These can be checked using the same technique as demonstrated here:

Expand|Select|Wrap|Line Numbers
  1. Private Sub YourEmailAddress_BeforeUpdate(Cancel As Integer)
  2.  If InStr(YourEmailAddress, "@") < 1 Then
  3.   Msgbox "Invalid Email Address!" 
  4.   Cancel = True 
  5. End If
  6. End Sub
Welcome to TheScripts!

Linq ;0)>
Jul 25 '07 #3

Post your reply

Sign in to post your reply or Sign up for a free account.