Automatically close a form by using a rule
When you design a form, you can create a rule that automatically closes a form when the user clicks a button.
You can add multiple actions for each rule. For example, you can automatically update a date field and then close a form.
- In design mode, double-click the button you want to create the rule for.
- In the Action box on the General tab, click Rules and Custom Code, and then click Rules.
- In the Rules dialog box, click Add.
- In the Name box in the Rule dialog box, type a name for the rule.
- To specify when the rule should run, click Set Condition, and then enter the condition. The rule will run when the button in step one is clicked and the condition specified in this step is met.
- Click Add Action.
- In the Action box in the Action dialog box, click Close the form.
- If you want to prompt the user to save their changes before the form closes, select the If changes have not been saved, prompt the user to save check box, and then click OK.
- If you want to prevent any rules from running after this rule (for the current event), select the Stop processing rules when this rule finishes check box in the Rule dialog box.
Note The information in this topic may not apply if you are working with a form designed using Microsoft Office InfoPath 2003 without the service pack installed. Learn more