Change how a date or time is displayed in a date picker, text box, or expression box
Note: Some of the options described in this article apply only when you select English (United States) in the Locale list in the Date Format, Time Format, or Date and Time Format dialog boxes.
In Microsoft Office InfoPath, you can add data formatting to text box, expression box, and date picker controls on your form template to specify how dates, times, and numbers are displayed when users enter them into forms that are based on your form template.
Although you can specify data formatting for several data types, you can specify how dates and times are displayed only for date picker controls, text box controls, or expression box controls that have a date, time, or date and time data type.
Note: When you design a form template in InfoPath, you can choose a specific compatibility mode to design a browser-compatible form template. When a browser-compatible form template is published to a server running InfoPath Forms Services, and then browser-enabled, forms based on the form template can be viewed in a Web browser. Browser-compatible form templates do not support the display of the date and time in the same control. To display the date and time in two separate controls, refer to the procedure "Display the date and time in separate controls" at the end of this procedure.
-
Double-click the date picker, text box, or expression box control whose data you want to format.
-
In the Control Properties dialog box, do one of the following:
-
If you are working with a text box control or a date picker control, click the Data tab.
-
If you are working with an expression box control, click the General tab.
-
-
Do one of the following:
-
For a text box control or a date picker control, ensure that the Data type list displays the appropriate data type, and then click Format.
-
For an expression box control, ensure that the Format as list displays the appropriate data type, and then click Format.
-
-
In the Data type Format dialog box, do one of the following:
-
To format the control to show the date only, select the display style that you want in the Display the date like this list.
-
To format the control to show the time only, select the display style that you want in the Display the time like this list.
-
To format the control to show both the date and time, select the display style that you want for the date in the Display the date like this list, and then select the display style that you want for the time in the Display the time like this list.
Note: Display styles that have an asterisk will be updated to reflect the current format specified by the user's system settings.
-
-
To change the locale date and time settings, select the country or region that you want in the Locale list.
Browser-compatible form templates do not support the display of the date and time in the same control. Use the following procedure to display the date and time in separate controls:
Display the date and time in separate controls
Before you begin, make sure that your form template contains two controls, and that both controls are bound to the same field in the data source.
-
Double-click the date picker, text box, or expression box control that you want to use to display the date.
-
In the Control Properties dialog box, do one of the following:
-
If you are working with a text box control or a date picker control, click the Data tab.
-
If you are working with an expression box control, click the General tab.
-
-
Ensure that the Data type list displays the Date and Time data type, and then click Format.
-
In the Display the date like this list in the Date and Time Format dialog box, click the display style that you want.
-
In the Display the time like this list, click (Do not display time).
-
Click OK twice.
-
Double-click the date picker, text box, or expression box control in your form template that you want to use to display the time.
-
In the Control Properties dialog box, do one of the following:
-
If you are working with a text box control or a date picker control, click the Data tab.
-
If you are working with an expression box control, click the General tab.
-
-
Ensure that the Data type list displays the Date and Time data type, and then click Format.
-
In the Display the date like this list in the Date and Time Format dialog box, click (Do not display date).
-
In the Display the time like this list, click the display style that you want.
-
To change the locale date and time settings, select the country or region that you want in the Locale list.
Note: If you select a locale other than English (United States), some date formats will be unavailable when your users fill out forms by using a Web browser. For example, the date format 14-mars-01 is not supported in the French (Belgium) locale. To ensure that you do not use a date format that is not supported, run the compatibility checker before publishing your form template.
No comments:
Post a Comment