1. [Your company name] presents:
Microsoft Office
®
InfoPath 2003 Training
®
Customizing form controls
2. Course contents
• Overview: Techniques for customizing
• Lesson 1: Add a button to your form for
switching views
• Lesson 2: Display dates and times in a form
(Continued on next slide.)
Customizing form controls
3. Course contents, cont’d.
• Lesson 3: Hide or disable controls, conditional
formatting
• Lesson 4: Add up numbers in a table
Each lesson includes a list of suggested tasks and a set of
test questions.
Customizing form controls
4. Overview: Techniques for customizing
Controls are an essential part of any
InfoPath form. Discover four great
techniques for working with them
effectively.
For example, you can create a
button that lets people switch
easily between form views.
You can also display dates and times
the way you want using text boxes
and date pickers.
Customizing form controls
5. Course goals
• Add a button that automatically switches between
different views of the same form.
• Display dates and times in a form.
• Hide or disable a control.
• Add up numbers in a table.
Customizing form controls
7. Add a button for switching views
In InfoPath, you can offer different
ways to look at the data in your
form by creating different views.
You might create a special view
that's optimized for printing.
You might also create a high-level
Adding a button provides
easy switching between summary view to remove some of
views. the detail in a complex form.
Customizing form controls
8. A refresher on views
A view is an alternative way to look
at or present data in a form.
InfoPath forms can have more than
one view.
Views offer different
perspectives of the data
in a form.
Customizing form controls
9. A refresher on views
You might use views to:
• Simplify a long, complex form by
splitting it up into different views.
• Show different versions of a form
to different people based on their
role in your organization.
Views offer different • Create a print-friendly view of your
perspectives of the data form.
in a form.
Customizing form controls
10. A refresher on views
You can freely copy the controls you
need from your main view into other
views in the form because all views
share the same data source.
Views offer different
perspectives of the data
in a form.
Customizing form controls
11. Views: The user experience
If you design your form with
multiple views, people filling out the
form can switch from one view to
another by clicking commands on
the View menu.
You can supply buttons
as another way to switch
views..
Customizing form controls
12. Views: The user experience
To help form users who might miss
the menu commands, add buttons
to your form for switching views.
You can supply buttons
as another way to switch
views.
Customizing form controls
13. According to the rules
Once you insert the button, how do
you make it switch views when
someone clicks it? The easiest way
is to use a rule.
Rules automate certain tasks in a
form in response to events or
actions initiated by the person filling
A rule makes the button out the form.
switch views.
Customizing form controls
14. According to the rules
In this example, the picture at left
shows that the form designer has
created a rule that switches from
the default form view, which
contains a lot of detail, to a high-
level summary view.
A rule makes the button
switch views.
Customizing form controls
15. According to the rules
To create a rule for the button:
Double-click the button to open the
Button Properties dialog box.
From within this dialog box, you can
access the Rule dialog box, which
is where you set up the rule for
switching the view.
A rule makes the button
switch views.
Customizing form controls
16. According to the rules
Use the Rule dialog box to associate
rules with most controls in
InfoPath, such as text boxes and
check boxes.
In this case, we want to associate a
rule with a button so that the view
changes when a button is clicked.
A rule makes the button
switch views.
Customizing form controls
17. Suggestions for practice
1. Look at a form that has two views, and see InfoPath's
default behavior for switching between them.
2. Insert a button in each view.
3. Create a rule that switches views.
4. Test the user experience by clicking the buttons in a
preview.
Online practice (requires InfoPath 2003 Service Pack I)
Customizing form controls
18. Test 1, question 1
In InfoPath, a _____ is an alternative way to
present data in a form. (Pick one answer.)
1. Subform.
2. Transform.
3. View.
4. Preview.
Customizing form controls
19. Test 1, question 1: Answer
View.
When a user switches to a different view, the form's data
doesn't change; only the presentation of the form and the
amount of data displayed change.
Customizing form controls
20. Test 1, question 2
How can people switch between views when
filling out a form? (Pick one answer.)
1. By clicking commands on a View menu or by
clicking a custom button on the form.
2. By clicking commands on a View menu or by
selecting options in a Views task pane.
Customizing form controls
21. Test 1, question 2: Answer
By clicking commands on a View menu or by clicking a
custom button on the form.
If your form has multiple views, InfoPath automatically adds
view-switching commands to the View menu for the user.
You can also use a custom button and add a rule to it for
switching views.
Customizing form controls
22. Test 1, question 3
In InfoPath, rules are used to: (Pick one answer.)
1. Prevent users from accessing restricted data in a
form.
2. Automate certain tasks in a form.
3. Assign different roles to different types of users.
Customizing form controls
23. Test 1, question 3: Answer
Automate certain tasks in a form.
As you learned in this lesson, you can use rules to
automatically switch views in response to a button click.
Customizing form controls
24. Test 1, question 4
It's okay to copy controls between views when
you're designing a form. (Pick one answer.)
1. True.
2. False.
Customizing form controls
27. Display dates and times in a form
Many forms contain dates. For
example, you may have a form that
shows the current date by default
when people open it. Or, you may
have one that includes a field
where people can easily enter dates
in a uniform way.
There are many ways to InfoPath offers you different ways
display dates in a form. to display dates in a form and to
collect dates from people.
Customizing form controls
28. Display dates and times in a form
In this lesson, you will:
• Work with the today and now
functions, which you, as the form
designer, can use to show today's
date and time in your form.
• Work with the date picker, a
control that lets users manually
There are many ways to enter dates.
display dates in a form.
• Learn how to better control the
way dates display in your form.
Customizing form controls
29. Pick a date, any date
The date picker is a control that lets
people quickly enter dates in a form
by clicking in a small pop-up
calendar.
It looks a lot like a text box, with a
small calendar icon on its right side.
The date picker When people click this icon, a pop-
up calendar appears in their
form, allowing them to enter dates.
Customizing form controls
30. Pick a date, any date
The date picker can be customized:
• Double-click the control and
change its properties.
• You can specify a default date or
change the way the date looks in
the form.
The date picker
Customizing form controls
31. Display today's date or time
The date picker is a great way to let
users enter dates of their
choice, such as start and end dates
for a particular project.
The today and now
functions
Customizing form controls
32. Display today's date or time
But what if you want today's date to
display automatically whenever
people create a form?
In this case, you can use a special
function called the today function
to add the current date to your
form.
The today and now
functions
Customizing form controls
33. Display today's date or time
The now function is similar to the
today function.
Users see the current time displayed
in addition to today's date.
The today and now
functions
Customizing form controls
34. What if I don’t like how the date looks?
What if the date inside a text box or
date picker appears in the form as
10/18/08, but you'd rather it be
October 18, 2008, or 18-Oct-2008,
or something else entirely?
All you need to do is change the
display format for the date or
Changing the display time.
format
Customizing form controls
35. What if I don’t like how the date looks?
To do this, your control must be one
of the following three data types:
• Date (date)
• Time (time)
• Date and Time (dateTime)
Changing the display
format
Customizing form controls
36. What if I don’t like how the date looks?
If your control uses an appropriate
data type, you can specify exactly
how you want dates and times to
look.
1. To change the way the date
displays, double-click the date
picker control, and then click the
Format button.
Changing the display
format 2. Pick a display format in the Date
Format dialog box.
Customizing form controls
37. Suggestions for practice
1. Insert a date picker.
2. Change the way the date displays.
3. Configure a text box to display the current date.
4. Configure a text box to display the current date and time.
5. Fine-tune the text box (extra credit).
Online practice (requires InfoPath 2003 Service Pack 1)
Customizing form controls
38. Test 2, question 1
What's the difference between the today and
now functions? (Pick one answer.)
1. The now function shows the current date and time;
the today function shows only the current date.
2. The today function shows the current date and
time; the now function shows only the current date.
Customizing form controls
39. Test 2, question 1: Answer
The now function shows the current date and time; the
today function shows only the current date.
Customizing form controls
40. Test 2, question 2
If you want the date inside a control to look like
August 18, 2008, instead of 8/18/08, what
would you do? (Pick one answer.)
1. Type over the date in the control.
2. Change the data type.
3. Change the display format for the control.
Customizing form controls
41. Test 2, question 2: Answer
Change the display format for the control.
If the data type for your control is Date (date), Time
(time), or Date and Time (dateTime), you can change the
display format in the Properties dialog box for the control.
Customizing form controls
42. Test 2, question 3
How can you prevent people from typing over a
preset date in a control? (Pick one answer.)
1. You can't; people can opt to change these dates if
they want to.
2. Use data validation to display a warning message.
3. Open the properties dialog box, and make the
control read-only.
Customizing form controls
43. Test 2, question 3: Answer
Open the properties dialog box, and make the control
read-only.
As you learned in the practice session, if you make a control
read-only, users can see the date but they won't be able to
change it.
Customizing form controls
45. Hide or disable controls
You may know that you can use
conditional formatting to draw
attention to controls in a form
through the use of color and
character formatting.
Hide a control with
conditional formatting. But did you know that you can also
hide or disable a control — or even
a whole section of a form — based
on the value in another control?
Customizing form controls
46. Conditional formatting refresher
Conditional formatting is often used
to highlight or call attention to
specific, important, or sensitive
information in a form.
In InfoPath, you typically use
conditional formatting to change the
appearance of a control based on
values users enter into your form.
Customizing form controls
47. Conditional formatting refresher
When you work with conditional
formatting, you set conditions for
formatting controls:
• If the conditions are met, then
InfoPath changes the appearance
of the control.
• If they aren't met, no changes
take place.
Customizing form controls
48. Conditional formatting refresher
Take a look at the example in the
picture. In the second row, notice
how the amount spent exceeds the
amount budgeted?
The form designer has used
conditional formatting to draw
attention to this fact.
Customizing form controls
49. Conditional formatting refresher
In this case, you can describe the
condition as follows:
“If the value in the Amount Spent
box exceeds the value in the
Amount Budgeted box, then apply
red shading to the Amount Spent
box.”
Customizing form controls
50. Conditional formatting refresher
To create conditions, use the
Conditional Format dialog
box, which is accessible from the
Format menu in design mode, or
through the properties dialog boxes
for text boxes and other controls.
Customizing form controls
51. Use a check box to show or hide a section
One of the best ways to use
conditional formatting is to show or
hide a control based on the value
entered or selected in another
control.
A typical way to do this is to design
your form with a check box above a
section so that selecting the check
box hides or shows the section.
Customizing form controls
52. Use a check box to show or hide a section
For example, in an expense
report, you might use conditional
formatting to show a manager-
approval section to people when
their expenses total more than
$1,000.
If expenses are less than that, the
section remains hidden in the form.
Customizing form controls
53. Use a check box to show or hide a section
Or, imagine a form in which you
want people to be able to add an
alternative shipping address.
In this case, you might include an
Add another address check box
above an Alternative address
section in your form.
Customizing form controls
54. Use a check box to show or hide a section
See the illustration at left. With
conditional formatting, you can
choose to hide an alternative
address section by default.
1. When people select the Add
another address check box…
2. …the Alternative address
section appears in the form.
Customizing form controls
55. Make text boxes read-only
Along with its other uses, conditional
formatting can make one or more
controls read-only.
A control can be read but not
changed after a particular condition
Read-only text boxes
is met — for example, after a check
box is selected.
Customizing form controls
56. Make text boxes read-only
Conditional formatting can also be
used to make each text box in the
section read-only if a check box is
cleared.
See the illustration at left.
Read-only text boxes
1. When the I accept the terms
and conditions check box is
not selected...
2. …people won't be able to fill out
the registration boxes.
Customizing form controls
57. Make text boxes read-only
You can also disable buttons and
other controls based on conditions in
the form. When a control is
disabled, it appears dimmed in the
form.
Read-only text boxes
Customizing form controls
58. Suggestions for practice
1. Use conditional formatting to show or hide a section.
2. Test the behavior.
3. Remove the conditional formatting from the section.
4. Make text boxes inside the section read-only.
Online practice (requires InfoPath 2003 Service Pack 1)
Customizing form controls
59. Test 3, question 1
What's the best way to make a section disappear
when a check box is selected? (Pick one answer.)
1. Use conditional formatting.
2. Use a rule.
3. Use data validation.
Customizing form controls
60. Test 3, question 1: Answer
Use conditional formatting.
You can use conditional formatting to create an expandable
and collapsible section or to hide a control based on a value
selected elsewhere in the form.
Customizing form controls
61. Test 3, question 2
How can you access the Conditional Format
dialog box? (Pick one answer.)
1. By using either the Format menu or the Edit
menu.
2. By using the Format menu only.
3. By using either the Format menu or by accessing a
control's properties.
Customizing form controls
62. Test 3, question 2: Answer
By using either the Format menu or by accessing a
control's properties.
To use the menu command, select the control first; to use a
control's properties dialog box, double-click the control.
Then, look for the Conditional Formatting button on the
Display tab.
Customizing form controls
63. Test 3, question 3
When you use conditional formatting to make a
text box read-only, how does its appearance
change? (Pick one answer.)
1. The text box's appearance doesn't change in any way.
2. The text box appears dimmed.
3. The text box turns red.
Customizing form controls
64. Test 3, question 3: Answer
The text box's appearance doesn't change in any way.
The appearance of the text box doesn't change; users just
can't type in it.
Customizing form controls
66. Add up numbers in a table
You don't have to be a math whiz to
work with numbers in InfoPath.
Learn how easy it is to use the sum
function to add up numbers in a
repeating table.
A running total in a
repeating table
Customizing form controls
67. Anatomy of a repeating table
When you want people to be able to
add multiple rows to a table, you
can use a repeating table in your
The repeating table in
form.
design mode Repeating tables are great for
collecting line items or numerical
data.
Customizing form controls
68. Anatomy of a repeating table
There are three parts to a repeating
table, as shown in the picture:
1. Header row
The repeating table in
design mode 2. Data row
3. Footer row
Customizing form controls
69. Anatomy of a repeating table
The header row: When you insert
a repeating table in a new blank
form, the header row appears by
The repeating table in
default.
design mode
Customizing form controls
70. Anatomy of a repeating table
The data row: The data row is the
meat of the table, the row that can
"repeat" in the form as many times
The repeating table in
as necessary.
design mode
Customizing form controls
71. Anatomy of a repeating table
The footer row: You can use the
footer row to add boxes that total
up the values in a column.
The repeating table in
design mode
Customizing form controls
72. Anatomy of a repeating table
1. The shortcut menu button
appears whenever form users
move their mouse over a row.
Users click it to see a shortcut
menu of commands for inserting
or removing a row.
The repeating table in
the user’s view 2. The user can also insert a new
row by clicking Insert item. As
the form designer, you can
customize or turn off this text.
Customizing form controls
73. The sum function
If you use a repeating table to
collect numerical data from your
users, you can use the sum function
to add up numbers in the table.
The sum function totals
the column’s values in a
repeating table.
Customizing form controls
74. The sum function
Important: When working with
repeating tables, you should add the
Total box to the footer row, not the
data row. That's because form users
can add multiple instances of the
data row, and you wouldn't want the
Total box to show up multiple times
in the user's form.
The sum function totals
the column’s values in a
repeating table.
Customizing form controls
75. Suggestions for practice
1. Add a footer row to a repeating table.
2. Add a Total box.
3. Do the math.
4. Test the user experience.
5. Format the footer row.
6. Make the Total box read-only.
Online practice (requires InfoPath 2003 Service Pack 1)
Customizing form controls
76. Test 4, question 1
The person filling out the form can add extra footer
rows to a repeating table. (Pick one answer.)
1. False.
2. True.
Customizing form controls
77. Test 4, question 1: Answer
False.
People completing a form can only add additional data rows —
that's the whole point of a repeating table.
Customizing form controls
78. Test 4, question 2
If you wanted to total numbers in a repeating
table, which of the following formulas would
yield a correct result? (Pick one answer.)
1. sum(field1)
2. =sum(field1)
3. sum(field1:field8)
Customizing form controls
79. Test 4, question 2: Answer
sum(field1)
This formula would add up all instances of field1 in a form.
Customizing form controls
80. Test 4, question 3
In design mode, which row doesn't appear by default
after you insert a repeating table? (Pick one answer.)
1. The data row.
2. The footer row.
3. The header row.
Customizing form controls
81. Test 4, question 3: Answer
The footer row.
If you want a footer row for your table, you have to select a
check box in the Repeating Table Properties dialog box.
Customizing form controls
82. Quick Reference Card
For a summary of the tasks covered in this course, view the
Quick Reference Card.
Customizing form controls