Reputation: 55
In MS Access, how can I prohibit the entry of two spaces in the field in the table? Is it possible directly in the table or by using a form?
Example: John__Smith
Upvotes: 0
Views: 74
Reputation: 97101
You can enforce that requirement in your table's design with a Validation Rule for the field:
Note I used ALike
which tells the db engine to treat %
as a wildcard to match zero or more of any characters. If you prefer Like
, use this for the Validation Rule property: Not Like '* *'
Upvotes: 2
Reputation: 1872
Sounds like something that you need to handle on a data entry form.
You can use the AfterUpdate event for the control and write code to check for 2 spaces in a row, and then remove one.
Upvotes: 2