Validating input in c

6854933580_2c8b688306_z

For more information about data types, field sizes, and input masks, see the article Introduction to data types and field properties.You can define validation rules for table fields and for controls on forms.

To add validation rules to a table, you open the table and use commands on the Fields tab of the ribbon.Validation text lets you provide a message to help users who input data that is not valid.When data is entered, Access checks to see whether the input breaks a validation rule – if so, the input is not accepted, and Access displays a message.The steps in the section Add a validation rule to a control on a form, later in this article, explain how to add rules to the properties in individual controls.Your validation rules can contain expressions — functions that return a single value.Usually, a record validation rule compares the values of two or more fields.Tip: If you create a form automatically from a table by using one of the Form commands on the ribbon, any validation for fields in the underlying table are inherited by the corresponding controls on the form.If the rules are mutually exclusive, they prevent you from entering any data at all.For example, suppose you apply the following rule to a date field in a table: Forces users to enter values in the field.You can use an expression to perform calculations, manipulate characters, or test data. For example, an expression can check for one of a series of values, such as "Tokyo" Or "Moscow" Or "Paris" Or "Helsinki".Expressions can also perform mathematical operations. For example, the expression You can add a field validation rule and/or a record validation rule.

You must have an account to comment. Please register or login here!