Microsoft Access 2010 Bible

(Rick Simeone) #1

Part I: Access Building Blocks


66


Yes). To customize the appearance of the Yes/No field, set its Format property according to the
following pattern:

;”Text for Yes values”;”Text for No values”

Notice the placeholder semicolon at the front of this string. Also, notice that each text element
must be surrounded by quotes. In the case of the employee table, you might use the following
Format property specifier:

;”Attendance OK”;”Must attend orientation”

You must also set the Yes/No field’s Display Control property to Text Box in order to
change the default check box display to text.

Hyperlink data-type format
Access also displays and stores hyperlink data in a manner different from what you would expect.
The format of this type is composed of up to three parts, separated by pound signs (#):

l Display Text: The text that is displayed as a hyperlink in the field or control

l (^) Address: The path to a file (UNC) or page (URL) on the Internet
l Sub-Address: A specific location within a file or page
The Display Text property is the text that is visible in the field or control, while the address and
sub-address are hidden. In the following example, “Microsoft MSN Home Page” is the displayed
text, while http://www.msn.com is the hyperlink’s address.
Microsoft MSN Home Page#http://www.msn.com
Input Mask
The Input Mask property makes it easier for users to enter the data in the correct format. An
input mask limits the way the user inputs data into the application. For example, you can restrict
entry to only digits for phone numbers, Social Security numbers, and employee IDs. An Input
Mask for a Social Security number might look like “000-00-0000.” This mask requires input into
every space, restricts entry to digits only and does not permit characters or spaces.
A field’s input mask is applied anywhere the field appears (query, form, report).
The Input Mask property value is a string containing as many as three semicolon-separated
sections:
l (^) First section: Contains the mask itself, composed of the symbols shown later.
l Second section: Tells Access whether to store the literal characters included in the mask
along with the rest of the data. For example, the mask might include dashes to separate
the parts of the Social Security number, while a phone number might include parentheses
and dashes. Using a 0 tells Access to store the literal characters as part of the data while 1
tells Access to store only the data itself.

Free download pdf