You are on page 1of 7

DEFINING FIELD PROPERTIES

The field properties are displayed in the lower left hand section of the
window(design view)
The field properties table is shown below:

The field properties table is different for each different data type. The one shown
above is for a number field type. However different data types will contain
different data properties.
FIELD SIZE
I. Text fields: This property sets the maximum size of the data that can be stored
in a text field. The longest a text field can be 255, the shortest 1.
II. Numeric fields: You can select from the ff:
a. byte – whole numbers between 0 and 255(occupies 1 byte)
b. integer- whole numbers between –32,768 and 32,767 (2 bytes)
c. long integer – whole numbers between –2,147,483,648 and 2,147,483,647 (4
bytes)
d. single – Decimal numbers with six digits of precision (4 bytes)
e. double (default) - decimal number with ten digits of precision (8 bytes)

DEFAULTS
-Access will automatically put data into a field for you when a new record is
created. These values will be dependent on the data type of the field.
- The default value for Number, currency and yes/no fields is zero, in the case of
yes/no fields zero means no, text, memo and date fields are empty by default.
-You can save time by specifying your own default values for fields.
-You can specify the default value by either typing in the required value or using
an expression.
Examples:
1. if all your customers come from Quezon City you might set the default for
the City field to Quezon City
2. if most customers only order one of a product you might set the quantity
field default to 1.
3. You can also use an expression, for example, =Date() which will put the
current date into a date field.
VALIDATION RULES
- Rules that the user must follow when entering data
- rules improve data integrity and validity
- it checks information entered into the database (e.g., into a field) and test
the entry to see if it meets certain criteria
- if the information entered passes the test, the entry is allowed. If the entry
fails the test, a warning appears and the entry is rejected
Examples:
A. For Numeric Field:
-If the credit limit must be below 100000 pesos the validation rule would
be: <=1000
- If the credit limit had to be between 100000 and 200000 pesos your
validation rule would be: >=100 and <= 1000
B. For text fields - you would type the list of values allowed separated by a
semicolon.
- if title to be Mr, Mrs, Miss or Ms your validation rule would be: “Mr” or “Mrs”
or “Miss” or “Ms”
Note: the “ ” are needed for this rule because the values are text – numerical
validation rules do not need them
Examples of validation rules and text messages
Validation Text
-Alongside the validation rule, you can enter the validation text, i.e. the error
message that you want to display to the user when they type in an incorrect data
item.

Notes: The following field types do not support validation rules:

1.AutoNumber 2.OLE Object 3. Attachment 4.ReplicationID

Exercise: Apply /try these validation rules in your database


FORMATS
-Custom formats will display the data in the format that is specified, regardless
of the format in which it is entered.

-Formats vary, depending on the data type used. Some data types have
predefined formats, others have only user defined formats, and some have both.

- for example you can format a telephone number to look like (01202) 222-4444
or change all the characters to upper or lower case in a text field

Note:

- the symbols @ and & work with individual characters you input
- the < and > characters affect the whole entry. If you want to make sure the
name, for example, is in upper case you enter > in the Format property.

Examples:

-if required output for a phone number : (122)758-4789 and you enter the
number without the parentheses and dash

The format is - (@@@)@@@-@@@@


INPUT MASKS
Input masks allow you to have more control over the data entry by defining
data validation place holders for each character you enter. For example, if
you set the property to (999)000-0000, the parentheses appear as shown,
and an underscore (_) appears in place of the 9 or 0

When you have defined an input mask and set the Format property for the
same data, the Format property takes precedence when Access displays the
data. This means that even if you’ve saved an input mask with data, it is
ignored when the data is formatted

Below is a cheat sheet for Access input masks.


Customize input mask examples
(000)-000-0000 will force the user to enter a phone number with an area code.

(999)000-0000! will force to user to enter a 7 digit phone number but is optional
for the area code. The exclamation mark causes the input mask read the numbers
from left to right.

LL-000 will force the user to enter 2 letters followed by 3 numbers.

>L<??????????????? will make the first letter capitalized and the following
letters lower case.

99->L<LL-0000 will ensure the user enters the date as DD-MMM-YYYY. For
example, 20-Mar-2016.
This specifies how the date should be entered. Here's an break down of each
part:

 The 99 part defines two optional numbers (i.e. for the day). So the user has
a choice of entering that part of the date. But if they do, it must be a
number.
 The >L specifies that the user must enter an uppercase letter for that part
of the date.
 The <LL specifies two lowercase letters for that part of the date.
 The 0000 specifies four numbers for that part of the date.

You might also like