Results 1 to 6 of 6
  1. #1
    Join Date
    Jun 2009
    Posts
    23

    Unanswered: Confused with the validation rule

    Hi,

    I have a simple textbox on a form. I want the textbox to accept values in the range from 0 to 99999. For this i have changed the validation rule property as textbox > 0 and textbox < 99999. But what ever value i have entered in the textbox in getting the dialog box with a message (which was set for Validation Text). Am i missing something, as i think this should be a pretty much basic issue.

  2. #2
    Join Date
    Jun 2007
    Location
    Maitland NSW,Australia
    Posts
    388
    Try 0<textbox OR textbox>99999, this will display you error message if the value entered is not between 0 and 99999.

  3. #3
    Join Date
    Jun 2005
    Location
    Richmond, Virginia USA
    Posts
    2,763
    Provided Answers: 19
    Is this validation done at the table level or form level and is the field held in the textbox defined as a Numerical Datatype?
    Hope this helps!

    The problem with making anything foolproof...is that fools are so darn ingenious!

    All posts/responses based on Access 2003/2007

  4. #4
    Join Date
    Nov 2007
    Location
    Adelaide, South Australia
    Posts
    4,049
    Set your Validation Rule to Between 0 and 99999
    Owner and Manager of
    CypherBYTE, Microsoft Access Development Specialists.
    Microsoft Access MCP.
    And all around nice guy!


    "Heck it's something understood by accountants ... so it can't be 'that' difficult..." -- Healdem
    "...teach a man to code and he'll be frustrated for life! " -- georgev

  5. #5
    Join Date
    Jun 2009
    Posts
    23
    0<textbox OR textbox>99999 is throwing an error message.

    Between 0 and 99999 is working fine. But i dont why my code is not working. Any ways, thanks for your help.

  6. #6
    Join Date
    Nov 2007
    Location
    Adelaide, South Australia
    Posts
    4,049
    You're most welcome

    If your "code" is something like "0<textbox OR textbox>99999" then the reason is that the validation rule automatically applies to the text box it's in, so the references to [textbox] are out of place.
    Owner and Manager of
    CypherBYTE, Microsoft Access Development Specialists.
    Microsoft Access MCP.
    And all around nice guy!


    "Heck it's something understood by accountants ... so it can't be 'that' difficult..." -- Healdem
    "...teach a man to code and he'll be frustrated for life! " -- georgev

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •