

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
The steps to create forms involving subforms and queries using access database software in lab5. Students will learn the difference between forms and queries and practice creating forms based on tables and queries. The document also includes instructions for downloading the sample database and creating two new forms.
Typology: Lab Reports
1 / 2
This page cannot be seen from the preview
Don't miss anything!


Work for Lab5 on March 1, 2001 (Steps 8 and 13 below produce results as part of Assignment #3, due 3/08/01 in class): Objectives: To continue the use of form wizard to create forms involving subforms and queries, and to learn the difference between forms and queries. Detailed Steps (continued from Lab4): (1) Download the sample database file “lab2DB.mdb” (the same as that used in Lab2 and Lab3) from the web at http://www.cs.ucf.edu/courses/cgs2545-spr2001/lab/ ; save it on your own floppy or in the c:\temp directory of the PC in the lab. (Download and use the file “lab2DB97.mdb” for the work described here if your home computer uses Access 97 (part of Office 97).) (2) Start Access under MS Office, then open the downloaded sample database. (3) Choose “Forms” under the Object column (below “Tables” and “Queries”). Double- click on “create form by using wizard”. (4) (This step is a correction to Step 16 of Lab4) Select table lab2Orders and its field customerID, then select table lab2OrderDetails within the Tables/Queries box, and choose its fields productID, unitPrice, and quantity. Click “Next>”. (In Lab4’s description, the field orderID was incorrectly used instead of field unitPrice, which resulted in a form without subforms.) (5) You will find under the highlighted table lab2Orders, a “radio button” that says “form with subforms” has been selected. By highlighting the other table lab2OrderDetails, you find that the bottom of the screen says “single form”. All these are fine, simply click “Next>”. (6) The default tabular layout is fine, so click on “Next>”, accept the style, save the form file under the name lab5fm1, and the subform file under the name lab5subfm1, then finish the design. The system saves the form (and a subform), then the system opens the form. (7) By stepping through the records based on customerID of the lab2Orders table, there is a corresponding subform (i.e., a table with its own area and scroll bar inside the bigger form), showing all related fields of the records from the lab2OrderDetails table, which typically have multiple rows but may have zero rows sometimes. Step through and understand where the “matching” records and fields come form. (8) Write down the records (rows) within the subform for the first 10 customerID values. In each case, be sure to include the customerID value and the corresponding records in the subform. Be aware that sometimes a customerID has zero matching records in the subform area. (9) Close it afterwards. Now you should see two (not one) new form files, one is for the subform. (10) We now design another form using form wizard based on a previous query and a table. Repeat Step (3) given above to start the form wizard. (11) In the Tables/Queries box, locate the previous query lab4q2 (which I hope you had saved it from Lab4). Select its fields orderID and CountOfproductID. While still on this screen, locate the table lab2OrderDetails within the Tables/Queries box, select its field productID. Click on “Next>”. (12) On the choices of layouts, click on “Next>” to accept the default; also, click on “Next>” again to accept the default style. (13) Now you save the form file under the name lab5fm2; save the subform file under the name lab5subfm2. Click on “Finish”. The system waits a little then opens the form (and the subform. Step through the first 5 values of orderID; you will notice that the productIDs corresponding the selected orderID are displayed in the subform area. Write down the first 5 orderID and CountOfproductID values, and the corresponding rows in the subform area. One purpose of Steps (10) through here is to show queries can be treated as tables in designing forms. In fact, queries are very similar to tables even though the results (the contents) of
queries are never saved on the disk; instead, they are calculated each time the system opens (runs) a query. Note: As always, be sure you know the mechanics of using Access for the lab work, and understand how and what the system does based on your selections.