RedCape's Blog

Technology Tips

Create a Default Format to Capitalize Name Fields in InfoPath

When you have name fields in your form, you can force InfoPath to autoformat the capitalization of those fields so that the first letter of the name is properly capitalized. Thanks to S.Y.M. Wong-A-Ton’s article for the tip. Here are the step by step instructions for setting the default format on a name field. Use this on any control you need proper case.

  1. As you can see, I have the two name fields in my form: First Name and Last Name.

  2. Double-click the First Name field to launch the Text Box Properties dialog box. Then click the Function button to the right of the Default Value property.

  3. Copy and paste the following code in the Formula area

    concat(translate(substring(., 1, 1), “abcdefghijklmnopqrstuvwxyz”, “ABCDEFGHIJKLMNOPQRSTUVWXYZ”), substring(., 2, string-length(.) – 1))

    Your window should look like this. Click OK twice.

  4. Test the field by using Preview mode.

Single Post Navigation

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 )

Google photo

You are commenting using your Google 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 )

Connecting to %s

%d bloggers like this: