Microsoft Access 2007 tutorial:set table field format
Set table field format
III. Set Format of a table field
When you start to create a table, you must know the important properties of table field. Those properties are field size, format, input mask, default value, validation text, validation rule require, and indexed.
II.1. Field Size Property
The field size is used to set the size of a field. The field size property is applied to text and number field. For a text field(field to store text value), the field size specifies the number of characters that can be entered in to the field. For a number field(field to store numerical value) the value of the field size can be Byte, Integer, Long Integer, Single, Double, etc. For instance, we want to set field size on employee name; this field can enter only 70 characters. To do so, you have to set number in front of field size as figure:
III.2. Format Property
When you create a table, you can set format to customize the fields you like. Those fields maybe have data type as text, number, currency or date/time. For example, you want all names of employees are capital letters when it display. You have to set it as figure:
III.3. Input Mask Property
By using Input Mask property, you can select a pattern you think it is suitable for your data display. To use this property, your type of data must be text or Date/Time data type. The example below shows the use of input mask, a password pattern; when you enter your password number in a field password, it will display asterisk sign instead of number.
III.4 Default Value Property
You can use this property to predefine a value of the field . By setting the default value, this value will display when you open a table. For example you want set the word “No Phone ” on phone field of a table in order to inform you when you didn’t enter data on the field. The figure below will show you how to do this work.
III.5. Validation Rule Property
Validation Rule Property allows you to limit or control what you want users to enter on a table field. In order to avoid errors, you should use this property. It can help you to save the time for problem solving. For instance, you want to set condition on income field, only positive number is possible. In case, you enter negative number the message will display to inform you to enter the correct value. To define validation rule follow the figure below:
Through example above, you maybe wonder what data type can you use with validation rule? The answer is all data type of field. In addition, you can set other conditions besides example above such as “Male or Female”, “>100 and <1000”, “<=150” and so on.
III.6. Validation Text Property
This property is used with validation rule property. The validation text display when the user enters data that violate the validation rule. The figures below show how to set validation text and the alerted message.
III.7. Required Property
This property requires data to enter in a field. It has two values for you to choose “Yes” and “No”.
- Yes: Need to input data
- No: Not require data entry
III.8. Indexed Property
This property allows your data searching and shorting faster but it is slow for data updating. There are two values for you to select when you use Indexed property. First Yes (Duplicates Ok) and last one Yes (No Duplicates).
- Yes (Duplicates Ok): Redundancy data was not allowed.
- Yes (No Duplicates): Redundancy data was allowed.