Share via

Access not accepting validation rule

Anonymous
2014-04-16T18:17:01+00:00

I am trying to set a validation rule for a table's primary key.  the field is a 9 digit id and the field format is text.  I have tried Like "000000000" as well as Like "#########", neither of these work as access keeps saying there is an operator missing.

I have simply removed the Like and input "000000000" but then access will not let me add a new record with any 9 digit number or edit an existing number even when the edit is to retype the existing id.

I am positive this is simple user error on my part but have not found the answer online so far.  What am I doing wrong?

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

Answer accepted by question author

Anonymous
2014-04-16T19:34:16+00:00

I would expect  Like "#########"  to work, unless the table is an ODBC linked table.  For Jet/ACE linked tables, make sure you set the rule in the back end database.

If you are using forms for entering/editing data (strongly recommended), you could probably could get by by using the form control's validation rule property instead of the table's.

Was this answer helpful?

0 comments No comments

Answer accepted by question author

ScottGem 68,830 Reputation points Volunteer Moderator
2014-04-16T18:46:26+00:00

Use an input mast instead. If you set the input mask to "#########" it should require 9 digits.

Was this answer helpful?

0 comments No comments

1 additional answer

Sort by: Most helpful
  1. Anonymous
    2014-04-16T19:03:05+00:00

    Use an input mast instead. If you set the input mask to "#########" it should require 9 digits.

    That worked, but I had to remove the "" for it to accept any input.

    Was this answer helpful?

    0 comments No comments