Modifying Access tables is simple. Use these tips to modify tables in Access to suit your database's needs.
Setting the character limit for a field sets a rule about how many characters—letters, numbers, punctuation, and even spaces—can be entered into that field. This can be useful to keep the data in your records concise or to force users to enter data a certain way.
For instance, in the example below, the user is entering records that include addresses. If you set the character limit in the state field as 2, the user can only enter 2 characters of information. This means he must enter postal abbreviations for the states instead of their full names—here, NC instead of North Carolina. Note that you can only set a character limit for fields defined as text.
A validation rule is a rule that dictates what information can be entered into a field. When a validation rule is in place, it is impossible for a user to enter data that violates the rule. For example, if we were asking users to input a state name into a table with contact information, we might create a rule that limits the valid responses to U.S. state postal codes. This would prevent users from typing something that wasn't actually a real state postal code.
In the example below, we will apply this rule to our Customers table. It's a fairly simple validation rule—we'll just name all of the valid responses a user could enter, which will mean users can't type anything else into the record. However, it's possible to create validation rules that are much more complex. For detailed information on how to write validation rules, review this official Microsoft office tutorial on creating validation rules.
Simple validation rules can be written exactly like query criteria. The only difference is that query criteria search for data, while an identical validation rule either permits or rejects data. To see examples of query criteria, review our Query Criteria Quick Reference Guide.