Part I: Access Building Blocks
62
All the previous formats are the default formats based on setting the Decimal Places property
to AUTO. The exact format applied also depends on the region settings on the user’s computer.
Custom numeric formats
Custom formats are created by combining a number of symbols to create a format specifier. The
symbols used with Number and Currency fields are listed here:
l (^). (period): Specifies where the decimal point should appear.
l , (comma): The thousands separator.
l (^0) (zero): A placeholder for 0 or a digit.
l # (pound sign): A placeholder for nothing or a digit.
l (^) $ (dollar sign): Displays the dollar sign character.
l % (percent sign): Multiplies the value by 100 and adds a percent sign.
l (^) E– or e–: Uses scientific notation to display the number. Uses a minus sign to indicate a
negative exponent and no sign for positive exponents.
l (^) E+ or e+: Uses scientific notation to display the number. Uses a plus sign to indicate posi-
tive exponent.
You create custom formats by composing a string made up of one to four sections separated by
semicolons. Each section has a different meaning to Access:
l (^) First section: The format specifier for positive values
l Second section: The format specifier for negative values
l (^) Third section: The format specifier for 0 values
l Fourth section: The format specifier for null values
Each section is a combination of a numeric formatting string and an optional color specification.
Here’s an example of a custom format:
0,000.00[Green];(0,000.00)[Red];”Zero”;”—”
This format specifies showing the number with zeros in all positions (even if the number is less
than 1,000), using the comma thousands separator, enclosing negative numbers in parentheses,
using “Zero” to indicate zero values, and using three dashes for null values.
Date/Time field formats
Access includes a wide variety of built-in and custom formats applicable to Date/Time fields.
You can create a custom format to display date and time data in virtually any format imaginable.
Built-in Date/Time formats
The following are the built-in Date/Time formats (these examples are based on the “English
(United States)” regional settings in the Control Panel.):