Microsoft Access 2007 Beginning Topics

advertisement
Microsoft Access 2007: Intermediate Topics
Course Outline & Guide
MICROSOFT ACCESS 2007: INTERMEDIATE TOPICS .................................................................................. 1
COURSE OUTLINE & GUIDE .............................................................................................................................. 1
1.
MICROSOFT ACCESS 2007 – OVERVIEW .......................................................................................... 1
2.
OPEN AN EXISTING DATABASE ........................................................................................................ 2
A.
FROM THE OFFICE BUTTON > OPEN > DESKTOP > COURSE FILES > ACCESS II > STUDENTS.MDBX ... 2
3.
EDIT A TABLE DESIGN ...................................................................................................................... 2
4.
DATE/TIME DATA TYPE ................................................................................................................... 2
5.
FIELDS WITH CURRENCY VALUE ...................................................................................................... 2
6.
YES / NO FIELDS .............................................................................................................................. 3
7.
FIELDS WITH HYPERLINKS ............................................................................................................... 3
C.
SAVE YOUR TABLE DESIGN .............................................................................................................. 3
8.
CREATE A FORM .............................................................................................................................. 3
9.
EDIT A RECORDS WITH A FORM ...................................................................................................... 4
10.
ADDING RECORDS USING A FORM .................................................................................................. 4
11............................................................................................................................................................. 5
12.
CREATE A BACKUP .......................................................................................................................... 7
13.
OPEN FLOOR FOR Q&A ................................................................................................................... 7
14.
NEXT WEEK - ACCESS III – ADVANCED TOPICS ................................................................................. 7
1. Microsoft Access 2007 – Overview
a. What is it?
Access 2007 is the latest database development application from
Microsoft. It is one of the many software programs that make up
MS Office 2007 which is available only for the Windows PC
operating system. It is used for create and manage lists, query
data, and provide reports. Access data can be read directly into
the other Office 2007 programs for mailing lists and to create
graphs.
1|Page
2. Open an Existing Database
a. From the Office Button > Open > Desktop > Course Files >
Access II > Students.mdbx
3. Edit a table design
a. From the Navigation Pane under Tables right click Students and select
Design View
b. Insert a new field
i. Select the Field Name Address
ii. From the Ribbon > Design tab > Tools section > click Insert Row
iii. Click in the field name area on the inserted blank row
4. Date/Time data type
a. What is this?
Add a Date/Time, when you need to saves information on a date,
time, or both in a standard format. Calculations can be made
based on this data.
b. New field:
i. Field Name: dob
ii. Date Type: Date/Time
iii. Field Properties:
1. Format: Short date
2. Caption: Date of Birth
3. Default Value: [blank]
4. Required: Yes or No (your choice)
5. Allow Zero Length: Yes or No (your choice)
6. Indexed: No
5. Fields with currency value
a. What is this?
Add a currency field to a table when you need to store financial
data, such as sales, unit cost, or an outstanding balance due.
b. New field:
i. Field Name: fee
ii. Date Type: Currency
iii. Field Properties:
1. Format: Currency
2. Caption: Outstanding Fees
3. Required: No
4. Indexed: No
2|Page
6. Yes / No Fields
a. What is this?
Add a Yes/No field to a table when you need to store binary data,
such as the state of a switch, or weather a statement is true or
false.
b. New field:
i. Field Name: finaid
ii. Date Type: Yes/No
iii. Field Properties:
1. Format: Yes/No
2. Caption: Financial Aid
3. Required: No
4. Indexed: No
7. Fields with hyperlinks
a. What is this?
Add a hyperlink field to a table when you need to store an
address of a webpage or other internet link.
b. Add a new field that is a hyperlink
iv. Field Name: url
v. Date Type: hyperlink
vi. Field Properties:
5. Caption: Webpage
6. Required: No
7. Allow Zero Length: Yes
8. Indexed: No
9. Required: No
c. Save your table design
8. Create a form
a. What are these?
i. A method by which you can display and edit data
ii. Control application flow
iii. Accept input
iv. Display messages
v. Printing information
b. Creating the form
i. On the Ribbon, in the Create tab > in the Forms group > select
More Forms (down arrow) > Form Wizard
ii. Save the table if necessary
c. Form Design Wizard
3|Page
i. In the Tables/Queries field select the table you wish to create the
form for
ii. Which fields would you like for this form? In the Available fields:
pane select the field you wish to include in your form design by
selecting a field and clicking the > to move it to the Selected
fields: pane you can select and move all fields by clicking the >>
iii. Click Next >
iv. What layout would you like for your form? By clicking on the radio
buttons you will see an example of the form displayed to the left
select the select the Justified radio button
v. Click Next >
vi. What style would you like? By clicking on the radio buttons you
will see an example of the form displayed to the left select the
Office radio button
vii. Click Next >
viii. What title would you like for your form? Enter the name for the
form, default the form is created with the same name as the
table. Title this form Student Data
ix. Leave the open form to view or enter data radio button selected
x. Click Finish
9. Edit a records with a form
Using the form add the following information to the 6 existing records.
Student ID # Date of
Financial
Outstanding
Web Site
Birth
Aid
Fee
111-11-1111 1/1/1960
Yes
$100.00
www.cbs.com
222-22-2222 5/15/1969
No
$1,000.50
www.sfsu.edu
333-33-3333 2/14/1977
No
$2,412.00
www.scifi.com
444-44-4444 3/27/1989
Yes
555-55-5555 4/14/1953
Yes
$15.00
www.nbc.com
666-66-6666 6/17/1984
Yes
$136.22
www.abc.com
10. Adding records using a form
a. Using the form add 3 records
I.
Create first new record
II.
Click on the >* at the bottom of the form
III.
Move on to the next field by pressing TAB
1. Student ID#:
2. First Name:
3. Last Name:
4. Date of Birth:
5. Street Address:
6. City:
4|Page
7. State:
8. Zip Code:
9. College:
10. Financial Aid:
11. Outstanding Fees:
12. Website:
13. Credit Hours:
14. Quality points
11.
a. What are they?
A method for selecting, sorting and manipulating data extracted
from one or more tables or queries.
b. Creating a query with sorting
i. On the Ribbon, in the Create tab > in the Other group > select
Query Design
1. From the Show Table window in the Tables tab select the
students
2. Click Add at the bottom of the window
3. Click Close at the bottom of the window
a. The top section of the screen will now display the
field lists of tables or queries used in this query
b. The lower section displays the Design Grid
4. Specifying fields Click the Field: > down arrow to display the
list of fields available
a. Select sid for the first field (always include your
master key in queries so that they may be used as
part of future queries)
b. Select fname for the second field
c. Select lname for the third field
d. Select college for the fourth field
5. Under college lick Sort: > down arrow and select asending
6. Run the query and create a results table
a. On the Ribbon, in the Design tab > in the Results
group > select Run
b. To save the results click the save icon on the Quick
Tools bar and rename the file to College Sort
c. Creating a query with a calculated value
i. On the Ribbon, in the Create tab > in the Other group > select
Query Design
1. From the Show Table window in the Tables tab select the
students
2. Click Add at the bottom of the window
5|Page
3. Click Close at the bottom of the window
a. Specifying fields Click the Field: > down arrow to
display the list of fields available
b. Select sid for the first field (always include your
master key in queries so that they may be used as
part of future queries)
c. Select the next blank field
d. On the Ribbon, in the Design tab > in the Query
Setup group > select Build to open the Expression
Builder
i. Expand Tables
ii. Select students
iii. Double click qpoints
iv. Press the / button
v. Double click chours
vi. Click Ok
vii. Press Enter
viii. You should now see Expr1:
[students]![qpoints]/[students]![chours] on
the field line
ix. Select the Expr1 portion of the expression
and change it to GPA
e. Display the properties, on the Ribbon, in the
Design tab > in the Show/Hide group > select
Property Sheet
f. In the Property Sheet pane under Format selected
Fixed
4. Run the query and create a results table
a. On the Ribbon, in the Design tab > in the Results
group > select Run
b. To save the results click the save icon on the Quick
Tools bar and rename the file to GPA
d. Creating a query combining information from multiple sources
i. On the Ribbon, in the Create tab > in the Other group > select
Query Design
1. From the Show Table window in the Both tab select students,
and GPA
2. Click Add at the bottom of the window
3.
4. Click Close at the bottom of the window
5. Specifying fields Click the Field: > down arrow to display the
list of fields available
a. Select students.sid for the first field
b. Next student.college and sort: descending
c. Next gpa.gpa and sort: descending
6|Page
d. Next student.fname
e. Next student.lname
6. Run the query and create a results table
a. On the Ribbon, in the Design tab > in the Results
group > select Run
b. To save the results click the save icon on the Quick
Tools bar and rename the file to ClassRank
12.Create a backup
a. What is this?
A backup is a copy of the original file. This is extremely beneficial
if the original file is either damaged or lost
b. Close Access
c. Save the table or layout if necessary
d. Open your My Documents folder for your new database file
e. Create a backup
i. Move your mouse pointer into the file icon
ii. Right-click
iii. From the menu choose Copy
iv. Move your mouse pointer to an empty area inside the folder
v. Right-click
vi. From the menu choose Paste
vii. Rename the file, sfsu_student_[date].aacdb
13. Open floor for Q&A
14. Next week - Access III – Advanced Topics
b. To be determined!
7|Page
The following table describes the data types available for fields in Office Access 2007.
Data type
Stores
Size
Text
Alphanumeric characters
Use for text, or text and numbers
that are not used in calculations (for
example, a product ID).
Up to 255 characters.
Memo
Alphanumeric characters (longer
than 255 characters in length) or
text with rich text formatting.
Use for text greater than 255
characters in length, or for text that
uses rich text formatting. Notes,
lengthy descriptions, and
paragraphs with formatting such as
bold or italics are good examples of
where you would use a Memo field.
Up to 1 gigabyte of
characters, or 2 gigabytes
of storage (2 bytes per
character), of which you
can display 65,535
characters in a control.
8|Page
Number
Numeric values (integers or
fractional values).
Use for storing numbers to be used
in calculations, except for monetary
values (use the Currency for data
type for monetary values).
1, 2, 4, or 8 bytes, or 16
bytes when used for
replication ID.
Date/Time
Dates and times.
Use for storing date/time values.
Note that each value stored
includes both a date component
and a time component.
8 bytes.
Currency
Monetary values.
Use for storing monetary values
(currency).
8 bytes.
AutoNumber
A unique numeric value that Office
Access 2007 automatically inserts
when a record is added.
Use for generating unique values
that can be used as a primary key.
Note that AutoNumber fields can be
incremented sequentially, by a
specified increment, or chosen
randomly.
4 bytes or 16 bytes when
used for replication ID.
Yes/No
Boolean values.
Use for True/False fields that can
hold one of two possible values:
Yes/No or True/False, for example.
1 bit (8 bits = 1 byte).
OLE Object
OLE objects or other binary data.
Use for storing OLE objects from
other Microsoft Windows
applications.
Up to 1 gigabyte.
Attachment
Pictures, Images, Binary files, Office
files.
This is the preferred data type for
storing digital images and any type
of binary file.
For compressed
attachments, 2 gigabytes.
For uncompressed
attachments,
approximately 700k,
depending on the degree
to which the attachment
can be compressed.
Hyperlink
Hyperlinks.
Up to 1 gigabyte of
9|Page
Lookup Wizard
Use for storing hyperlinks to
provide single-click access to Web
pages through a URL (Uniform
Resource Locator) or files through a
name in UNC (universal naming
convention) format. You can also
link to Access objects stored in a
database.
characters, or 2 gigabytes
of storage (2 bytes per
character), of which you
can display 65,535
characters in a control.
Not actually a data type; instead,
this invokes the Lookup Wizard.
Use to start the Lookup Wizard so
you can create a field that uses a
combo box to look up a value in
another table, query or list of
values.
Table or query based: The
size of the bound column.
Value based: The size of
the Text field used to
store the value.
10 | P a g e
Download