Access 2019 - Query & Repot
Access 2019 - Query & Repot
Microsoft, Microsoft Office, and Microsoft Access are trademarks of the Microsoft Corporation.
University Information Technology Services
Microsoft Office: Access 2016 for Windows
Reports and Queries
Table of Contents
Introduction ................................................................................................................................................ 4
Learning Objectives..................................................................................................................................... 4
Creating a Report ........................................................................................................................................ 5
Adding Labels to a Report ....................................................................................................................... 8
Change Text Style and Color ................................................................................................................... 9
Move and Resize a Text Box ................................................................................................................... 9
Adding Fields to the Form ......................................................................................................................... 10
Arranging Fields on the Report ............................................................................................................. 11
Adding Page Numbers to Your Report ...................................................................................................... 13
Saving your Report .................................................................................................................................... 14
Viewing your report .................................................................................................................................. 15
Printing a Report ....................................................................................................................................... 16
Creating Mailing Labels Using a Report .................................................................................................... 16
Placing Calculations on a Report............................................................................................................... 19
Adding a New Calculation Field to a Report ......................................................................................... 19
Using the Expression Builder to Create a Calculation........................................................................... 22
Creating Queries ....................................................................................................................................... 23
Saving your Query ..................................................................................................................................... 26
Including a Query in a Report ................................................................................................................... 27
Importing an Excel File into Access ........................................................................................................... 27
Additional Help ......................................................................................................................................... 32
Introduction
Microsoft Office Access 2016 allows people to effectively and efficiently organize data. This document
has been developed to help you learn more about several useful features in Access including printing,
applying queries, and importing Excel files. The various sections presented in this document will help
you to build a solid knowledge foundation of the software.
The Microsoft Access Booklet Series will provide you the necessary knowledge on how to use Microsoft
Office Access 2016. Before reading this booklet, it is recommended that you read the following Access
2016 documents on the UITS Documentation Center at http://uits.kennesaw.edu/cdoc:
Learning Objectives
The following objectives are covered in this document:
Creating reports and labels.
Placing calculations on reports.
Using the query feature.
Importing an Excel file.
2. You will be brought to the Report Design view. Right-click over the Page Header bar.
Page 5 of 32
4. The following explains the different areas available in the Report Design.
a. Report Header – Text placed here will appear on the top of the first page of the report.
For example, if there are ten pages in the report, the text would only appear at the top
of the first page (See Figure 4).
b. Page Header – Text placed here will appear at the top of every page. Use this for
column headings and page numbers (See Figure 4).
c. Detail – Text placed here will appear on every page (See Figure 4).
d. Page Footer – Text placed here will appear at the bottom of every page. Use this for
footers and page numbers (See Figure 4).
e. Report Footer – Text placed here will appear at the bottom of the last page of the
report. This is a perfect place to put an End of Report statement (See Figure 4).
Page 6 of 32
5. You can resize different areas of the report sections. Hover your mouse over the top of a
section bar. As you do this, a double-arrow will appear.
6. When you see the double-arrow, hold down the mouse button and move your mouse to
make the section larger or smaller.
7. You can also adjust the width of the report. Hover your mouse over the right edge of the
report. As you do this, a double-arrow will appear.
8. When you see the double-arrow, hold down the mouse button and move your mouse to
make the report larger or smaller.
Page 7 of 32
Adding Labels to a Report
Labels can be used to place text in the different areas of the report. Adding a label to your report is
similar to adding one to a form. The following explains how to add a label to a report:
1. On the Design tab, in the Controls grouping, click Label.
2. Your cursor icon will change to display the Label icon. Hold the left mouse button and drag to
draw a text box on the form.
3. Once finished drawing your text box, release the left mouse button. Your text box will appear.
4. Click in the text box and type your text.
Page 8 of 32
Change Text Style and Color
To change the text style and color of text:
1. Select the text you want to format.
2. From the Home tab, the text can be formatted using the tools found in the Text Formatting
grouping.
3. Hold left click and move the text box to the location of your choice on the form.
Page 9 of 32
4. To re-size the text box, hover over a sizing handle, then hold left click and drag the mouse to
resize the text box.
2. The Field List window will appear. Click Show all tables.
3. Click the + next to the table that contains the fields that you want to add to your form.
Page 10 of 32
4. A list of fields will be displayed. Left-click and hold on the first field you wish to add, then drag
your mouse to the form.
5. When the field is over the form, release your mouse button and the field will be added to the
form.
6. Repeat steps 4 and 5 until all desired fields have been added to your form.
2. When you release the mouse button, all of the fields that were contained in the selection box
will be selected.
Page 11 of 32
4. The selected fields will be arranged in a Tabular layout, with the labels appearing in your report
header, and the fields lining up underneath.
6. The fields will be neatly arranged on the form. You can now move the fields around
individually if you need to organize further.
Note: The area displayed in the detail section will be displayed for each record in your report. A larger
vertical area in the Detail section results in the records being further apart on the report.
Page 12 of 32
Adding Page Numbers to Your Report
Adding page numbers to your report will help others track their position while reading through the
data. The following explains how to add page numbers to a report:
1. From the Design tab, click Page Numbers.
2. The Page Numbers window will open. Under Format, select a number format (See Figure 23).
3. Under Position, select the location for the page numbers to be displayed (See Figure 23).
4. Under Alignment, select an option from the drop-down (See Figure 23).
5. Click OK (See Figure 23).
Page 13 of 32
Saving your Report
The following explains how to save the report.
1. Click the File tab.
3. The Save As window appears. Enter a name for the report and click the OK button.
Note: It may help you stay organized if you name the report the same name as the table that the
report is associated with.
Page 14 of 32
4. To close the report, click the X in the upper-right area of the report.
Page 15 of 32
Printing a Report
You can print out a copy of your report to present as a handout. All formatting that is present on the
form will carry over to your printout. To print the report:
1. Under All Access Objects, select a report you wish to print.
2. From the Home tab, click File.
3. The backstage view will open. Click Print.
4. The Print options will display. Click Print.
Figure 30 - Print
5. The Print window will appear. Select a printer to print your report to, and click OK.
6. The report will be sent to the selected printer.
Page 16 of 32
2. From the Create tab, click Labels.
Figure 32 - Labels
3. The Label Wizard window appears. Under Product Number¸ select the label code provided by
the label manufacturer (e.g. Avery) and click Next.
4. A list of formatting options will appear. Make any desired adjustments to the formatting
options and click Next.
Page 17 of 32
5. A list of available fields from the selected table will display. Under Available Fields, select a
field, then click the arrow button to move fields over to the Prototype label field.
6. Repeat step 5 until all desired fields have been added under Prototype Label. Click Next.
Note: When adding fields, be sure to account for spacing and punctuation between your fields.
Fields added one after the other without spacing or punctuation will display all information from
the table as one long string of text.
7. A list of available fields is displayed for you to sort your labels on. If you would like to sort
the data, select a field under Available fields, then click the arrow to move the selected field
in to the Sort by column.
8. Continue sorting fields until you are finished, then click Next.
Page 18 of 32
9. In the next window, enter the name for the report and click the Finish button.
10. The report will be created and saved under your list of Access Objects.
11. To print the labels, see the section Printing a Report.
Page 19 of 32
2. Draw a text box in the Detail section of the report.
3. After entering the text box, click the label to select it.
Page 20 of 32
8. Drag the label over the corresponding text box in your form.
12. On the Property Sheet, in the Other tab, enter a descriptive name in the Name field.
Page 21 of 32
Using the Expression Builder to Create a Calculation
The following explains how to set-up the calculation on a report by using the Expression Builder.
1. On the Property Sheet, in the Data tab, click the ellipsis in the Control Source field.
2. The Expression Builder will open. In the Expression field, type = to begin a formula.
Page 22 of 32
5. On the Property Sheet, in the Format tab, select Currency from the Format field.
6. The calculation has been created. You will see the new field and the results of your calculation
when in the Report View.
Creating Queries
Queries can be set-up to help you to search through a database for specific information, and then
saved so they can be run multiple times. Some examples of items that can be searched for include:
Stores with sales above or below an indicated amount
“tudents earning an A in a specific course
People who live in a specific zip code
Companies located in a specific state
Employees who have completed a First Aid course
Page 23 of 32
The following explains how to create a query to search for stores in the database that had sales above
$700 on the first day of a special sale that was held by the company.
1. From the Create tab, click Query Design.
2. The Query Design view will appear with the Show Table window, displaying a list of tables.
Select the table that you want to add and click Add.
3. Click Close.
4. In the Query Builder at the bottom of the screen, place your cursor in the first column of the
Field dropdown.
5. Click the dropdown, and select the field that you want included in this query.
Page 24 of 32
6. Repeat steps 4-5 for the other columns, until you have all of the fields listed that you want
included in this query.
7. In the Criteria row, enter what you are searching for in the database under the field where
you want to perform the search.
For example, if you wanted to search for stores that had sales $700 and higher on day 1,
you would enter the following in the sort row: >=700.
Page 25 of 32
Saving your Query
The following explains how to save the query.
1. Click the File tab.
3. The Save As window appears. Enter a name for the query and click the OK button.
Note: Any data that is entered into the table after the query is saved will be included in the query if it
meets the criteria specified.
Page 26 of 32
Including a Query in a Report
The following explains how to include the results of a query in a report.
1. From the Create tab, click Report Design.
4. A list of your tables and queries will display. Select your query from the list.
5. Proceed as normal designing the report. The data that appears on the report will come from
the query that you selected.
Page 27 of 32
2. The Import Spreadsheet Wizard will appear. Click Browse.
3. The File Explorer will appear. Select the Excel file to import and click Open.
4. Select the Import the source data into a new table in the current database option.
5. Click OK.
Page 28 of 32
6. If the Excel file contains multiple spreadsheets, select the spreadsheet and click Next.
Note: If your Excel file only has one spreadsheet, then skip to step 7.
7. The wizard will ask you if the first row of your spreadsheet contains column headings. If yes,
check the box next to First Row Contains Column Headings.
8. Click Next.
Page 29 of 32
9. For the next step of the import wizard, you can select the different columns and adjust the
Field Name and Data Type for the database.
Page 30 of 32
13. The wizard will ask you to enter a name for the new table in the Import to Table field.
Page 31 of 32
17. The information in Excel will be imported into Access. At this point, you can create forms,
create reports, create queries, etc.
Additional Help
For additional support, please contact the KSU Service Desk:
Page 32 of 32