To develop a good database management system, the key is to ensure the integrity and accuracy of data entry. Access provides a number of ways to check the validity of input data, and I'll simply introduce two common methods.
One, the use of field properties
1. Data type properties: The data type determines the type of value the user can save in this field, and access does not store the data if the user types a data that is inconsistent with the type specified in the field. For example, the Date/Time field allows you to enter only valid date and time formats.
2. Field Size properties: For a number field, you can set the size of the field to control the type and range of the input value, and for the text field, set the maximum number of characters you can enter (up to 255).
3. Required Field Properties: Other fields in the database that are outside the AutoNumber field, which generate data for themselves, can be used to set the required field property value to Yes, and require data entry in the field to avoid the omission of some important information.
4. Input Mask Property: This property helps users to enter data in the correct format. For example, create an input mask that shows the number of parentheses, spaces, and connectors, as long as you fill in the blanks when entering.
5. Validation Rule properties: Field validation Rule properties are used to check whether the value of the input field meets the requirements when the user leaves the field.
Table validation rules differ from field validation rules to set the validation rules for table properties when you want to set validation rule properties that involve multiple fields in a table.
Ii. use of event procedures
In some cases, when a validation rule contains complex conditions and needs to perform different operations based on conditions, it is often difficult to write a validation rule, which can be checked by writing code for the following event procedure instead of a validation rule.
BeforeUpdate and Ondelete form events are triggered before the new or modified data in the record is saved or before the record is deleted, and BeforeUpdate and OnExit control events are triggered before the new data on the control or after the modified data is saved and before the control is left.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service