Infopath Display the current date in a date picker

To automatically insert the current date on a form when users open it, you can use the today function with a date picker control.
Insert a date picker on the form template.

Double-click the date picker that you inserted on the form template.

Click the Data tab.

Under Default Value, click Insert Formula .

In the Insert Formula dialog box, click Insert Function.

In the Categories list in the Insert Function dialog box, click Date and Time.

In the Functions list, click today, and then click OK twice to return to the Date Picker Properties dialog box.

Notice that today() appears in the Value box.
Under Default Value, clear the Update this value when the result of the formula is recalculated check box.

Note   If you clear this check box, the date isn’t updated automatically each time a user opens a form based on this form template. This is ideal in situations where you want users to see the date when the form was created. You can leave the check box selected in situations where you have a Last updated on or Last opened on field, where you want the date to change every time the form is opened.
Click OK to return to the form template.

To test your changes, click Preview on the Standard toolbar, or press CTRL+SHIFT+B.

Verify that the date that appears in the date picker looks the way that you want it to. If it doesn’t, you can change how the date or time is displayed by clicking the Format button in the Date Picker Properties dialog box.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s