1. Computer problem? Tech Support Guy is completely free -- paid for by advertisers and donations. Click here to join today! If you're new to Tech Support Guy, we highly recommend that you visit our Guide for New Members.

creating a Validation Rule in Access 2000

Discussion in 'Business Applications' started by summerfallows, Feb 1, 2004.

Thread Status:
Not open for further replies.
Advertisement
  1. summerfallows

    summerfallows Thread Starter

    Joined:
    Oct 18, 2001
    Messages:
    15
    I want to create a Validation Rule that prevents hyphens from being used when inputting Serial Numbers in a field.

    I created the following:

    Not "-"

    It doesn't work.

    What do I need to make this work?

    Thanks
     
  2. Ziggy1

    Ziggy1

    Joined:
    Jun 17, 2002
    Messages:
    2,551
    I assume (and you know what that means) that most serial numbers have letters and numbers only so can't you just use an input mask?
     
  3. summerfallows

    summerfallows Thread Starter

    Joined:
    Oct 18, 2001
    Messages:
    15
    I was considering an input mask, but didn't think it would work, as serial numbers can be any length of numbers and/or letters, and an input mask would restrict the length of entry. I will now restudy my manual and find you how to construct an input mask to accommodate what I need.

    Thanks
     
  4. Ziggy1

    Ziggy1

    Joined:
    Jun 17, 2002
    Messages:
    2,551
    Use this mask


    For required amount of characters

    >AAAAAAAAAAAAAAAA

    For optional amount:

    >aaaaaaaaaaaaaaaa


    It won't allow Hyphens, just letters & Numbers. The ">" makes them all Caps. Press F1 wile the curser is in the input mask field for more help.
     
  5. deej

    deej

    Joined:
    Jun 11, 2003
    Messages:
    152
    May be too late with this - been out of touch for a while.

    Example validation rules as an alternative to a mask:

    InStr([fieldname],"-")=0

    or

    Not Like "*-*"

    Either should prevent the "-" symbol being entered.


    Regards
    deej
     
  6. Sponsor

As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 733,556 other people just like you!

Loading...
Thread Status:
Not open for further replies.

Short URL to this thread: https://techguy.org/200009

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice