I have used this rule ((Like "*?@?*.?*") And (Not Like "*[ ,;]*"))
in MS Access for email validation it's working fine, but when I type this email@youdomain.com@@@hello
it also accepts more @ signs how to solve this? The rule is taken from here
Asked
Active
Viewed 574 times
-1

Erik A
- 31,639
- 12
- 42
- 67

Usman Developer
- 568
- 8
- 26
1 Answers
4
You can't reliably validate e-mail addresses using an Access SQL statement or regex for that matter, see this for an example of a regex that still only works on prepared mail addresses, and Access SQL is substantially more limited than regex for text pattern matching.
However, fixing this specific issue is easy:
Just add Not Like "*@*@*"
to your statement to disallow multiple @ charactes:
((Like "*?@?*.?*") And (Not Like "*[ ,;]*")) And Not Like "*@*@*"

Erik A
- 31,639
- 12
- 42
- 67