Validating Form Data


To ensure that the data collected on your form is useful, you can define various rules for each field. You can set default values, specify which fields are required, and display instructional messages under conditions you specify.

In this exercise, you will modify a Customer Request form to validate the data that is entered into it.

USE the CustRequest form in the practice file folder for this topic. This practice file is located in the  My Documents\Microsoft Press\Office 2003 SBS\Design folder and can also be accessed by clicking Start/All Programs/Microsoft Press/Microsoft Office System 2003 SBS .

  1. In the Fill Out a Form task pane, click Design a Form , and then click On My Computer .

    The Open in Design Mode dialog box opens.

  2. Browse to the  My Documents\Microsoft Press\Office 2003 SBS\Design folder, click CustRequest , and then click Open .

    InfoPath opens the Customer Product Request form in design mode.

  3. In the first row of the form, right-click the Date Picker control to the right of Date , and click Date Picker Properties on the shortcut menu.

    The Date Picker Properties dialog box appears.

    click to expand
    Tip  

    The properties of a form control include the name of the data field. You can edit the name in this dialog box.

  4. In the Validation area of the Data tab, select the Cannot be blank check box, and click OK .

  5. In the first row of the Follow Up area, right-click the Date Picker control, and click Date Picker Properties on the shortcut menu.

    The Date Picker Properties dialog box appears.

  6. In the Validation area of the Data tab, click the Data Validation button.

    The Data Validation dialog box appears.

  7. Click the Add button.

    click to expand
  8. In the If this condition is true area, in the second drop-down list, click is less than . Then in the third drop-down list, click Select a field or group .

    The Select a Field or Group dialog box appears, showing the list of fields used in the form. The first field, the date of the customer s request, is marked with a red asterisk, indicating that it is a required field.

  9. In the field list, click field1 , and then click OK .

    Your selection is added to the third drop-down list box, completing the condition statement.

    click to expand
  10. In the Error alert type box, click the down arrow and then click Dialog box alert (immediately show message) .

  11. In the ScreenTip box, type Invalid follow up date . Then in the Message box, type The follow up date must be later than the request date. Please check the date, and try again. , and click OK .

  12. Your rule is summarized in the Data Validation dialog box.

  13. Click OK twice to close both open dialog boxes, and then in the form, right-click the check box before Special Order , and click Check Box Properties on the shortcut menu.

  14. In the Default state area of the Data tab, select the Checked option.

  15. In the Validation area, click the Data Validation button, and in the Data Validation dialog box, click the Add button.

  16. In the If this condition is true area, in the third drop-down list, click FALSE .

  17. In the ScreenTip box, type Inventory item ”place hold! Then in the Message box, type The customer has requested an item that is normally stocked in inventory. When additional stock arrives, hold the appropriate number of items for customer! , and click OK .

    Your rule is summarized in the Data Validation dialog box.

  18. Click OK , and then click OK again.

    The Special Order check box is selected on the form.

  19. On the File menu, click Save As . Then in the Microsoft Office Infopath dialog box, click Save.

    The Save As dialog box appears.

  20. In the File name box, type CustomerRequest2 , and click Save .

  21. On the File menu, click Close .

  22. In the task pane, click Fill Out a Form , and then click On My Computer .

    The Open dialog box appears.

  23. Browse to the  My Documents\Microsoft Press\Office 2003 SBS\Design folder, click CustomerRequest2 , and then click Open .

    The Customer Product Request form appears.

  24. In the first Date box, type tomorrow s date, and press [TAB] four times.

  25. In the second Date box, type today s date, and press [TAB].

    A message box appears, containing the error message you specified. On the form behind the error message, the second Date field is surrounded by a red dotted line, indicating an error in the field.

    click to expand
  26. Click OK , and point to the field.

    The ScreenTip you specified appears.

  27. Clear the Special Order check box.

    The check box is surrounded by a red dotted line, and the ScreenTip you specified appears.

    click to expand
  28. Right-click the check box, and click Full error description on the shortcut menu.

    A message box appears, containing the error message you specified.

  29. Click OK .

  30. On the File menu, click Close , and when prompted to save the form, click Yes .

    A message box indicates that there are errors on the form and asks whether you still want to save it.

  31. Click Yes . Then in the Save as dialog box, browse to the  My Documents\Microsoft Press\Office 2003 SBS\Design folder, type CustReqError , and click Save .

    InfoPath saves and closes your form.

  32. In the task pane, click On My Computer . Then in the Open dialog box, click CustReqError , and then click Open .

    InfoPath opens the Customer Product Request form, indicating the errors on the check box and the second Date field.

    click to expand

CLOSE the Customer Product Request form.




Microsoft Office 2003 Step by Step
MicrosoftВ® Office ExcelВ® 2003 Step by Step (Step By Step (Microsoft))
ISBN: 0735615187
EAN: 2147483647
Year: 2005
Pages: 350
Authors: Curtis Frye

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net