Access Email Input mask.

Discussion in 'Microsoft Access' started by Emeka Nwosu, Aug 27, 2004.

  1. Emeka Nwosu

    Emeka Nwosu Guest

    Emeka Nwosu, Aug 27, 2004
    #1
    1. Advertisements

  2. Emeka Nwosu

    John Vinson Guest

    On Fri, 27 Aug 2004 20:16:46 +0100, "Emeka Nwosu"
    <> 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)
     
    John Vinson, Aug 27, 2004
    #2
    1. Advertisements

  3. Emeka Nwosu

    Emeka Nwosu Guest

    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:...
    > On Fri, 27 Aug 2004 20:16:46 +0100, "Emeka Nwosu"
    > <> 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)
     
    Emeka Nwosu, Sep 3, 2004
    #3
  4. Emeka Nwosu

    John Vinson Guest

    On Fri, 3 Sep 2004 21:32:44 +0100, "Emeka Nwosu"
    <> 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 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)
     
    John Vinson, Sep 6, 2004
    #4
    1. Advertisements

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Deb Schipper

    Access - Input Mask Wizard

    Deb Schipper, Sep 21, 2003, in forum: Microsoft Access
    Replies:
    1
    Views:
    617
    Arvin Meyer
    Sep 21, 2003
  2. Ronald

    Input mask email address

    Ronald, Jan 6, 2004, in forum: Microsoft Access
    Replies:
    1
    Views:
    753
    Rick Brandt
    Jan 7, 2004
  3. Guest
    Replies:
    4
    Views:
    976
    Tony Toews [MVP]
    Jan 8, 2008
  4. Gina

    Input Mask for email Address

    Gina, Sep 11, 2007, in forum: Microsoft Access
    Replies:
    1
    Views:
    1,905
    Guest
    Sep 11, 2007
  5. johnsweet

    Delete a custom mask from the Input Mask Wizard

    johnsweet, Feb 14, 2010, in forum: Microsoft Access
    Replies:
    1
    Views:
    1,129
    Tom Wickerath
    Feb 14, 2010
Loading...

Share This Page