Share via

Microsoft Access - Error Message regarding input value restriction

Anonymous
2019-09-17T16:02:32+00:00

On one of my forms two boxes are giving me error message of "Enter value of 0-10 or N/A" even when I type a numebr between 0 and 10. The form is linked to a Table and I get the same error message there. I checked the field properties of the table and it says:

Under General:

Field Size: Long Integer

Format: General Number

Decimal Places: Auto

Input Mask: 

Caption: # of Children

Default Value: 0

Validation Rule: <=10

Validation Text: Enter a number between 0 and 100

Required: No

Indexed: No

Text Align: General

Under Lookup

Display Control: Text Box

Thank you for your help!

Microsoft 365 and Office | Access | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

4 answers

Sort by: Most helpful
  1. Anonymous
    2019-09-20T11:44:46+00:00

    Thank you!

    Was this answer helpful?

    0 comments No comments
  2. Anonymous
    2019-09-18T12:08:01+00:00

    As the column can apparently accept a value of 'N/A' it must be of text data type.  Consequently any comparison of values is on a text basis, so a value of "2" for instance is not less than a value of "10"  you can see this in the immediate window:

    ? "2"<"10"

    False

    You can make a numerical  comparison by calling the Val function:

    ? Val("2")<10

    True

    The validation text you are getting is not that specified in the table definition, so I suspect the control in the form has been given a different validation text.  You'll need to amend both ValidationRule properties therefore to this:

    (Val([NameOfColumnGoesHere])>=0 And Val([NameOfColumnGoesHere])<=10) Or [NameOfColumnGoesHere]="N/A"

    Was this answer helpful?

    0 comments No comments
  3. Anonymous
    2019-09-18T11:42:57+00:00

    "Enter value of 0-10 or N/A"

    Was this answer helpful?

    0 comments No comments
  4. Anonymous
    2019-09-18T04:04:08+00:00

    What is the error message?

    Was this answer helpful?

    0 comments No comments