+ All Categories
Home > Documents > Access 2010 Reports

Access 2010 Reports

Date post: 06-Apr-2018
Category:
Upload: om
View: 222 times
Download: 0 times
Share this document with a friend

of 23

Transcript
  • 8/2/2019 Access 2010 Reports

    1/23

    Copyright 2009 West Virginia University

    Access 2010 Reports

    Application Support and TrainingOffice of Information Technology, West Virginia University

    OIT Help Desk (304) 293-4444

    oit.wvu.edu/training/classmat/db/

    Last revised: January 24, 2011

  • 8/2/2019 Access 2010 Reports

    2/23

    ii

    Table of Contents

    Course Description ............................................................................................. 3Background ......................................................................................................... 4

    What's the big deal about reports? .................................................................. 4Report Views ................................................................................................... 4Report View:What your users will see in the finished product. ....................... 4Print Preview:How the report will look when printed. ...................................... 4Layout View:For changing the layout of any and all parts of the report. ......... 4Design View:lower level view of your report.Creating Reports ....................... 4

    Opening an Access Database ............................................................................ 6Creating Reports ................................................................................................. 6

    A Basic Report ................................................................................................. 6Activity 1: Creating a Basic Report from Existing Data ................................................... 6

    Report Anatomy 101 ........................................................................................ 7Activity 2: Using Layout View to Modify the Appearance of a Simple Report .................. 8

    Creating a Report using the Report Wizard ..................................................... 8Activity 3: Interactive Report Wizard ................................................................................ 8

    Modifying a Reports Appearance ................................................................... 11Working with Controls ...................................................................................... 13

    Control Properties .......................................................................................... 13Changing the Appearance or Location of Controls ........................................ 13Sections ......................................................................................................... 14

    Activity 4: Create a Cover Page ..................................................................................... 15Activity 5: Adding Values across a Group ...................................................................... 17Activity 6: Using Design View to Modify the Basic Appearance of a Report ................. 17Activity 7: Adding a Little Control of Your Own ............................................................. 18

    Mailing Labels ................................................................................................... 20Activity 8: Create mailing Labels .................................................................................... 20

    Apply Conditional Formatting to a Report Control ........................................ 21Activity 9: Apply Conditional Formatting ........................................................................ 21

  • 8/2/2019 Access 2010 Reports

    3/23

    Access Reports 3

    Course Description

    The purpose of this workshop is to introduce you to reports. Designing reports can be timeconsuming and requires patience. The basics we cover in this workshop will give you a foundationto experiment and perform more and more complex tasks with reports.

    Our goal is to assist you to learn the software, understand some basic concepts, and show yousome tips and techniques so you can develop your database management skills over time.

    The Microsoft Access series includes five sequential workshops:

    Introduction to Access

    Access Database Design

    Access Queries

    Access Forms

    Access Reports

  • 8/2/2019 Access 2010 Reports

    4/23

    4 Access Reports

    Background

    What's the big deal about reports?A report is an effective way to present your data. Because you have control over the size andappearance of everything on a report, you can display the information the way you want to see it.

    You can create reports that will: Organize and present data in groups

    Calculate running totals, group totals, grand totals, and percentages

    Include subforms, subreports, and graphs

    Create mailing labels

    Combine data from multiple tables and/or queries

    Present the data in an attractive format with fonts, lines, and pictures

    Report ViewsYou will switch between four different 'views' while examining and creating reports. You may haveused these views in your other workshops:

    Report View:What your users will see in the finished product.

    Print Preview:How the report will look when printed.

    Layout View:For changing the layout of any and all parts of the report.

    Design View:lower level view of your report.

  • 8/2/2019 Access 2010 Reports

    5/23

    Access Reports 5

    Creating ReportsThere are five ways to create reports in Access 2010. We will look at each of these methods.

    1. Create a basic report from existing data

    Under the Create tab in the Reports section, click on the Report command to make a basicreport:

    2. Create a report with design options

    Under the Create tab in the Reports section, click on Report Design to start your report inDesign mode:

    3. Create a blank report from scratch

    Under the Create tab in the Reports section, click on Blank Report to make an empty

    report:4. Create a report using the Wizard

    Under the Create tab in the Reports section, click on Report Wizard to have Access guideyou:

    5. Create Labels

    Labels are a kind of report, which is why you'll find instructions for generating them in thissection. Under the Create tab in the Reports section, click on Labels to begin:

  • 8/2/2019 Access 2010 Reports

    6/23

    6 Access Reports

    Opening an Access Database

    1. Open Access 2010.

    2. In the File ribbon, click the Openicon to bring up the Open dialog box.

    3. In the Open dialog box, navigate to the location on your computer where the

    Faculty.accdbfile resides (your instructor will tell you where to look).4. Select the Faculty.accdb file and click on the Opencommand button that is on the lower-

    right of the dialog box.

    5. A Database window, similar to the one below, should appear.

    Creating Reports

    A Basic ReportAs explained earlier, you can click on the Report command to make a basic report: Because of itsminimalist nature, this type of report works best with simple data that does not have a lot of fields.

    Activity 1: Creating a Basic Report from Existing Data

    Using the Report command, you can create a basic report from existing data, which can be basedupon a table, a query, or even a simple form.

    1. In the Navigation pane for the Faculty database, locate and run the query namedSimplyClasses.

    2. With the query object SimplyClasses still selected,

    a. Click on the Create tab

    b. Locate the Reports group

    c. In the Reports group, click on the Report command.

    d. A Report, titled SimplyClasses, appears in Layout View.

    Notice that a basic report that is generated this way looks very similar to the datasheet view of theoriginal query (or table). It is essentially What-You-See Is-What-You-Get.

    Notice also, that a dashed line running down the right side of the page shows you where the rightmargin will appear on the printed report.

    From the Views group of the Design sub-tab, you can click on the View command and select Print

    Preview to confirm this.

  • 8/2/2019 Access 2010 Reports

    7/23

    Access Reports 7

    Report Anatomy 101

    Report Header

    This is the header for the entire report. It appears at the beginning of the report. It usuallyincludes the report name, the date, and the page number. It can also include a title page.

    Page Header

    This header appears at the top of each page. This typically contains column headers forthe data fields.

    Group Header

    Reports can be subdivided into one or more grouping levels in which data is presented.For example, a faculty directory listing could be grouped by department.

    Detail Section

    Used to display values for each record, and it can also contain calculated fields. It appearsafter each section header.

    Group Footer

    This is the ending unit for a grouping level. It can typically include aggregate statistics.

  • 8/2/2019 Access 2010 Reports

    8/23

    8 Access Reports

    Page Footer

    This is the ending section to a page header. It typically includes a page number/pagecount.

    Report Footer

    This is the ending section for an entire report, hence it can include summary statistics.

    Activity 2: Using Layout View to Modify the Appearance of a Simple Report

    You can use Layout View to resize or even delete data columns so that your report can fit on apage.

    1. Click over the first data header, CourseNum, to select it, and then click again to position thecursor in editing mode. This is a caption that you can edit: change CourseNum to CRN.

    2. In the Tools group of the Design sub-tab, click on the Property Sheet command. In theFormat tab of the Property Sheet, note that Caption (it should be the first property type) forthat data label says CRN.

    3. Click over the SectionNum data header, and edit it to be Section by using either thetechnique above or by editing the Caption property in the Property Sheet. In similar

    fashion, change:a. CTitle Course Title

    b. ClassDays Days

    c. ClassTime Time

    d. RoomNum Room

    4. You can resize the column headers by positioning the pointer over a left or right boundaryuntil a sizing arrow becomes visible. When you see the sizing arrow, left-click on themouse and drag the column boundary left or right to resize it. You want to resize CRN,Section, Course Title, Days, and Time so that the columns beneath them are as small as

    possible without causing line wrap. Tip: when resizing a column, watch out for the width ofthe contents. Some of the entries in the Days column, for example, contain Arranged. Ifthe cell is smaller than Arranged then word wrap will cause the column height to change.

    5. In this report, the Instructor appears as only a number. Lets just delete it from this report.Right-click the mouse over the Instructor label and select Delete Column from the shortcutmenu.

    6. By now, youll see that youve narrowed this report so that it can fit comfortably within themargins of a single page.

    Creating a Report using the Report WizardYou can create a basic report by using the Report Wizard. The wizard is an improvement overthe basic report because it allows you to create more complex reports, which can be based uponmultiple tables. It also allows you to create grouping levels and sorts for your data.

    Activity 3: Interactive Report Wizard

    In the SimplyClasses report that we created in the previous activity, we left out the FacultyID fieldbecause it was just a number. The Report Wizard lets us combine tables, so lets try to create aClasses report that makes use of the instructors name. We can do this because a relationshipexists between the Faculty and Classes tables:

  • 8/2/2019 Access 2010 Reports

    9/23

    Access Reports 9

    Let's begin by generating a report with existing data using the Report Wizard.

    1. Click on the Create tab.

    2. In the Reports Group, locate and click on the Report Wizard button. You will get a dialogbox.

    3. Choose the Table or Query to base the report on. In this example, choose the Tablenamed Faculty.

    4. Choose the Fields to include in the report. Use the > and < buttons to select and removefields. Note that you can also double click over an available field to select it.

    Select these fields:

    Last Name First Name

    Department

    5. Go back up to the Tables/Queries selector and choose the Classes table. Select thesefields:

    CourseNum

    SectionNum

    CTitle

    ClassDays

    ClassTime

    6. Click on the Next> button.

    7. The next panel of the Report Wizard asks how you want to view your data based upon oneof the tables youve used. Select by Faculty. What this will do is organize the report withclass information subordinate to faculty. If we organized it by Classes, an individual facultywould be listed at each class record.

    8. Click on the Next> button.

  • 8/2/2019 Access 2010 Reports

    10/23

    10 Access Reports

    9. The next panel asks if you want any grouping levels. Choose a field to serve as aGrouping Level. Use Department.

    10. Click on Next>.

    11. The next panel allows you to choose one to four sort fields. Select CTitle so that coursetitles will be in alphabetic order.

    12. Click on Next>.

    13. Choose the orientation and layout: Stepped, Block, Outline. When you click on thedifferent Layout radio buttons, you will see a preview of each layout. Use the Steppedlayout and choose the Landscape Orientation. Our report is showing a lot of fields so itssafer to start with Landscape Orientation; if necessary, we can always switch to Portrait

    after viewing and cleaning up the report. A checkbox, Adjust the field width so all fields finon a page, should be check by default. Leave it checked.

    14. Click on Next>.

    15. Supply a title for the report you can call it Classes by Department.

    16. Make sure that the radio button Preview the report is selected, and click on Finish.

    17. Preview the report (Note: the view below was created in Blocked layout)

    18. Note that your report is initially displayed in Print View. Take a moment to look over thereport in Print View. Note that you may see field headers truncated at the top, or you mightsee field data displayed as ###. Notice that even though we had specified that ClassTimebe included in our report, it is missing -- even though we had checked the option Adjustthe field width so all fields fin on a page!

    19. Click on the Close Print Preview command, which is at the far right of the Print Previewtab.

  • 8/2/2019 Access 2010 Reports

    11/23

    Access Reports 11

    20. When you close Print Preview, Access will drop you into Report Design View.

    Theres no sign of the ClassTime field here, either. But there is a clue (see the circle in theupper-left).

    21. In the next section, well learn about modifying a reports appearance by using DesignView. Close this report by clicking on the Close command (shown as a large X), which is atthe right of your window tabs.

    Modifying a Reports Appearance

    In addition to letting you design a report from scratch, Design View is also useful for changingthe layout and appearance after the report is initially created.

    To modify an existing report:

    1. Click on the Reports object.

    2. Open the report.

  • 8/2/2019 Access 2010 Reports

    12/23

    12 Access Reports

    3. Under the Home tab, change the view to Design View

    4. You will see something like:

    5. Use tools and modify properties as detailed on the following pages to edit the controls and thereport design.

  • 8/2/2019 Access 2010 Reports

    13/23

    Access Reports 13

    Working with Controls

    You can use various objects called controls, with which you can enhance a report. To access thecontrols, see the Controls group of the Report Design Tools Design sub-tab.

    As you can see, there are many controls. Position your pointer over a control to see the screentip for it. In this tutorial, well explore only a few of the controls:

    Textboxes

    Textboxes are used when you want to insert into a report data that is pulled from a table orquery or that is calculated with a function. Click on the textbox tool and then draw the textbox on the report in the desired location. A label is automatically inserted with each textbox.

    Labels

    Labels can be used to put into a report such things as titles, headings, and other

    information that doesnt come from the database. Click on the label tool and then draw thelabel box on the report in the desired location.

    Insert Page Break

    Start the next page at the current position.

    Image

    Insert an image from a file or folder.

    Control PropertiesA controlis any element of a report or form, including text, data values, and graphical elements.You can view all of the options for a control or a section within the properties window in any of thefollowing ways:

    Select the control by left-clicking on it, and then click on the Property Sheet button on theReport Design toolbar.

    Select the control and then press Alt-Enter on the keyboard.

    Right-click on the control and then select Properties from the pop-up menu.

    Changing the Appearance or Location of Controls

    Cut, Copy, and Paste:These functions work the same as they do in other Microsoft software.

    Move:

    Controls on a report can be moved by selecting the control anddragging it to the new location. If a control is already selected, you canmove the control when the cursor changes to a hand.

    Re-Size:

    Controls on a report can be resized by selecting the control and thenpositioning the cursor over one of the black boxes surrounding the

  • 8/2/2019 Access 2010 Reports

    14/23

    14 Access Reports

    control. Once you have a double arrow, click and drag to change the size.

    Colors:

    The foreground and background color of each control can be changed as follows:

    1. Click on the control to select it

    2. Right click and select Font/Fore Color orFill/Back Color

    3. Choose one of the colors displayed

    or

    1. Click on the control to select it

    2. Open the Properties window

    3. Click on the Format Tab

    4. Click in the text box forBack Color orFore Color

    5. Click on the ellipsis ()

    6. Choose a color from here or click on Define Custom Color and define your own

    7. Click on OK

    Formatting multiple controls at once:

    You can select a set of several controls and apply format changes to all of the selectedcontrols simultaneously, as follows:

    1. Click on the first control

    2. Hold down the Shift key on the keyboard

    3. Click on all other controls that you wish to change

    4. Make the change, using the Properties window or report design tools.Change(s) will be applied to all selected controls.

    SectionsHeaders and Footers

    The headers and footers for each section can be turned on and off. Report and pageheaders and footers are displayed or hidden together, but section headers and footers canbe turned on and off individually.

    To change the section headers and footers:

    1. Right Right click on the small square just to the left of the ruler

    near the top of the report window and choose Sorting andGrouping from the pop-up menu

    2. Change the Yes/No option forGroup Header and Group Footer for each item inthe list to the value you want for that group

    For the report header and footer choose View | Report Header/Footer or View | PageHeader/Footer.

    You can also get to the Sorting and Grouping window by right-clicking on the gray bandpreceding any section of the report and selecting Sorting and Grouping from the pop-upmenu.

  • 8/2/2019 Access 2010 Reports

    15/23

    Access Reports 15

    Re-Sizing

    Report sections can be resized by moving the mouse cursor to the lower border of the

    section. When the cursor changes to a double-headed arrow ( ), you can left click anddrag to move the lower border up or down.

    Inserting Images

    Images can be inserted into any report section. Most image formats are acceptable.

    1. Click on the Image tool in the Toolbox toolbar

    2. Click and drag to create a box in the report where you want the image to be placed.

    3. Browse to the image that you want to insert

    4. Click on OK

    5. Resize the image area to fit the image

    To keep images in proportion change the size mode to Zoom in the Properties windowfor the image.

    Lines/Shapes

    Lines and shapes can also be inserted into any report section. Lines are commonly used toseparate data and shapes are generally used to provide borders for groups of data orsections within the report.

    To insert a straight line:

    1. Click on the Line tool in the Toolbox toolbar.

    2. Click in the report at one end of the lines intended position and drag to theposition of the other end of the line. To ensure the creation of a horizontal line, hold theShift key down while you draw the line.

    Page Break

    Page breaks can be inserted to force the data to fall on separate pages.1. Click on the Page Break tool, which is in the Controls group of the Design

    sub-tab.

    2. Click the spot where you want the page break to be placed.

    Activity 4: Create a Cover Page

    The report that we create in this activity, FacultyDeptSalary, will also be used in theActivity 5:Adding Values across a Group.

    1. Click on the Create tab.

    2. In the Reports Group, locate and click on the Report Wizard button. You will get adialog box.

    3. Choose the Table or Query to base the report on. In this example, choose the Tablenamed Faculty.

    4. Choose the Fields to include in the report. Use the > and < buttons to select andremove fields. Note that you can also double click over an available field to select it.

  • 8/2/2019 Access 2010 Reports

    16/23

    16 Access Reports

    Select these fields:

    Last Name

    First Name

    Department

    Salary

    5. Click on Next>.

    6. In the wizard panel for grouping, select Department.

    7. Click on Next>

    8. In the wizard panel for sorting, add sorts forLast Name and First Name.

    9. Click on Next>

    10. In the wizard panel for layout, select the Stepped layout (default) and Portrait orientation(also the default). Make sure the Adjust field width checkbox is also checked (default).

    11. Click on Next>

    12. In the wizard panel for naming your report, name it FacultyDeptSalary.

    13. Click on Finish.

    14. After previewing the report in Print Open it in Design View.

    15. Increase the size of the report header section by moving the Page Header downbeyond the 2-inch mark on the vertical ruler on the left.

    16. Insert a page break at the 2-inch mark, near the bottom of the report header.

    17. Preview the results in Print Preview and observe that the page break worked. However,if your report header section has a background color or image, then your title page willonly have a background color or image down to just the first two inches. Close the PrintPreview, and we can fix this feature in design view.

    18. Make sure that the page-break control is selected. Open the Property Sheet if it is notalready open. The selection type in the property sheet should reflect that you have apage break selected. On the format tab of the Page Break property, change the Top

    property value to 11 (eleven inches) and hit the Enter key. Now your title page extendsall the way to the bottom of letter-size paper.

    19. Using the appropriate control on the Design sub-tab, Insert a picture into the reportheader section. You can find images in the images folder under OIT_Workshops.

    20. Change the size of the image.

    21. Change the text of the title of the report, spelling out Faculty by Department & Salary.

    22. Change the background and foreground color of the title.

    23. Change the font size and color of the title.

  • 8/2/2019 Access 2010 Reports

    17/23

    Access Reports 17

    24. Move the title label to another location within the section.

    25. Switch to Print Preview to view the changes, and save these changes to your reportwhen you are satisfied with its appearance..

    Activity 5: Adding Values across a Group

    In this activity we will explore how to get aggregate data from groups of report data. Well use the

    report titled FacultyDeptSalary that we created inActivity4: Create a Cover Page. The reporthas salary information for which we can create a departmental and grand total.

    1. In the Grouping & totals group of the Design sub-tab, click on the Group & Sort commandicon. A Group, Sort, and Total section of the report will appear at the bottom of the screen.At the top group level, click on More to expand the listing:

    2. In the Group & Sort section of the Report at the bottom of the screen, click the section withno totals.

    3. In the Totals dialog box,

    a. Click on the selector to the right ofTotal On and select Salary.

    b. For the Type selector, keep Sum. Notice, however, that you can also total onAverage, Count Records, Count Values, Maximum, Minimum, Standard Deviationand Variance.

    c. Click on the check box to Show Grand Total.

    d. Click on the check box to Show in group footer.

    4. Switch to Print Preview to view the changes.

    Activity 6: Using Design View to Modify the Basic Appearance of a Report

    Although it may be tempting to use Layout View, this time were going to use Design View to tidyup our report. Unlike Layout View, where you can see real data, youre pretty much flying blindwhen you resize text boxes in Design View. Youll get lots of practice toggling between ReportView and Design View!

    1. Open up Classes by Department in Design View. Expand the Access window to fill theentire screen. In addition, you can gain a little extra screen space by hiding the Navigationpane.

    2. Note the Page Header section, where most of the data labels reside. If you try to resizethese labels youll be left in the position of having to repeat the process with the text box

  • 8/2/2019 Access 2010 Reports

    18/23

    18 Access Reports

    controls for the actual data. You will be more accurate and consistent if you use thetechnique above in the section Formatting multiple controls at once.

    3. Select the label controls and text box controls forLast Name. Move the left side of LastName so that there is only a little space between it and Department. Move the right side ofthe Last Name controls until they align approximately with the 3-inch mark on the horizontalruler.

    4. Repeat step #3 with First Name, aligning the right edge of the control with the 4.25-inchmark.

    5. Repeat again, selecting the CTitle controls. Align the label just to the right of First Name inthe Page Header section. Align its right edge at the 6.5-inch mark.

    6. We can now select the remaining three sets of controls (i.e., CourseNum, SectionNum, andClassDays), and move them just to the right of the 6.5-inch mark. Click elsewhere on theDesign grid to deselect those controls.

    7. Go back up to the Page Header section and change the label caption for CourseNum,SectionNum, and ClassDays to be CRN, Section, and Days, respectively.

    8. Select the Days/ClassDays controls and narrow them down to 8.5-inch mark.

    9. Now we need to restore the missing ClassTime controls:

    a. In the design grid, click on the header for the Detail section so that Detail ishighlighted.

    b. In the Tools group of the Design sub-tab, click on the Add Existing Fieldscommand.

    c. In the list of available fields, double-click on ClassTime. ClassTime will appear inthe details section, with more much more vertical space added.

    d. .Select the ClassTime text box control and position it to the right of ClassDays.

    e. We cannot simply move the remaining ClassTime label up into the Page Headersection it want to remain in the detail section. To move it up to the Page Headersection, you must use Cut & Paste (keyboard shortcut: CTRL-X / CTRL-V).Pasting will only place the label in the section you must then move it into positionby hand.

    10. If you have trouble aligning the ClassTime label and text box, you might try selecting themboth and using the Align command, which is in the Sizing & Sorting group of the Arrangesub-tab.

    11. After adding the ClassTime text box, youll notice that it has a box around it in Report View.Using the Property Sheet, change the Border Style to Transparent.

    12. Finally, dont forget to restore the Detail section to its original view: move the Page Footersection up until it is just beneath Detail.

    Activity 7: Adding a Little Control of Your Own

    This activity will provide you with a small example of how you can use a text box control tomanipulate data. In this example, well perform a simple string manipulation by joining up the FirstName and Last Name fields of a faculty. If you wanted to, however, you could performmathematical manipulations as well provided that you had numbers to work with.

    Well once again work with the Classes by Department report.

  • 8/2/2019 Access 2010 Reports

    19/23

    Access Reports 19

    1. Start with your last version of the Classes by Department report, and open it up in DesignView.

    2. In the Page Header section, select and delete the label controls forLast Name and FirstName.

    3. In the Controls group of the Design sub-tab, locate and select the Label control.After selecting the control, the cursor will feature a capital A. Position the

    cursor down in the Page Header section where you had previously deleted theother labels. Left-click with the mouse to set the control box in position. TypeFaculty Name, which will be our new label.

    4. Down in the Faculty ID Header, select and delete the text box controls forLast Name andFirst Name.

    5. In the Controls group of the Design sub-tab, locate and select the Text Boxcontrol. After selecting this control, your cursor will look like the control icon.Line up vertically with the Faculty Name label control you had just created, andleft-click with the mouse to set the control box in position. Youll see an Unbound control,with a text label to the left.

    6. Select just the label portion of the control (i.e., the part to the left of the unbound control),and delete it.

    7. With just the Unbound control selected, display the Property Sheet and select the Data tabfor your Text Box. To the far right of the Control Source property, click on the todisplay the Expression Builder.

    8. In the upper window of the Expression Builder, type the following text:[First Name] + + [Last Name]

    Note that there is a blank space between the double quotes in the middle of thisexpression. Were literally adding a blank space between the First Name and Last Namefields. This type of operation, where you join text fields, is called concatenation.

    9. When you are done entering the expression, click the OK command to the right.

    10. Preview your newly created text box in Report View. Youll notice that some names arebeing chopped off because the text box is too narrow for some of the longer names.Theres also a solid hairline border around the Faculty Name box.

  • 8/2/2019 Access 2010 Reports

    20/23

    20 Access Reports

    11. Return to Design View and reselect the Faculty Name control within the Faculty IDHeader.

    12. In the Property Sheet for the text box, change with Width property to 2 (two inches).

    13. Look for the Border Style property, and by using the selection control to its right, changethe property from Solid to Transparent.

    14. Preview the report once again in Report View. The faculty names should look just like the

    other fields in your report.

    15. Exit or close the report, saving your recent changes.

    Mailing Labels

    Activity 8: Create mailing Labels

    This activity will walk you through the process of creating mailing labels in Access Reports. TheLabel Wizard allows you to select from a substantial list of label manufacturers. Once you choose

    a manufacturer, you can then associate a specific product number for different sizes and formats.1. Select a table from which to generate labels. For this activity, lets use Students either

    highlight the table in the Navigation pane or open the table in datasheet view.

    2. Click on the Create tab

    3. In the Reports group, click on Labels.

    4. The Label Wizard starts up

    5. Choose Avery as the Manufacturer.

    6. Choose English as the Unit of Measure.

    7. Choose the 5160 Product Number.

    8. Click on Next.

    9. Choose the font properties: font name, size, weight, color.

    10. Click on Next.

  • 8/2/2019 Access 2010 Reports

    21/23

    Access Reports 21

    11. The next Label Wizard panel asks what fields you would like on your labels. The fieldselection should reflect your choice of table. Select the field that you want to add and click on> (or you can double-click on the field).

    The Prototype label field on the right side is interactive. You can type something that willappear on every label, such as To:You can also combine multiple fields on one line, but be aware that you are responsible foradding spaces and punctuation between the fields. Press Enter to move down to the nextline.

    12. Click on Next when you are done with the Prototype label.

    13. The next Label Wizard panel allows you to set up sorting levels, again based upon the fieldsavailable in the table.

    14. To qualify for bulk mailing rates, our labels should be sorted by Zip. If you wish, however, youcan also provide another sort level, such as Last Name.

    15. Click on Next.

    16. Enter a title for the report. The suggested Labels Students will work. Make sure the radiobutton is selected to See the labels as they will look printed.

    17. Click on Finish. You may get a warning that some information is being cut off, due to the labelsize.

    18. Switch to Design View if you wish to make any modifications to the design.

    19. Close the report. Save changes if prompted.

    Apply Conditional Formatting to a Report Control

    You can configure conditional formatting to highlight areas of your report automatically when itmeets certain conditions. For example, let's say you want Access to highlight all Date of Birthrecords where the month matches the current month.

    Birthdates in the Student table are stored in the field Date of Birth. An Access function, Month(),can be used to extract a numeric month value (i.e., 1-12) from a date. We can also use the Now()function to determine the current date. Hence, what we want is a formula to compare:Month([Date of Birth]) = Month(Now()).

    Activity 9: Apply Conditional FormattingWere going to use the Blank Reporttool to create a report based on the Student table, wherewell then use the formula above to create a condition format that highlights birth dates in thecurrent month.

    Follow these steps:

    1. In the Reports group of the Create tab, click Blank Report.

    2. In the Field List on the right, make sure that Show all tables is selected, and expand thefield list for the Students table.

  • 8/2/2019 Access 2010 Reports

    22/23

    22 Access Reports

    3. Add Last Name, First Name, and Date of Birth.

    4. The Blank Report starts out in Layout View, so all we have to do is click on a birth date toselect the entire field.

    5. In the Control Formatting group of the Format sub-tab, click on the ConditionalFormatting command. A Conditional Formatting Rules Managerdialog appears:

    6. In the Conditional Formatting Rules Manager dialog, the formatting rules selector shouldalready display the Date of Birth field. Click on the New Rule command button. A NewFormatting Rulesdialog appears:

    7. In the New Formatting Rules dialog,

    a. Make sure that Check values in the current record or use an expression isselected.

    b. Under Format only cells where the appears, pull down the selector to the right ofField Value Is and change it to Expression Is.

    c. After selecting Expression Is, the selectors to the right change into a singleexpression field, where you can type in the formula:Month([Date of Birth]) = Month(Now())

    d. In the preview section beneath where you entered the formula, you can select theconditional format you would like to use for this rule. You can change the font styleand/or apply background and font colors. A bright red background fill should showoff the condition nicely.

  • 8/2/2019 Access 2010 Reports

    23/23

    e. Click OK when youre done.

    8. When you return to the Conditional Formatting Rules Manager, click Apply and OK.

    9. The Conditional Format should highlight this months birthdays in the Date of Birth column.

    10. Save this report as StudentBDays, or just quit out of the report without saving.

    ###

    (The End)


Recommended