McGraw-Hill OnlineMcGraw-Hill Higher EducationLearning Center
Student Center | Instructor Center | Information Center | Home
Glossary
Data Files
Buzz in IT
Learning Objectives
Chapter Outline
Prerequisites
Multiple Choice Quiz
Short Answer
True or False
Case Problems
Hands-On Exercises
Feedback
Help Center


Advantage Series MS Office XP Access 2002
Advantage Series: Microsoft® Access 2002
Sarah Hutchinson-Clifford
Glen Coulthard

Designing Complex Forms, Reports, and Pages

Hands-On Exercises

Download as a Word document: Hands-On Exercise Ch09 (103.0K)

Whiz Kids P.C. Repair: Adding an AutoLookup to a Form

Eddie Rose, an enterprising young PC technician, has created a company that specializes in at-home PC repairs. Eddie has created a simple database to track customer orders. The database consists of three tables (tblCustomers, tblProducts, and tblOrders) and two forms (frmCustomers and frmProducts). In this exercise, Eddie will create a new form that will summarize orders to include all customer and product info. Assume the role of Eddie and perform the steps that he identifies.

  1. Download the AC09XTRA01 database file and save it to your personal storage location.
  2. Open the database and review its contents.
  3. Start by defining an AutoLookup query to use for the new form:
    CLICK: Queries button in the Objects bar
    DOUBLE-CLICK: Create query in Design view
    DOUBLE-CLICK: tblOrders in the Show Table dialog box
    DOUBLE-CLICK: tblCustomers in the Show Table dialog box
    CLICK: Close command button
  4. In the tblOrders field list:
    DOUBLE-CLICK: OrderID
    DOUBLE-CLICK: CustID
  5. In the tblCustomers field list:
    DOUBLE-CLICK: Last Name
    DOUBLE-CLICK: First Name
    DOUBLE-CLICK: Address
    DOUBLE-CLICK: City
    DOUBLE-CLICK: State
    DOUBLE-CLICK: Zip
    Your screen should now appear similar to figure 9.1.
  6. Figure 9.1

    Creating an AutoLookup query

    <a onClick="window.open('/olcweb/cgi/pluginpop.cgi?it=gif:: ::/sites/dl/free/0072470925/26861/ACh9_acq_Image1.gif','popWin', 'width=NaN,height=NaN,resizable,scrollbars');" href="#"><img valign="absmiddle" height="16" width="16" border="0" src="/olcweb/styles/shared/linkicons/image.gif"> (50.0K)</a>

  7. Save the query as "qryAutolookup" and then close the query Design window.
  8. You now use the query in creating a new form. Do the following:
    CLICK: Forms button in the Objects bar
    DOUBLE-CLICK: Create form by using wizard
  9. In the first step of the Form wizard:
    SELECT: "Query: qryAutolookup" in the Tables/Queries drop-down list box (which should already be displayed)
    CLICK: Include All button (<a onClick="window.open('/olcweb/cgi/pluginpop.cgi?it=gif:: ::/sites/dl/free/0072470925/26861/ACh9_acq_Image2.gif','popWin', 'width=NaN,height=NaN,resizable,scrollbars');" href="#"><img valign="absmiddle" height="16" width="16" border="0" src="/olcweb/styles/shared/linkicons/image.gif"> (50.0K)</a> )
    CLICK: <a onClick="window.open('/olcweb/cgi/pluginpop.cgi?it=gif:: ::/sites/dl/free/0072470925/26861/ACh9_acq_Image3.gif','popWin', 'width=NaN,height=NaN,resizable,scrollbars');" href="#"><img valign="absmiddle" height="16" width="16" border="0" src="/olcweb/styles/shared/linkicons/image.gif"> (1.0K)</a>
  10. In the second step of the wizard:
    SELECT: "by tblOrders" in the How do you want to view your data list box
    CLICK: <a onClick="window.open('/olcweb/cgi/pluginpop.cgi?it=gif:: ::/sites/dl/free/0072470925/26861/ACh9_acq_Image3.gif','popWin', 'width=NaN,height=NaN,resizable,scrollbars');" href="#"><img valign="absmiddle" height="16" width="16" border="0" src="/olcweb/styles/shared/linkicons/image.gif"> (1.0K)</a>
  11. For the remaining steps:
    SELECT: Columnar option button
    CLICK: <a onClick="window.open('/olcweb/cgi/pluginpop.cgi?it=gif:: ::/sites/dl/free/0072470925/26861/ACh9_acq_Image3.gif','popWin', 'width=NaN,height=NaN,resizable,scrollbars');" href="#"><img valign="absmiddle" height="16" width="16" border="0" src="/olcweb/styles/shared/linkicons/image.gif"> (1.0K)</a>
    SELECT: Standard
    CLICK: <a onClick="window.open('/olcweb/cgi/pluginpop.cgi?it=gif:: ::/sites/dl/free/0072470925/26861/ACh9_acq_Image3.gif','popWin', 'width=NaN,height=NaN,resizable,scrollbars');" href="#"><img valign="absmiddle" height="16" width="16" border="0" src="/olcweb/styles/shared/linkicons/image.gif"> (1.0K)</a>
  12. In the final step of the wizard:
    TYPE: frmAutoLookup
    SELECT: Open the form to view or enter information option button
    CLICK: <a onClick="window.open('/olcweb/cgi/pluginpop.cgi?it=gif:: ::/sites/dl/free/0072470925/26861/ACh9_acq_Image4.gif','popWin', 'width=NaN,height=NaN,resizable,scrollbars');" href="#"><img valign="absmiddle" height="16" width="16" border="0" src="/olcweb/styles/shared/linkicons/image.gif"> (50.0K)</a>
    The Form window should appear as shown in Figure 9.2.
  13. Figure 9.2

    tblOrders Form

    <a onClick="window.open('/olcweb/cgi/pluginpop.cgi?it=gif:: ::/sites/dl/free/0072470925/26861/ACh9_acq_Image5.gif','popWin', 'width=NaN,height=NaN,resizable,scrollbars');" href="#"><img valign="absmiddle" height="16" width="16" border="0" src="/olcweb/styles/shared/linkicons/image.gif"> (5.0K)</a>

  14. On your own, browse through the records in the form using the navigation controls. When the value stored in the CustID text box changes, notice that the address information also changes.
  15. Now let’s change the CustID in the first record:
    DOUBLE-CLICK: CustID text box to select its contents
    TYPE: 2
  16. Because the form is based on a query, the contents of the related fields will be updated on the form when the insertion point leaves the foreign key field’s text box control. To demonstrate:
    PRESS: Tab key
    Notice that the address information changes
  17. PRESS: Esc key to return the CustID value to 3
  18. Close the Form window.
  19. Close the database.


