Form_Mask - DfBaseForm

Provides the token characters for the mask for an entry item

Type: Property

Access: Read/Write

Data Type: String

Parameters: Integer iItem

ParameterDescription
iItem (Optional)The item number (0 if omitted)


Syntax
 Property String Form_Mask

Read Access: Get Form_Mask [iItem] to StringVariable
Write Access: Set Form_Mask [iItem] to StringVariable/Value


Description

The Form_Mask property provides the token characters for the mask for the item passed. Any characters provided in this property for any mask type (defined in the Form_DataType property) for which they are not token characters will be repeated in the displayed values literally. Token characters can be displayed literally by preceding each with a backslash (\).

You must set Form_DataType in conjunction with Form_Mask.
Date masks must supply token characters for all date elements (day, month and year).
Masking is not supported in combo forms.

The token characters for Form_MaskType & Field_Mask_Type Mask_Numeric_Window and Mask_Currency_Window are:

, comma inserts local thousands' separator every three places to the left of the decimal
. period is replaced with the local decimal indicator
; semi-colon comes after format for positive quantities, before format for negative numbers
# no digit or one digit
* any number of digits, including none
0 one digit, or a 0 (zero)
Zsuppress zeros

The token characters for Form_MaskType & Field_Mask_Type Mask_Window are:

# any numeric digit (0-9)
@ any alphabetic character
! any punctuation character
* any single printable character

The token characters for Form_MaskType & Field_Mask_Type Mask_Date_Window are:

m month 1 - 12
mm month 01 - 12
mmm local abbreviation for month Jan - Dec
mmmm local name for month January - December
d day 1 - 31
dd day 01 - 31
ddd local abbreviation for day of week Sun - Sat
dddd local name for day of week Sunday - Saturday
yy 00 - 99
yyyy 1700 - 2900
/ diagonal is replaced with the local date separator

The token characters for Form_MaskType & Field_Mask_Type Mask_DateTime_Window are:

m month 1 - 12
mm month 01 - 12
mmm local abbreviation for month Jan - Dec
mmmm local name for month January - December
d day 1 - 31
dd day 01 - 31
ddd local abbreviation for day of week Sun - Sat
dddd local name for day of week Sunday - Saturday
yy 00 - 99
yyyy 1700 - 2900
/ forward slash is replaced with the local date separator
hh hour 01-12 with AM/PM
HH hour 01-24
mm minute 01-59
ss second 01-59
f fractions of second, displayed with a minimum of 1 digit, 0-999
fff fractions of second, displayed with 3 digits, 000-999
: colon is replaced with the local time separator

The token characters for Form_MaskType & Field_Mask_Type Mask_Time are:

h hour 0-9
hh hour 00-09
mm minutes in 2 digits
ss seconds in 2 digits
ap if present, show in 12 hour format with AM/PM; if not present, show in 24 hour format


Sample

This sample shows how to set the Form_Mask for an object with a single entry item (e.g. dbForm) to display a typical currency format, including the Euro symbol.

Set Form_DataType to Mask_Currency_Window
Set Form_Mask to "Ç,*0.00;-Ç,*0.00"


Sample

This sample shows how to set the Form_Mask for an object with a single entry item (e.g. dbForm) to display a typical currency format. Default_Currency_Symbol will be replace with the currency symbol from the Windows Regional mask setting.

Set Form_DataType to Mask_Currency_Window
Set Form_Mask to (Default_Currency_Symbol()+",*0.00;-"+Default_Currency_Symbol()+",*0.00")


Zero Suppression

Masks support zero-suppression for numbers, dates and strings. Zero-suppression is enabled by inserting a "Z" as the first character of the form mask. The "Z" must be the first character and it must be capitalized. Note that suppression is only applied to forms when they do not have the focus.

When applied to numeric and currency masks, the form will be cleared if its value is zero.

Set Form_DataType to Mask_Currency_Window
Set Form_Mask to "Z$,#######.00;($,#######0.00)"


When applied to a date mask, the form will be cleared if its value is zero (previously the form would appear as " / / ").

Set Form_DataType to Mask_Date_Window
Set Form_Mask to "ZM/d/yyyy"


When applied to a string mask, the form is cleared if the value is blank. Technically, this is not zero suppression but blank suppression.

Set Form_DataType to Mask_Window
Set Form_Mask to "Z(###)###-####"


Also see Zero Suppression in Data Dictionaries.

See Also

Form_DataType | Currency_Mask | Numeric_Mask | Value