9.1. Views Overview

InfoPath provides views (pages) to help you create forms that are organized in a way that makes sense for users, rather than just putting all the data on a single page.

You can see in Figure 9-1 where views have been created for Customer, Notes, and Order information, tied together with a custom task pane.

For the purpose of this chapter, one InfoPath form will be created from start to finish based on the database called Chapter 9.mdb. The tables called tblCustomers and tblOrders will be used.

Besides creating views to break up information, you can also create views based on secondary data sources, or special views made to print information for current views. These are discussed in the last section in this chapter.

Figure 9.1. Figure 9-1

9.1.1.

9.1.1.1. Try It Out: Creating the Default View

To get started with managing multiple views, you need to start with one view. To give you a feel for creating more than one view, you will specify the data as you would in real life.

  1. Open InfoPath.

  2. Click on Design a Form. The Design a Form task pane will appear.

  3. Click on New from Data Connection.... The Data Connection Wizard will start, with the first page asking if you would like to use a database or Web service.

  4. Click Next, specifying to use a database by default. The next page displays only one button, Select Database.

  5. Click the Select Database button. The Select Data Source dialog box will open.

  6. Locate and select the desired data source—in this case Chapter 9.mdb, as shown in Figure 9-2.

  7. Click Open. The Select Table dialog box will appear.

  8. Select tblCustomers, and then click OK. You will be taken back to the Data Connection Wizard.

  9. Choose Add Table, and use the Select Table dialog box to choose tblOrders. The Data Connection Wizard will now look as it does in Figure 9-3.

    Figure 9.2. Figure 9-2

    Figure 9.3. Figure 9-3
  10. Click Next. The final page of the Data Connection Wizard is displayed.

  11. Click Finish. The initial InfoPath form is created with the query and data areas on the default view of the form.

  12. Drag and drop the CustomerID field from the queryFields tree in the Data Source task pane into the area below the button labeled Run Query.

  13. Drag and drop the d:tblCustomers group from the dataFields tree in the Data Source task pane into the area below the button labeled New Record. The right-click list (list on the right) will appear displaying the section choices.

  14. Choose Repeating Section with Controls from the list displayed. The fields from both the tblCustomers and tblOrders tables are displayed on the form.

  15. Click the border of the section for the tblOrder fields, as shown in Figure 9-4.

    Figure 9.4. Figure 9-4
  16. Press Delete. The tblOrder fields will disappear.

  17. Delete the Notes label and field.

  18. Add the title Customer Information to the top of the form. You form will now look like the one in Figure 9-5.

    Figure 9.5. Figure 9-5

You can spruce up your form as you see fit. In Figure 9-5 extra spaces have been removed.

The default view has now been created. The next two views will be created in the section titled "Creating Multiple Views."

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.129.23.214