Nikita’s Catering: Adding a Combo fox to a Form

Nikki Garvey is just getting started in the catering business and has created and Access database to help her keep track of booked functions. She has gotten a few complaints that her entry form is hard to use because it involves entering codes for the function type and sales rep. Nikki has decided to add combo boxes to the form to make it easier to use. Assume the role of Nikki and perform the steps that she identifies.

  1. Download the AC09XTRA02 database file and save it to your personal storage location.
  2. Open the frmFunctionInfo form in Design view. Your screen should appear similar to Figure 9.3.
  3.  

    Figure 9.3

    frmFunctionInfo

    form

    <a onClick="window.open('/olcweb/cgi/pluginpop.cgi?it=gif:: ::/sites/dl/free/0072470925/26861/ACh9_acq_Image8.gif','popWin', 'width=NaN,height=NaN,resizable,scrollbars');" href="#"><img valign="absmiddle" height="16" width="16" border="0" src="/olcweb/styles/shared/linkicons/image.gif"> (25.0K)</a>

  4. You will now change the functionTypeID and salesContactID text box controls to combo boxes. To begin:
    CLICK: Select Objects button (<a onClick="window.open('/olcweb/cgi/pluginpop.cgi?it=gif:: ::/sites/dl/free/0072470925/26861/ACh9_acq_Image9.gif','popWin', 'width=NaN,height=NaN,resizable,scrollbars');" href="#"><img valign="absmiddle" height="16" width="16" border="0" src="/olcweb/styles/shared/linkicons/image.gif"> (50.0K)</a> )in the Toolbox
  5. In the form Design window:
    RIGHT-CLICK: functionTypeID text box control
    CHOOSE: Change To, Combo Box from the shortcut menu
    The functionTypeID control changes shape to include a drop-down arrow.
  6. You must now define the contents of the combo box:
    RIGHT-CLICK: functionTypeID combo box control
    CHOOSE: Properties
  7. In the Properties window:
    CLICK: Data tab
    CLICK: in the Row Source text box
    CLICK: down arrow attached to the property text box
    SELECT: tblFunctionLookup
  8. In order to display the function description, you must specify the first two columns of the tblFunctionLookup table. To begin:
    CLICK: Format tab
    DOUBLE-CLICK: in the Column Count text box
    TYPE: 2
  9. You can now specify the width of each column in the combo box control, separated by semicolons. The "0" for the first width indicates that we don’t want that column to show.
    CLICK: in the Column Widths text box
    TYPE: 0";2"
    ( Hint: If you leave out the quotation mark or leading zero that appears before a decimal, Access completes the entry for you.
  10. To test the column widths for the combo box, close the Properties window and then display the form:
    CLICK: View — Form button (<a onClick="window.open('/olcweb/cgi/pluginpop.cgi?it=gif:: ::/sites/dl/free/0072470925/26861/ACh9_acq_Image10.gif','popWin', 'width=NaN,height=NaN,resizable,scrollbars');" href="#"><img valign="absmiddle" height="16" width="16" border="0" src="/olcweb/styles/shared/linkicons/image.gif"> (50.0K)</a> )
    Notice that the functionTypeID combo box displays the function rather than an ID number.
  11. Now, return to the design view. On your own, change the salesContactID into a combo box that refers to the tblSalesContactLookup.table. You finished form should resemble the one shown in figure 9.4.
  12. Figure 9.4

    frmFunctionInfo form

    <a onClick="window.open('/olcweb/cgi/pluginpop.cgi?it=gif:: ::/sites/dl/free/0072470925/26861/ACh9_acq_Image11.gif','popWin', 'width=NaN,height=NaN,resizable,scrollbars');" href="#"><img valign="absmiddle" height="16" width="16" border="0" src="/olcweb/styles/shared/linkicons/image.gif"> (50.0K)</a>

  13. Close the database.


Waxing Nostalgic Records: Using the Access Snapshot Viewer

Al Lincoln, the owner of Waxing Nostalgic Records, uses Access to keep track of orders made via the Internet. He shares this information with his accountant, his wife Karen, who does not use Access. In the exercise, Al uses the Access Snapshot functions to create a graphic of the day’s orders.

  1. Download the AC09XTRA03 database file and save it in your personal storage location.
  2. Open the AC09XTRA03 database.
  3. In the Reports list area of the Database window:
    SELECT: rptOrders in the list area
    CHOOSE: File, Export
  4. In the Export Report dialog box, navigate to your student data folder and then:
    TYPE: Orders in the File name text box
    SELECT: Snapshot Format in the Save as type drop-down list box
    ( Note: A snapshot file ends with the extension .snp.)
  5. Make sure that the Autostart check box is selected and then:
    CLICK: Export command button
    Once you click the Save command button, the Snapshot Viewer program automatically starts and displays a preview of the report. ( Note: This process may take up to one minute on slower computers.)
  6. The Snapshot Viewer offers many of the same features as the Print Preview window in Access. On your own, zoom in and out on the report, as shown in Figure 9.5.
  7. Figure 9.5

    Snapshot Viewer window

    <a onClick="window.open('/olcweb/cgi/pluginpop.cgi?it=gif:: ::/sites/dl/free/0072470925/26861/ACh9_acq_Image12.gif','popWin', 'width=NaN,height=NaN,resizable,scrollbars');" href="#"><img valign="absmiddle" height="16" width="16" border="0" src="/olcweb/styles/shared/linkicons/image.gif"> (14.0K)</a>

  8. Close the Snapshot Viewer and the database file.

Data Files: Hands-On Exercises Data Files Ch09 (143.0K)





McGraw-Hill/Irwin