Download MS Access Class – 04/01

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts

Database model wikipedia , lookup

Transcript
Horry County Schools 4/2001
MS Access Class – 04/01
Creating a MS Access Report with Sasixp Data
Exporting From Sasixp
Open Sasixp Query Atom and create an Export Query with appropriate data.
Example:
After pressing the Export button, select the following options from the Export window:
After pressing OK button, the Export File Name window appears.
1
Horry County Schools 4/2001
In the Save In: box, select from the pull down arrow, the correct drive and then, select the correct folder. In
the File name: box, type in the file name you wish to name the file. BE SURE TO GIVE THE FILENAME
THE EXTENSION .TXT (stuinfo.txt). In the Save as Type: box, be sure the option is All Files (*.*). Press
the Save button to export Sasi data to your file.
If you need to create a new folder for your Sasi Export Files: Select the appropriate drive letter in the Save In:
box, then click on the
button. A New Folder box will appear and then, you need to type a name for this
folder, such as SasiAccess. Then Press the enter key to save the name for the folder. Continue with
completing the previous step for entering a filename in the File Name: box (Remember to use the extension
.txt) and make sure that the Save as Type: box indicates All Files (*.*). Press the Save button to export Sasi
data to your file.
2
Horry County Schools 4/2001
Importing Sasi Data into MS Access
Open MS Access program. You can open an existing database or create a new database. If you have an
existing database, you can choose the database from the list at the bottom of the screen. If you need to create a
new database, check the Blank Access Database option and press OK button.
If you have choosen the Blank Access Database option, then the following File New Database window opens.
You will need to select the appropriate drive in the Save In: box and then select the appropriate folder and
double click on the folder name. You must type a filename for your database in the File Name: box, such as
SasiStuff. (The filename should be typed without an extension). The Save as Type: box must have the
option Microsoft Access Databases (*.mdb). Press the Create button to create the database.
3
Horry County Schools 4/2001
After you have your database open, select File from the menu bar, then select Get External Data, then Import.
The Import window will appear for you select your drive, folder and Sasi Export filename. Notice that the
Files of type: box is Text Files (*.txt;*.csv;*.tab;*asc). Press Import button.
After you have pressed the Import button, you will see an import Text Wizard window. “The Delimited –
Characters such as comma or tab separate each field” should be checked.
4
Horry County Schools 4/2001
Press the Next button and the Import Text Wizard moves forward to the next window. Be sure that the
“Comma” option has been checked. Text Qualifier is set to “.
Press the Next button to move forward to the next Import Text Wizard Window. You will probably select the
“In a New Table” option.
5
Horry County Schools 4/2001
6
Horry County Schools 4/2001
Press the Next button and move forward to the next Import Text Wizard window, Field Information.
In this field information window, you need to type the Field Name (Title) for each field that was exported
from Sasi. Click in each column to bring up the Field Option boxes for each column. Move from column to
column until you have completed the field options for each column. Press the Next button to move forward to
the next Import Text Wizard window.
7
Horry County Schools 4/2001
The Import Text Wizard window allows you to select an index key for your data. If you allow Access to add
the primary key, each Sasi record will be numbered in order. You may wish not to have a primary key. If you
do not need a Primary Key, click on the option No Primary Key. Press the Next button to move to the next
Import Text Wizard window.
Type the name you wish for your table. Press the Finish button.
8
Horry County Schools 4/2001
MS Access Query
Open the Query button and select New. Select the Design View option from the Query list. From the Show
Tables list, select your table (StuInfo for this example). Press the Add button to add this table to your query.
To choose the fields for your query, highlight the field in the table box and drag the field into a column in the
grid. Do this for whatever fields you want displayed in your query. Set whatever appropriate conditions you
need for your query in the grid as well. Example:
To view the query, press the Run or View buttons on the button toolbar. You can print the results from the
displayed query by pressing the printer button on the button toolbar.
Example:
9
Horry County Schools 4/2001
Create a query as below and save the query with the name Homeroomlist.
MS Access Reports
Open the Report button and select New. Select the Report Wizard and the table or query for the Report. Press
the OK button to proceed. Remember that a Report can be written from a table or from any Query that you
have written.
10
Horry County Schools 4/2001
11
Horry County Schools 4/2001
From the Report Wizard window, select the fields for your report from the Available Fields box. You can
double click on the fields to move them to the Selected Fields box or just highlight and click on the > button.
If you incorrectly select a field, highlight the field and click on the < button to move it back to the left.
After you have chosen the fields for your report, press the Next button to move to the next Report Wizard
window. From the Grouping levels window, select the fields for creating grouping on your reports. Highlight
the field and press the > button to create the group in the right hand box.
12
Horry County Schools 4/2001
Press the Next button to move to the next Report Wizard window. From the Sort order window, select the
fields for sorting your records on your report. Use the pull down arrow the select the appropriate field.
Press the Next button to move to the Layout Report Wizard window. Check the appropriate Layout and Paper
Orientation options.
13
Horry County Schools 4/2001
Press the Next button to move to the Style Report Wizard window. Select the appropriate Report Style.
Press the Next button to move to the Title Report Wizard window. Type in the Title of your report. Select
“Preview the Report” option and click on Finish button.
You can save your report by opening the File menu bar option and selecting Save Option or closing the
preview and answering Yes to save upon close of your report.
14
Horry County Schools 4/2001
Example:
Open a New Report, Select Report Wizard, and the query “HomeroomList”
Press Ok button and move forward to the next Report Wizard window. Select the fields for your report from
the Available Fields by either double clicking on the fields or highlighting the fields and clicking on the >
button to move the fields to the selected Fields box.
Notice that although the Grade field was originally in the “HomeroomList” query, it does not appear as an
available field. This is because the Grade field did not have the Show condition checked in the query grid.
Press the Next button and move to the Grouping Report Wizard window.
15
Horry County Schools 4/2001
Select as shown:
Press the Next button to move to the Sort Order Report Wizard window. Select as shown.
Press the Next button and move to the Layout Report Wizard window.
16
Horry County Schools 4/2001
Select as shown.
Press the Next button and move to the Style Report Wizard window. Select as shown.
Press the Next button and move to the Title Report Wizard window. Type your title, select preview the report,
and press the Finish button.
You can save your report by opening the File menu bar option and selecting Save Option or closing the
preview and answering Yes to save upon close of your report. Name the Report Advisor List for 10th Graders.
17
Horry County Schools 4/2001
Redesigning MS Access Report
From the Report window, highlight the name of the Report for which you need to redesign, then select the
Design Option.
Move the TchLast field to reside next to the Advisor # box. Click on the TchLast box until small squares
appear around the box. Move your mouse over the box until your mouse pointer changes from an arrow to a
hand. Once the hand image appears, click with your mouse, hold, and drag the TchLast box next to the
Advisor# box. You can also resize the box by moving the mouse until the hand changes to a line arrow. Then
you can click, hold, and drag the sizing of the box. You can move boxes around until you have the desired
layout.
Move up the Detail Section up to cover TchLast Header Section. Move your mouse pointer directly above the
Detail section until you have the Crosshairs option, hold, and drag the Section upwards. You can resize the
width of any Section by dragging the Section upward or downward. If you need additional space between
lines in the Report, just make your Section wider using this technique.
18
Horry County Schools 4/2001
To create a Page Break by Advisor, you will need to have an Advisor# Footer Section. To create the Advisor#
Footer Section, go to View on the menu bar and select Sorting and Grouping Option. When the Sorting and
Grouping window opens, you will need to highlight Advisor#. Then you will answer Yes to Group Footer in
the Group Properties box.
Close this window and return to your Design window. From the Toolbox window, click on the Page Break
button, and then click in the Advisor# Footer Section to drop the Page Break. This will create a page break
after each Advisor. You may also need to make the Advisor# Footer Section smaller in width.
To create blank lines in your report: click the Line button from the Toolbox, then click at the location where
the line should begin, drag the line the length desired and release the mouse.
19
Horry County Schools 4/2001
You can save these changes to your report by either closing the report and answering Yes to Save or go to File
on the Menu bar and select the save option.
20