How to: Specify Input Masks for Fields
You can make it possible to enter and store values in fields for database tables in a uniform manner, reducing data entry errors and making processing more efficient. You can accomplish this by defining the punctuation, spacing, and other format attributes for values entered in a field using an input mask.
For example, you can make it possible to enter and store telephone numbers in a field by adding an input mask appropriate for telephone numbers to a numeric field, for example (999) 999-9999. The input mask helps the user enter telephone numbers more quickly because the formatting is provided. For more information about input mask characters, see InputMask Property.
To specify an input mask for a field
Open the database containing the table.
Open the table in the Table Designer (Visual FoxPro).
On the Fields tab, select the field that you want.
In the Input mask box of the Display area, type the input mask characters that you want.
For more information, see Fields Tab, Table Designer.
To specify an input mask for a field programmatically
- Use the DBSETPROP( ) function to set the InputMask field property.
For more information, see DBSETPROP( ) Function.
For example, the following code specifies an input mask for a date:
DBSETPROP("Orders.Postalcode","Field","InputMask", "99999-9999")