Sei sulla pagina 1di 10

Ken Goldberg Database Lab Notes

Lab 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 atabase! "pen Northwind!mdb file as before from #elp menu!

1. Form
1.1 Introduction

1.2 Kinds and Purposes


Data entry orm$ %o enter data into a table !ustom dia"o# bo$$ %o accept user input and then carr& out an action based on that input S%itc&board$ %o open other forms or reports

Ken Goldberg Database Lab Notes

1.' In ormation in a Form

Ken Goldberg Database Lab Notes

1.4 Lin( bet%een a orm and its record

1.) !reatin# a orm


'ou can create a form on &our own or &ou can ha(e )icrosoft *ccess create &our form for &ou using a Form *i+ard! * Form +i,ard speeds up the process of creating a form because it does all the basic work for &ou! +hen &ou use a Form +i,ard- )icrosoft *ccess prompts &ou for information and creates a form based on &our answers! E(en if &ou.(e created man& forms- &ou ma& want to use a Form +i,ard to /uickl& la& out all the controls on &our form! %hen &ou can switch to esign (iew to customi,e &our form!

Ken Goldberg Database Lab Notes

Fi#. 1: *indo% in Form *i+ard ,-ption 1.

!reatin# a orm %it& a %i+ard


"ption 0$ 1. Choose Forms !reate orm by usin# %i+ard in database window- &ou will see Fi#. 1! 1! Click on the name of the /ab"e or 0uery that includes the data &ou want to base &our form on 2in the left column3 4! %hen choose the La&out that &ou want &our forms to follow! 'ou can experiment with !o"umnar- /abu"ar1 Datas&eet and 2usti ied to find the most suitable la&out for &ou! 5! Next- choose the St&le that &ou would like for &our Form! 6! 7i(e a title to &our Form! 'ou can now either go and open &our form or modif& the design in Desi#n 3ie%! 8! Click on Finis&.

Ken Goldberg Database Lab Notes

Fi#. 2: 4e% Form Dia"o# 5o$ ,-ption 2. "ption 1$ 1. Click menu Insert Form 1! * 4e% Form dialog box will pop up2Fi#. 23 and then choose Form *i+ard 4! Click on the name of the /ab"e or 0uery that includes the data &ou want to base &our form on 2click on the list at the bottom of the dialog box3 5! Follow steps 598 in "ption 0 4ote$ 0! In the dialog box shown in Fi#. 2- if &ou clicked an& of the three *utoform options- )icrosoft *ccess automaticall& creates &our form and uses the autoformat &ou last specified either in the Form +i,ard or b& using the *utoFormat command on the Format menu in esign (iew! 1! If the resulting form doesn.t look the wa& &ou want- &ou can *L+*'S change it in Desi#n 3ie%.

!reatin# a orm %it&out a %i+ard


1. Click menu Insert Form- then choose esign :iew in Fi#. 2! 1! Click the name of the table or /uer& that includes the data &ou want to base &our form on! If the form won.t contain data 2for example- if &ou want to create a form to use as a switchboard to open other forms or reports- or if &ou want to create a custom dialog box3- don.t select an&thing from this list! %hen click -K! 4ote: If &ou want to create a form that uses data from more than one table- base &our form on a /uer& that includes the tables &ou want to include! 4! +ith this option &ou can %"%*LL' customi,e and control e(er&thing &ou would like to ha(e and see in &our forms! Please refer to Fi#. '!

Ken Goldberg Database Lab Notes

Fi#. ' *ays to !ustomi+e a Form

1.6 7$amp"es: 8arious (inds o Forms in 4ort&%ind.mdb

2. Report
2.1 Introduction

Ken Goldberg Database Lab Notes

2.2 In ormation in a report

2.' Lin( bet%een a report and its record source

Ken Goldberg Database Lab Notes

2.4 !reatin# a report


'ou can create a report on &our own or &ou can ha(e )icrosoft *ccess create a report for &ou using a ;eport +i,ard! * ;eport +i,ard speeds up the process of creating a report because it does all the basic work for &ou! +hen &ou use a ;eport +i,ard- it prompts &ou for information and creates a report based on &our answers! E(en if &ou.(e created man& reports- &ou ma& want to use a ;eport +i,ard to /uickl& la& out &our report! %hen &ou can switch to esign (iew to customi,e it!

!reatin# a report usin# AutoReport


*uto;eport creates a report that displa&s ALL fields and records in the underl&ing table or /uer&! 1. Click menu Insert Report AutoReport! 'ou can choose columnar or tabular! ;efer to Fi#. '! *uto;eport$ Columnar! Each field appears on a separate line with a label to its left! *uto;eport$ %abular! %he fields in each record appear on one line- and the labels print once at the top of each page! 1! Click the /ab"e or 0uery that contains the data &ou want to base &our report on! Click -K then! 4ote: )icrosoft *ccess applies the last autoformat &ou used to the report! If &ou ha(en.t created a report with a wi,ard before or ha(en.t used the *utoFormat command on the Format menu- it uses the Standard autoformat!

Fi#. ': 4e% Report Dia"o# 5o$

Ken Goldberg Database Lab Notes

!reate a report %it& a %i+ard


Click menu Insert Report Report *i+ard or <ust choose Form !reate Report by 9sin# *i+ard in database window! 1! Click the table or /uer& that contains the data &ou want to base &our report on! Click -K then! 4ote )icrosoft *ccess uses this table or /uer& as the default record source for the report! #owe(er- &ou can change the record source in the wi,ard and select fields from other tables and /ueries! 4! Follow the instructions on the screen to format and output the report the wa& &ou want it 1. 4ote: If the resulting report doesn.t look the wa& &ou want- &ou can customi,e it in Desi#n 3ie% as shown in Fi#. 4!

Fi#. 4 *ays to !ustomi+e a Report

2.) 7$amp"e: Sa"es by !ate#ory Report in 4ort&%ind.mdb

Ken Goldberg Database Lab Notes ========================================================================= 'ou ha(e <ust created &our first form and report! Pla& around with the la&out and design option until &ou find one that &ou like! >se &our creati(it&?? =========================================================================

MS Access 0ui+ 4 0ui+ 4


2 ue at the start of next class3 >se the car.mdb &ou created from last /ui,! 0! Create a form that would allow the ealership to enter new (ehicles into its in(entor& 1! Create a form that would allow the ealership to track its customers 4! Create a report that would allow the ealership to (iew its current in(entor&- grouped b& :ehicleName 2:ehicleName assumes a particular model- and each :ehicleI identifies a uni/ue instance of the model! For example$ Corolla9I @0A5BCD6415#+D03!

Furt&er instructions:
For the /ui,- please pro(ide$ screenshots for *LL forms- and tr& to fit each form on a separate page printout of the report! %o do a screens&ot capture- open the window which &ou want to capture- maximi,e it 2or si,e it appropriatel&3 and the do A"t:Print Screen! %hen <ust do a Paste command in &our word processing software to import the image into &our document!

10

Potrebbero piacerti anche