Sign in to follow this  
Piyono

Email Validation Expression for Access

Recommended Posts

I'm breaking my head trying to figure out how to write an expression to validate email addresses typed into an MS Access form.

Anyone?

Piyono

Share this post


Link to post
Share on other sites

char*X,*B,*L,I[99];M,W,V;D(){W==9?(w("`%.*s' is ",V,X), t(0)):W==40?(t(0),D(),t(41)):W==42 ?(t(0),D(),w("ptr to ")):0;p(W==40?(t(0),w("func returning "),t(41)):W==91?(t(0)==32?(w("array[0..%d] of ",atoi(X)-1),t(0)):w("array of "),t(93)):0);}main(){p(w("input: "),B=gets(I))if(t(0)==9)L=X,M=V,t(0),D(),w("%.*s.nn",M,L);}T(s) {if(!s||s==W){p(*B==9||*B==32)B++;X=B;V=0;if(W=isalpha(*B)?9:isdigit(*B)?32:*B++)if(W<33)p(isalnum(*B))B++,V++;} return W;}

Share this post


Link to post
Share on other sites

Sorry, Honolds wasn't obfuscated enough. Actually, the above won't work, as it does something entirely different, and is in C. Sort of. Honolds looks like it really will work. If you are using an ASP or PHP page to allow users to enter data into the form, there are less scary ways to do it. Here is a slightly more picky and much uglier parser. I haven't actually tested this, but I think it will work. It insists that only valid characters are entered into each section of the email (before and after the @, dots, etc)

^[w.-]+@[a-zA-Z0-9-]+(.[a-zA-Z0-9-]{1,})*(.[a-zA-Z]{2,3}){1,2}$

Share this post


Link to post
Share on other sites

Guys, none of the scrips you suggested work.

I wasn't kidding when I said that I have absolutely NO experience in programming. A VB script (which, I presume, is what Access uses) looks to me just like a Java script looks just like C++ looks just like cobalt. I wouldn't know the difference.

I just need a script I can pop into the Validation Rule field:

accesstable.jpg

Anyone?

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this