|
|
 |
Comp25:
Access -
Import Customers & Create Tables
Learning Objectives: Create three tables in your database
- To start off your Customer Database using the customer list you created in Excel.
- To learn
how to import data from Microsoft Excel into Microsoft Access
- To modify a table after it has
been created by adding new fields and changing field properties
- To get accustomed to using
Access to enter data directly into a table
- To create additional Tables within Access to track your
employees and products
- To learn more
about Data types and Field properties
Warning:
When creating fields and tables, it is highly advised that you keep the exact same names shown in
the assignment directions. Pay careful attention to capitalization and spaces (or lack thereof), and
do not skip any steps. Failure to do this could cause a problem down the road which will require
significant time to fix.
You cannot begin this assignment until you have finished
Customer Mailing List.
Steps to Take - Import Customer Table
- Using Access, create a new database file and save it as
YourCompanyName-Database.mdb to your U: Drive (or in a place you won't lose it).
-
IF YOU ARE
USING ACCESS 2007, BE SURE YOU SAVE YOUR DATABASE IN THE EARLIER
ACCESS 2002-2003 .MDB FORMAT, NOT THE 2007 .ACCDB TO INSURE YOU
CAN EDIT YOUR DATATBASE FROM EITHER 2002, 2003 OR 2007 VERSIONS
OF ACCESS
CLICK HERE FOR
DETAILED Access 2007
instructions
- Create a new Table using the
Import Table feature.
- Choose New
- Choose "Customer Mailing.xls" file located in your web-docs folder.
(You
will likely need to change the "Files of Type" to .xls before
you can see your file.)
- In the wizard, be sure to read and follow each step carefully:
- Indicate that the First Row Contains
Column Headings.
- You want to store your data into a New table.
- Name your fields exactly as follows:
- FirstName (no spaces, same capitalization)
- LastName
- Address
- City
- ST
- ZIP
- Do not import (skip) the Sales, FullName, or Locale fields.
You'll need to click on each of these columns and choose Skip.
- When prompted, let Access add its own Primary Key. It
is going to call this field "ID". We'll change it later to
"CustomerID".
- Call your new table "Customers".
- Finish the wizard and open your newly imported table in
Datasheet view. To simplify our assignments, delete all but the first 25 customers.
- Notice the ID field that was created automatically during
the import routine. This is an AutoNumber data type that
represents your customer number, and is unique to each record.
This is the "primary key" that will be used to link Orders to
Customers.
- Make the following changes to your new table using Design
View:
- Add a new field called PhoneNumber and give it a proper
Input Mask using the Input Mask Wizard (CLICK the button with
"dot dot dot" next to the field properties).
- Give reasonable Field Size limits to each of your fields
(for example, ST should only be 2 characters). Remember
that the ZIP field isn't just five digits, it can sometime have
nine plus the extra character for the hyphen. Same with
the PhoneNumber.
- Decide which fields
should have a Default Value. Can you assume that most of
your customers will be from the state CA?
- Rename the ID field to "CustomerID" (no spaces).
- Save your changes to the Customers table.
- Return to Datasheet view and populate the new PhoneNumber field
of each of your 25 customers with fake phone
numbers. Make sure your Input Mask works here.
- Edit your customer names so they are unique to your
database.
- You just got three new customers! Using the Datasheet view, create
three new records at the bottom of the table.
- Return to the Design View
- Revise your Customers table and add a new field
called CustomerType.
- Make this field a drop-down menu
by setting the data type to Lookup Wizard. In the first
step of the wizard, choose "I will type in the values that I
want".
- In the next step, you want just one
column. Here, you will create two rows with these values:
Wholesale
and
Retail.
- Return to
the datasheet and edit each of your existing customers and
assign them a Customer Type (the majority should be Retail, but
make a few of them wholesale).
- The default value
does not affect records that were already created, only new
records.
- When assigning Retail or Wholesale, you can speed
up the process by pressing R or W on your keyboard, since the
drop-down menu will automatically fill in the rest.
- Return to the Design View. Make Retail the default
value of the CustomerType field. Save and return to the
datasheet view
- Create a
new customer with realistic contact information, and watch the default CustomerType in effect.
Steps to Take - Create Employees
and Product Tables.
- Create a new table in this database (from Design View) for your Employees. Provide these fields:
- EmployeeID (datatype: autonumber)
- EmployeeName (text)
- CommPercent (datatype: Number, Field size: Single,
Format:
Percent)
- EmployeePhone (text)
- EmployeeEmail (text)
- HireDate (datatype: Date/Time)
- Active (datatype: Yes/No)
Save your table as "Employees" and allow Access to designate
EmployeeID as your Primary Key.
- Edit your Employees tables in the Design View.
- Use an input mask on EmployeePhone to make data entry
easier.. Use the Input Mask Wizard (Click the ...
button) and choose Phone Number.
- Type your own input mask for CommPercent:
- Use an input mask on CommPercent to make data entry easier.
TYPE: .00% for the input mask property (since the
Input Mask Wizard doesn't have a setting for percentages).
- Use 0.15 as the default value for the Commission percentage
and set the decimal places to zero.
- Use the Caption property to make your field names appear
friendlier when you are viewing your table, and later when you
create Forms and Reports.
- Now populate your Employees Table:
- Add your employees names, their
contact information, hire date (spread out over the last year), and the percentage commission they will
earn on each of their sales. (If you need to specify a
single-digit percentage, enter it with a leading zero like 05.)
- You must have a minimum of 5
employees.
- "Fire" one of your employees by
un-checking their Active field.
- Switch to the Design view and edit the Employees table
- Change the Default Value of HireDate to date()
- Go
back to the datasheet and add a brand new employee that you just hired today. Notice how the
default value automatically shows today's date.
- Create a new table in this database (from Design View) for your "Products". Provide these
fields:
- ProductID (datatype: autonumber)
- ProductCode (text)
- ProductName (text)
Save your table as "Products" and allow Access to designate
ProductID as your Primary Key.
- Edit your Product table in the Design View.
- Give reasonable Field Size limits to each of your fields
(for example, ProductCode should only be 5 characters).
- Use the Caption property to make your field names appear
friendlier when you are viewing your table, and later when you
create Forms and Reports.
- Now populate your Products table:
- Add your product names and codes.
- Product Codes are codes
or abbreviations for each of your products, so if one of your
products was a 12 Pack of Mountain Dew, the code might be MD12.
- You must have a minimum of 5 products.
- Exit from Access.
Upload your database file using Blackboard.
BE SURE YOUR
DATABASE IS CLOSED AND ACCESS IS CLOSED BEFORE YOU UPLOAD TO
BLACKBOARD!!
Additional Resources
Grading Guidelines
This assignment will be graded using the following guidelines:
|
Grading Rubric: |
Percentage |
Points |
|
|
|
|
|
On-Time |
25% |
7.5 |
|
Accuracy |
50% |
15 |
|
Style |
25% |
7.5 |
|
Total Points Possible |
100% |
30 |
|