Briefly describe Field Name, Data Type and Description properties.
Field name is the name of column. It should represent the contents of the field such as “Name”, “Address” and “Final Grade” etc. the name of the field cannot exceed 64 characters in length. It many include spaces. The use of spaces in field name is not a good practice.
Each filed must be assigned a particular data type. The data type specifies the type of data that can be stored in the field. Common data types in MS Access are Number, Text, Currency and Date etc.
What is field property? Discuss different field properties in details.
Filed properties are used to define how data will be entered, stored and displayed in MS Access. The properties of each filed can be set in design view. The properties window is divided into two parts. The top pane is used for entering the field name, data type and an optional description of the field. The bottom pane is used for specifying the field properties.
Different filed properties are as follows:
Filed Size is used to set the number of characters required in text or number field. The default field size for the text type is 50 characters. The field size can be limited to a certain number of characters if value in field is small. It waves disk space and prevents entry errors. The filed size is set in exact characters for Text type. The options for numbers are as Follows:
The format is used to specify the format of data as it is displayed in the field. It has two parts for text and memo fields that are separated by a semicolon. The first part of the property is used to apply to the field and the second applies to empty fields.
In some cases, the value of all records in a certain field is same. A default value can be set in this case. The default value already appears in the field when the user enters data. So the user does not need to type the same value again and again. The property Set the Default Value is used to set default value for a field.
The indexes are created to obtain and sort records faster in MS Access. The Indexed property is used to set an indexed filed. The Yes (Duplicates OK) is selected if multiple entries of same data value are allowed. The Yes (No Duplicates) option prevents duplicates.
Field Validation Rules
The Validation Rules specify the criteria for the data entered in the field. A message can be displayed to the user if the data violates the rules set for the field. The expression builder (“…”) button at the end of Validation Rule box is used to writer validation rule. For example, a validation rule <> 0 indicates that zero cannot be entered in the record. The rule ??? indicates that the data may consist of only three characters.
A property used to specify the message to be displayed to the user when a validation rule is violated.
An input mask controls the value of a record and sets it in a specific format. It is similar to Format property but it displayes the format on datasheet before data is entered. A phone number filed can be formatted with input mask to accept ten digits as “(555) 123-4567”. The blank field will look like (___) ___-___. It helps user in entering value in specific format.
The Caption property is used to the field. It works as an alternate heading of the field. It appears at the top of columns in table’s datasheet view.
The Required property specifies whether the field is mandatory or not. If this property is set to Yes, the user has to enter data for the filed to save the record. If this property is set to No, the user can leave the field blank. It does not apply to fields with AutoNumber data type as Access provides value for such data type.