PC Review


Reply
Thread Tools Rate Thread

Access Email Input mask.

 
 
Emeka Nwosu
Guest
Posts: n/a
 
      27th Aug 2004
Hey,
Please can I get the format of an input mask that would validate email
addresses in a Access table?thanks

--
Emeka Nwosu
Phone+234) 01-8143183
Message+234)802317154
My weblog = http://randomscribblesbyemeka.blogspot.com/
Where I work = http://www.sphinx-interactive.com


 
Reply With Quote
 
 
 
 
John Vinson
Guest
Posts: n/a
 
      27th Aug 2004
On Fri, 27 Aug 2004 20:16:46 +0100, "Emeka Nwosu"
<(E-Mail Removed)> wrote:

>Hey,
>Please can I get the format of an input mask that would validate email
>addresses in a Access table?thanks


No, you cannot; input masks are much too inflexible to handle the vast
variety of valid EMail addresses.

You'll need to use VBA code in the BeforeUpdate event of the form
textbox - and if you're trying to do it in a table datasheet, I cannot
think of any good way to do it (since table datasheets don't have
programmable events).

John W. Vinson[MVP]
(no longer chatting for now)
 
Reply With Quote
 
 
 
 
Emeka Nwosu
Guest
Posts: n/a
 
      3rd Sep 2004
Thanks.Any means by which I can prevent people adding invalid characters is
good with me.Could you possibly help out with a few lines of code for the
BeforeUpdate event?
"John Vinson" <jvinson@STOP_SPAM.WysardOfInfo.com> wrote in message
news:(E-Mail Removed)...
> On Fri, 27 Aug 2004 20:16:46 +0100, "Emeka Nwosu"
> <(E-Mail Removed)> wrote:
>
> >Hey,
> >Please can I get the format of an input mask that would validate email
> >addresses in a Access table?thanks

>
> No, you cannot; input masks are much too inflexible to handle the vast
> variety of valid EMail addresses.
>
> You'll need to use VBA code in the BeforeUpdate event of the form
> textbox - and if you're trying to do it in a table datasheet, I cannot
> think of any good way to do it (since table datasheets don't have
> programmable events).
>
> John W. Vinson[MVP]
> (no longer chatting for now)



 
Reply With Quote
 
John Vinson
Guest
Posts: n/a
 
      6th Sep 2004
On Fri, 3 Sep 2004 21:32:44 +0100, "Emeka Nwosu"
<(E-Mail Removed)> wrote:

>Thanks.Any means by which I can prevent people adding invalid characters is
>good with me.Could you possibly help out with a few lines of code for the
>BeforeUpdate event?


Sure. Try something like:

Private Sub txtEmail_BeforeUpdate(Cancel as Integer)
If Me!txtEmail Like "*[ !$%^&*()]*" Then
MsgBox "Invalid characters in EMail address", vbOKOnly
Cancel = True
End If
If Me!txtEmail Not Like "*@*.*" Then
MsgBox "EMail should be in the format http://www.pcreview.co.uk/forums/(E-Mail Removed)in", vbOKOnly
Cancel = True
End If
End Sub

Use a verified (rather than my guess!) list of invalid characters
inside the brackets in the first IF.

John W. Vinson[MVP]
(no longer chatting for now)
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Access report, variable input-how to take input from other query? =?Utf-8?B?TVAgQXVzdHJhbGlh?= Microsoft Access Reports 3 16th Feb 2006 01:17 AM
email form, email, get input, email back Who Cares! Microsoft Access Getting Started 2 10th Sep 2004 01:09 AM
Make input selection access a table dependent upon another input =?Utf-8?B?ZGFiMTQ3Nw==?= Microsoft Access VBA Modules 4 4th Sep 2004 12:44 AM
Keyboard input locks up input in windows Robert Windows XP Hardware 0 16th Jun 2004 03:00 PM
Hyperterm - cannot input with keyboard, can input with paste Ken Felix Windows XP General 1 1st Oct 2003 04:49 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 12:57 PM.