Documente Academic
Documente Profesional
Documente Cultură
In our previous tutorials, you’ve learned a good deal about Microsoft Access.
Together, we created a query, modified the query to make it more complex, and
created a data entry form. We've learned the skills necessary to put information into
a database and selectively remove the exact information we're seeking. In this
tutorial, we're going to go a step further and learn how to create professionally
formatted reports automatically from our database information. Returning to our
familiar Northwind Company, we're going to design a nicely-formatted listing of
employee home telephone numbers for the use of management.
The sample images in this tutorial were created using Access 2000. If you are
running an earlier version of Access, your screen images may appear slightly
different. However, the same general principles still apply and you should be able to
follow along. If you need a quick-start on the basics of Access before getting
started, take a look at the article "Microsoft Access Fundamentals."
Once again, we're going to use the Northwind sample database. Before we get
started, open up Microsoft Access and then open the Northwind database. If you
need help with this step, please read the article "How to Install the Northwind
Sample Database."
1. Choose the Reports menu. Once you've opened Northwind, you'll be presented
with the main database menu shown below. Go ahead and click on the "Reports"
selection and you'll see a list of the various reports Microsoft included in the sample
database. If you'd like, feel free to double-click on a few of these and get a feel for
what reports look like and the various types of information that they contain.
2. Create a new report. After you've satisfied your curiosity, go ahead and click on
the "New" button and we'll begin the process of creating a report from scratch.
3. Select the Report Wizard. The next screen that appears will ask you to select
the method you wish to use to create the report. We're going to use the Report
Wizard which will walk us through the creation process step-by-step. After you've
mastered the wizard, you might want to return to this step and explore the flexibility
provided by the other creation methods.
4. Choose a table or query. Before leaving this screen, we want to choose the
source of data for our report. If you want to retrieve information from a single table,
you can select it from the drop-down box below. Alternatively, for more complex
reports, we can choose to base our report on the output of a query that we
previously designed. For our example, all of the data we need is contained within
the Employees table, so choose this table and click on OK.
5. Select the fields to include. Use the ‘>’ button to move over the desired
fields. Note that the order you place the fields in the right column determines the
default order they will appear in your report. Remember that we're creating an
employee telephone directory for our senior management. Let's keep the
information contained in it simple -- the first and last name of each employee, their
title and their home telephone number. Go ahead and select these fields. When you
are satisfied, click the Next button.
6. Select the grouping levels. At this stage, you can select one or more grouping
levels to refine the order in which our report data is presented. For example, we
may wish to break down our telephone directory by department so that all of the
members of each department are listed separately. However, due to the small
number of employees in our database, this is not necessary for our report. Go ahead
and simply click on the Next button to bypass this step. You may wish to return here
later and experiment with grouping levels.
7. Choose your sorting options. In order to make reports useful, we often want
to sort our results by one or more attributes. In the case of our telephone directory,
the logical choice is to sort by the last name of each employee. Select this attribute
from the first drop-down box and then click the Next button to continue.
Choose the sorting options
In the next section, we'll put the finishing touches on our report. Read on for more!
Next, we'll select exactly which table data to include in the report and learn how to
apply formatting to our finished product. Read on!
Related Articles
8. Choose the formatting options. In the next screen, we’re presented with
some formatting options. We’ll accept the default tabular layout but let’s change the
page orientation to landscape to ensure the data fits properly on the page. Once
you’ve completed this, click the Next button to continue.
9. Select a report style. The next screen asks you to select a style for your
report. Click on the various options and you’ll see a preview of your report in that
style in the left portion of the screen. We’ll use the Corporate style for this report.
Select this option and then click the Next button to move on.
10. Add the title. Finally, we need to give the report a title. Access will
automatically provide a nicely formatted title at the top of the screen, with the
appearance shown in the report style you selected during the previous step. Let’s
call our report “Employee Home Phone List.” Make sure that the “Preview the
report” option is selected and click on Finish to see our report!
Adding a Title
1 of 6
Prev Next
Choose a Template
Microsoft provides quite a few prebuilt database templates to assist you in jumpstarting
your database development process. In this tutorial, we'll walk through the process of
creating an Access database using these templates.
Once you've selected a template, open Microsoft Access. If you already have Access
open, close and restart the program so you're viewing the Getting Started screen, as
shown in the image above. This will be our starting point for creating our database.
Select the Template Source
Next, choose the source of your template from the left pane, as shown in the image
above. If you wish to use a template on your local system, click "Local Templates".
Otherwise, you can select one of the Office Online template categories to browse
templates available on the web.
Select a Template
After you select a template source, the right window pane will display all of the templates
available from that source, as shown in the image above. Click once on the template
you'd like to use to begin the database creation process.
Choose a Database Name
After you select a database template, a new pane will appear in the right portion of the
screen, as shown in the image above. You must now name your Access database. You
may either use the name suggested by Access or type in your own name. If you'd like to
change the database location from the default, click the file folder icon to navigate
through the directory structure.
Once you're satisfied with your selections, click the Create button to create your database
That's all there is to it! After a brief delay, Access will open your new database, as shown
in the image above. You can either begin entering data immediately by typing in the first
open cell or you can explore the features of the template using the navigation pane on the
left side of the screen.
See More About:
• access tutorials
• database tutorials
• microsoft access
• web databases
• dynamic web applications
In our last tutorial, we walked through the process of creating a static web page from data
stored in an Access database. That simple method of publishing web pages was adequate
for environments where we want a "snapshot" of a database such as a monthly report or
where the data rarely changes. However, in many database environments the data
changes frequently and we need to offer web users up-to-date information at the click of
a mouse. We can meet these requirements by utilizing Microsoft's Active Server Pages
(ASP) technology to create a dynamic server-generated HTML page that links to our
database. When a user requests information from an ASP page, the web server reads the
instructions contained within the ASP, accesses the underlying database accordingly, and
then creates an HTML page that contains the requested information and returns that to the
user. One of the limitations of dynamic web pages is that they can not be used to
distribute reports like we did in our static web page tutorial. They can only be used to
display tables, queries and forms. In this example, let's create an up-to-the-minute
product catalog for our web users. For the purposes of our example, we'll once again be
using the Northwind sample database and Microsoft Access 2000. If you haven't used
this sample database in the past, there are simple installation instructions located on this
site. Select it from the menu shown below and click OK to continue.
Open the item you wish to publish
When you see the database main menu, select the Tables submenu. Double-click the
Products entry in the table (as shown in the figure below).
Create a Filename
At this point you need to provide a name for your file. We'll call ours Products. Also, you
should use the file browser to locate the path to publish your file. This will depend upon
your web server. The default path for IIS is \Inetpub\wwwroot. Once you've completed
this step click the Save All button.
The Microsoft ASP Output Options dialog box allows you to specify the details of your
ASPs. First, you can choose a template to provide formatting. Some sample templates are
stored in the directory \Program Files\Microsoft Office\Templates\1033\. We'll use the
"Simple Layout.htm" in this example.
The next entry is the Data Source Name. It's important to remember the value you enter
here -- it defines the connection used by the server to access the database. You can use
any name here; we'll set up the connection in a few minutes. Let's call our Data Source
"Northwind."
The final section of our dialog box allows us to specify the URL and timeout values for
the ASP. The URL is the method by which our ASP will be accessed over the Internet.
You should enter a value here that corresponds to the file name and path you selected in
step 5. If you placed the file in the wwwroot directory, the URL value is
"http://yourhost.com/Products.asp", where yourhost is the name of your machine (i.e.
databases.about.com or www.foo.com). The timeout value allows you to specify how
long a connection will be left open for an idle user. Five minutes is a good starting point.
Save the file
Click the OK button and your ASP file will be saved to the path you specified. If you try
to access the page now, you'll receive an ODBC error message. This is because we have
yet to define the data source and the web server can not find the database. Read on and
we'll get the page up and running!
Finished Product
Click on the "Select" button and then use the file navigation window to browse to the
database file you wish to access. If you set it up with the default installation, the path
should be Program Files\Microsoft
Creating Forms in Microsoft Access
This will bring up a list of the form objects currently stored in your database. Notice that
there are a large number of pre-defined forms in this sample database. After you
complete this tutorial, you might want to return to this screen and explore some of the
more advanced features included in these forms.
Edit Properties
Click the Properties icon. This will bring up a menu of user-definable attributes that
apply to our form. Edit the properties as necessary. Recall that our original goal was to
create a form for data entry purposes. Most likely, we don't want to grant data entry
employees full access to view or edit customer records. Setting the "Data Entry" property
to Yes will only allow users to insert new records and modify records created during that
session.