lab4 msa forms reports

Upload: zamzety

Post on 08-Apr-2018

229 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/6/2019 Lab4 MSA Forms Reports

    1/9

    Ken Goldberg Database Lab Notes

    TLab 4 Introduction to MS Access Forms and Reports

    Summary Forms:

    o Introduction

    o Kinds and Purposes

    o Information in a Form

    o Link between a form and its record

    o Creating a form

    o Example

    Reports:o Introduction

    o Information in a report

    o Link between a report and its record

    o Creating a report

    o Example

    In this session we will again use Northwind Sample Database. Open Northwind 2007.accdb file

    as before.

    1. FormIntroduction

    1.2 Kinds and Purposes

    Data entry form: To enter data into a table

    Custom dialog box: To accept user input and then carry out an action based on thatinput

    Switchboard: To open other forms or reports

    1

  • 8/6/2019 Lab4 MSA Forms Reports

    2/9

    Ken Goldberg Database Lab Notes

    1.3 Information in a Form

    2

  • 8/6/2019 Lab4 MSA Forms Reports

    3/9

    Ken Goldberg Database Lab Notes

    1.4 Link between a form and its record

    1.5 Creating a formYou can create a form on your own or you can have Microsoft Access create your form for youusing a Form Wizard. A Form Wizard speeds up the process of creating a form because it doesall the basic work for you. When you use a Form Wizard, Microsoft Access prompts you forinformation and creates a form based on your answers. Even if you've created many forms, youmay want to use a Form Wizard to quickly lay out all the controls on your form. Then you canswitch to Design view to customize your form.

    3

  • 8/6/2019 Lab4 MSA Forms Reports

    4/9

    Ken Goldberg Database Lab Notes

    Fig. 1: Window in Form Wizard

    Creating a form with a wizard

    1. Choose CreateMoreFormsForm Wizard on the Ribbon, you will see Fig.1.

    2. Click on the name of the Table orQuery that includes the data you want to base your formon (in the left column)

    3. Then choose the Layout that you want your forms to follow. You can experiment withColumnar, Tabular, Datasheet and Justified to find the most suitable layout for you.

    4. Next, choose the Style that you would like for your Form.

    5. Give a title to your Form. You can now either go and open your form or modify the design inDesign view.

    6. Click on Finish.

    Fig. 2: Create a New Form Using Design View

    Creating a form without a wizard

    1. Click the name of the table or query that includes the data you want to base your form on. Ifthe form doesnt contain data (for example, if you want to create a form to use as aswitchboard to open other forms or reports, or if you want to create a custom dialog box),don't select anything from this list.Note: If you want to create a form that uses data from more than one table, base your formon a query that includes the tables you want to include.

    2. On the Ribbon, click CreateForm Design. Please refer to Fig. 2.

    3. With this option you can TOTALLY customize and control everything you would like to haveand see in your forms. Please refer to Fig.3.

    4

  • 8/6/2019 Lab4 MSA Forms Reports

    5/9

    Ken Goldberg Database Lab Notes

    Fig. 3 Ways to Customize a Form

    1.6 Examples: Various kinds of Forms in Northwind.mdb

    2. ReportIntroduction

    5

  • 8/6/2019 Lab4 MSA Forms Reports

    6/9

    Ken Goldberg Database Lab Notes

    Information in a report

    2.3 Link between a report and its record source

    6

  • 8/6/2019 Lab4 MSA Forms Reports

    7/9

    Ken Goldberg Database Lab Notes

    2.4 Creating a reportYou can create a report on your own or you can have Microsoft Access create a report for youusing a Report Wizard. A Report Wizard speeds up the process of creating a report because itdoes all the basic work for you. When you use a Report Wizard, it prompts you for informationand creates a report based on your answers. Even if you've created many reports, you may wantto use a Report Wizard to quickly lay out your report. Then you can switch to Design view tocustomize it.

    Creating a report with a wizard

    1. On the Ribbon, click Create Report Wizard. You can choose columnar or tabular on thepop-up window. Refer to Fig.4.

    2. Click the Table or Query that contains the data you want to base your report on.Note Microsoft Access uses this table or query as the default record source for the report.However, you can change the record source in the wizard and select fields from othertables/queries.Click Next andfollow the instructions on the screen step by step.

    3. Choose layout and style for the new report.

    4. Enter the name for the new report and click Finish.

    7

  • 8/6/2019 Lab4 MSA Forms Reports

    8/9

    Ken Goldberg Database Lab Notes

    Fig. 4: New Report Dialog Box

    Note: If the resulting report doesn't look the way you want, you can customize it in Design viewas shown in Fig.5.

    Fig. 5 Ways to Customize a Report

    2.5 Example: Customer Phone Book Report in Northwind 2007.accdb

    8

  • 8/6/2019 Lab4 MSA Forms Reports

    9/9

    Ken Goldberg Database Lab Notes

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~You have just created your first form and report. Play around with the layout and design optionuntil you find one that you like. Use your creativity!!~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    MS Access Quiz 4Quiz 4

    (Due at the start of next class)Use the car.mdb you created from last quiz.

    1. Create a form that would allow the Dealership to enter new vehicles into its inventory2. Create a form that would allow the Dealership to track its customers

    3. Create a report that would allow the Dealership to view its current inventory, grouped byVehicleName (VehicleName assumes a particular model, and each VehicleID identifies aunique instance of the model. For example: Corolla-ID#1Z49J05324HW01).

    Further instructions:For the quiz, please provide:

    screenshots for ALL forms, and try to fit each form on a separate page

    printout of the report.

    To do a screenshot capture, open the window which you want to capture, maximize it (or size itappropriately) and the do Alt+Print Screen. Then just do a Paste command in your wordprocessing software to import the image into your document.

    9