Forms that use a database or web service as their primary data source can send data back to that source through the Submit action. You can call the Submit action by choosing File → Submit or by clicking a button on the form assigned to Submit.
Figure 7-29. Checkbox in this dialog determines whether the database is queried at form load
Figure 7-30. Adding a button to refresh lists
Before submitting, however, you should validate the data to make sure the entries are valid for constraints in the database (or web service). InfoPath can validate fields using a variety of criteria. Problems are flagged and must be fixed before continuing, as shown in Figure 7-31.
Figure 7-31. InfoPath flags validation errors and highlights required fields
How to do it
To add validation criteria to a control:
Display the control’s properties and click Data Validation. InfoPath displays the Data Validation dialog, as shown in Figure 7-32.
Click Add. InfoPath displays the dialog box for validation criteria. Enter a condition that results in a validation error. For example, the settings in Figure 7-33 make CustomerID a required field.
Click OK, then preview the form and test the validation. ...