Microsoft Office Tutorials and References
In Depth Information
Using Input Masks to Validate and Format Data
Required: This property specifies that the field must have a value for
you to save the record. When no value is entered, Access doesn’t create
a new record when Tab or Enter is pressed, and the New Record button
is unavailable. Required is also accessible from Datasheet view; it’s a
check box on the Fields tab of the Ribbon.
Unique: This property specifies that each entry in the field must be
unique, with no identical values anywhere else in the field.
Allow Zero Length: This property specifies whether a zero-length
entry, such as ““ (quotes without a space between them), is allowed
(only for Text and Hyperlink fields). A zero-length field allows you to
differentiate between information that doesn’t exist and a null value
(blank) that is unknown or hasn’t been entered. When this option is set,
it allows a zero-length string in a required field. When both a zero-length
field and a null value are allowed in a single field, you may want to use
an input mask to make these elements look different from each other.
Book II
Chapter 5
Indexed: When you choose to index a field, you can specify that no
duplicate values are allowed in the field. This property is also accessible
from Datasheet view; it’s a check box on the Fields tab of the Ribbon.
The rules that keep your data honest and help keep bad data out are
sometimes called data-integrity rules. You can change a field property that
controls data integrity (filters out garbage data) in a field that already has data.
Access tells you (when you ask to view the datasheet) that the data-integrity
rules have changed and gives you the option of checking existing data
against the new rules.
Access tells you only whether existing data violates the new rules; it doesn’t
flag the offending records in any way.
The rest of this chapter covers input masks; validation rules; and the Lookup
Wizard, which allows you to create drop-down menus and choose existing
data, eliminating the possibility of misspelling a new entry.
When you use both the Format field property and an input mask, Access
uses the field property and ignores the input mask.
Using Input Masks to Validate and Format Data
An input mask formats the data and defines the types of characters, as well
as the order in which they can be entered. Input masks have two intertwined
They format data by adding punctuation or changing the look of
certain values. An input mask might display asterisks instead of the text of
passwords, for example.
Search JabSto ::

Custom Search