Database Reference
In-Depth Information
To build a custom format:
With the table open in
Design
view, select the field you want to apply the custom
format to.
1
In the
Field Properties
area, in the
Format
box, enter the format.
2
Switch to
Datasheet
view, saving the table.
3
Any existing data will be displayed according to the format. New data you enter will
conform to the format when you leave the field. As an example, consider the following
format:
@”.com”;”no link”[red]
This format specifies two customizations separated by a semicolon. The part before
the semicolon specifies what Access should do if characters are entered—in this case,
append
.com
; and the part after the semicolon specifies what Access should do if the
field is empty—in this case, display
no link
in red.
6
Validating the data
A validation rule precisely defines the information that will be accepted in one or several
fields in a record. You might use a validation rule in a field containing the date an em-
ployee was hired to prevent a date in the future from being entered. Or if you deliver
orders to only certain local areas, you might use a validation rule on the postal code field
to refuse entries from other areas. You can create validation rules for all data types except
AutoNumber, OLE Object, and Attachment.
In a table, you might want to create validation rules for individual fields or for entire
records:
▪
Field validation
At this level, Access uses the validation rule to test an entry when
you attempt to leave the field.
▪
Record validation
At this level, Access uses the rule to test the contents of more
than one field when you attempt to leave the record.