VBA for MS Access 2010 | Checking for valid email only when an email is entered

Avionicx

Banned
Local time
Today, 06:30
Joined
Oct 2, 2011
Messages
2
Hello everyone!

Here is the problem, I have an Access form and a textbox for an e-mail address. The email address is not required, I only want to check for a valid email address when a value or address has been entered into the e-mail filed. Example: If e-mail is not empty or if email field has a value, then check for the follow elements, matched the email address with the required format. If the e-mail field is empty, do not look for anything, move on.

Any ideas?

Avionicx
 
He was actually trying to help you, and wanted you to elaborate on what the exact definition of a valid email is

Are you only looking for an @ sign, or does it have to be a .com etc or should access check online servers for email validity?

Your attitude is not one to use if you actually are looking for online help for free
 
Avionicx.

>>If you don't know what a valid e-mail is, then you are a complete idiot.<<

By the same token; if you do know what a valid e-mail is you wouldn’t be asking the question, unless…

Please try to make your third post compensate for your second... 24 hours.

Chris.
 
Avionicx.

24 hours + 1 minute, times up.

Banned for failure to comply with a request to withdraw insulting comments.

Chris.
 
Wow, some people are so touchy. We have an algorithm that validates based on requiring an @ symbol not in the first character and appearing only once. Followed by at least one letter, followed by a . and at least one letter.

The minimum length is 5 characters.

Sounds like the guy needs to learn about the NZ function before validation. Could it have been so simple?
 
A simple VBScript regex would have done it but he needed to explain what he meant by an invalid and valid e-mail address. Oh, well his loss.

He's no longer allowed on here thanks to Chris :D
 
He's no longer allowed on here thanks to Chris :D

If Chris didn't ban him, I would have.
chickenbeatnik.jpg
 
I'm not familiar with that library. Will all recent versions of Windows have that?
 
I'm not familiar with that library. Will all recent versions of Windows have that?

It's been around since Windows XP and I think maybe before.

Take a look at this thread. There's a link in there somewhere that provides all the background to the syntax.

Chris
 
Thanks for the link, but that doesn't seem to perform email validation. Did I miss something?
 
Sorry that was for Collections and Dictionary. I meant the Microsoft VBScript Regular Expressions x.x Library. The latest versions and I think it should be available in 2000 or at least 2003.
 
Thanks for the link, but that doesn't seem to perform email validation. Did I miss something?
Just like in SQL or VBA you have LIKE which performs pattern matching using a very limited number of operations, in VBScript you create a pattern matching sequence to validate an e-mail address.

I'm sure Chris (aka Stopher) has a link somewhere with an example of how to use VBScript to match UK postcodes for example.
 

Users who are viewing this thread

Back
Top Bottom