1. Factory Access Accel. Introduction v1.021
Accelerated Introduction to Access
ModuleModule
Introduction to Access, Tables, and
External Data
P.O. Box 6142
Laguna Niguel, CA 92607
949-489-1472
http://www.d2associates.com
slides.1@dhdursoassociates.com
2. FactoryAccess Accel. Introduction v1.022
Module Outline
Part 1: Introduction & Tables
Part 2: External Data
Part 3: Relating Tables
Three parts:Three parts:
3. FactoryAccess Accel. Introduction v1.023
Module Hands On
– Create working folder with supplied files
– Create a database
– Create 3 tables (w/validation rules and masks)
– Populate tables
– Import and Export Tables
– Create permanent links
– Create a simple query
– Compute calculated field(s)
– Create a multi-table query with summary aggregates
Students “hands-on”:
4. Factory Access Accel. Introduction v1.024
Accelerated Introduction to Access
Part 1:Part 1:
Introduction to Access and Tables
5. FactoryAccess Accel. Introduction v1.025
But first - Create Folder
Create a folder yourname (or similar) in
My Documents – this is where your
database and other files will go.
Optionally, copy in the labor.txt and
employees.xls files from the instructor
supplied location or CD.
6. FactoryAccess Accel. Introduction v1.026
Access Modes
Menu-driven interface - Interact with a database
and its objects using menu commands
Program mode - Lets you store instructions in a VBA
program file
This course concentrates on the menu interface but
does cover macros which can be used to “program” a
series of actions
7. FactoryAccess Accel. Introduction v1.027
Database Terminology
Database – in Access a repository in which tables,
reports, queries, and other objects are stored
Table – stores facts about one subject (entity)
Record - contains related information about an
entity “instance”
Field - contains a fact about an entity
Relational Database - allows you to link records from
two or more tables based on the contents of a
common field. Access is a relational database.
8. FactoryAccess Accel. Introduction v1.028
Database Terminology (cont.)
Key - used to order, identify, and retrieve records
in the database
Primary key - unique identifier for a particular
record. Only one per table.
Index – like a book index. Speeds searches and
joins. Can have many per table.
Table structure - the arrangement of information
within a record, the type of characters, field
length, limitations, etc.
9. FactoryAccess Accel. Introduction v1.029
Database Terminology (cont.)
Object – used in database world as generic term for
queries, reports, indexes, tables, etc. Not the same
as programming object.
Form - paper-like method of accessing and entering
data in a table
Query – retrieves information from Access tables
Report - provides the ability to arrange table data
as well as to perform calculations and then print a
paper-based report
10. FactoryAccess Accel. Introduction v1.0210
Sample Application – Factory2000
Simple cost accounting
application
Employees work on work
orders
Clock labor hours for each
work order
11. FactoryAccess Accel. Introduction v1.0211
Recording Factory2000 Labor Hours
EmpNo fName lName Rate Wono Descr Hours
12 Bob Smith 15 A1 Casting 12
13 Mary Chavez 20 A1 Casting 22
14 Alicia Parks 25 B3 Ass’ly 15
14 Alicia Parks 25 C2 Screws 18
What problems do you see with this approach?
13. FactoryAccess Accel. Introduction v1.0213
Creating a Database
Ways to create a database
– Create a database using an Access
template or Wizard – (not always
recommended)
– Create a blank database and then insert
your own objects – we will use this
method in this course
14. FactoryAccess Accel. Introduction v1.0214
Creating an Access 2000 Database
Create the
database in
your desktop
folder with a
meaningful
name
15. FactoryAccess Accel. Introduction v1.0215
Creating a Table
Click new from tables tab
Naming a Table
– Up to 64 “standard” characters can be used
– Do not use an extension
– No leading spaces or control characters, in fact
try to avoid spaces altogether
Add fields one by one
Set Field Properties in Field Properties
box
16. FactoryAccess Accel. Introduction v1.0216
Designing Fields
Field Type – text, datetime, number, etc.
Field Width – 10 characters, etc.
Caption – “Column title” for display
Format – Determines how the field is displayed
(long date, short date, etc.)
Click toolbar key symbol to make primary key
Set indexed for secondary keys, required, etc.
21. FactoryAccess Accel. Introduction v1.0221
Labor Table Definition
EmpNo text(2), primary key
WoNo text(2), primary key
Start datetime, required
End datetime
Hours number(single,2)
(On your own)
Add captions, tooSave as tblLabor
22. FactoryAccess Accel. Introduction v1.0222
Field Validation & Masks
Add some validations
– Test a numeric field for > 0
– Try checking one field against another
– Etc.
Add captions if not added already
Add an input mask
Change a display format
Etc.
23. FactoryAccess Accel. Introduction v1.0223
Datasheets
Datasheet window - displays the contents of a table
in a spreadsheet-like format
– Each row contains a record
– Each column contains a field
Speedbar - appears at the bottom of the window
and is used to navigate through the records in a
table
29. FactoryAccess Accel. Introduction v1.0229
Printing a Table
Access allows you to create “quick and dirty”
reports by clicking the toolbar Print button
– A row/column presentation is used
– Field names appear along the top
– Records are rows
– Fields are columns
– A grid is printed around each field
30. FactoryAccess Accel. Introduction v1.0230
Quick Reports
Report Wizard
– Module 2 covers reports
– For now, be aware a quick report can be
produced using the report wizard
31. Factory Access Accel. Introduction v1.0231
Microsoft Access
Part 2Part 2
External Data
32. FactoryAccess Accel. Introduction v1.0232
Office Links
Publish it with MS Word
Analyze in MS Excel
Use Tools | Office Links or the
Toolbar
33. FactoryAccess Accel. Introduction v1.0233
Exporting a table
Very simple
Click File|Export (or save as)
Specify type: Access can
export to many types: Excel,
Text, etc.
34. FactoryAccess Accel. Introduction v1.0234
Exporting tables
Export Work_Orders to CSV
text file.
Note you can also export to
another Access table. Even
one elsewhere on a LAN!
35. FactoryAccess Accel. Introduction v1.0235
Using External Data
Two methods:
– Import the data into a new (or existing table) in your
database
– Link to the data. A table link appears in your
database but the data stays in the original file.
36. FactoryAccess Accel. Introduction v1.0236
Importing Files
Another very important feature
Start from new table dialog, pick
Import Table
It will start a wizard
Use advanced to select fields, etc.
Specifications can be saved for later
use
38. FactoryAccess Accel. Introduction v1.0238
Importing from a text file
Import the instructor-supplied
labor text file into the previously
created labor table
Save the specification
39. FactoryAccess Accel. Introduction v1.0239
Linking a table
Use new table dialog
Select Link Table
This will set up a connection to an
external table. It does not become
part of the Access database
Access can link to many types: Excel,
ODBC connection, etc.
41. FactoryAccess Accel. Introduction v1.0241
Link a table
Link the instructor-
supplied Employees
Excel
Give it a name like
Employees_xls
42. Factory Access Accel. Introduction v1.0242
Microsoft Access
Part 3Part 3
Relating Tables
43. FactoryAccess Accel. Introduction v1.0243
Relating Tables
Command sequence – Tools | Relationships
Parent table - table used as the main table
for a relationship
Child table - the related table, often has
several records for each record in the
parent table
44. FactoryAccess Accel. Introduction v1.0244
Referential Integrity
Orphan record - a child record without a
corresponding parent record
Referential integrity - makes certain that
related records are present
45. FactoryAccess Accel. Introduction v1.0245
Table Links
In this context means relate two or more
tables on columns of data
Permanent link –
– established using the Relationships command
– is always in effect once defined
Transient link - defined using the query-by-
example feature of Access
47. FactoryAccess Accel. Introduction v1.0247
Create Permanent Links
Link all Factory2000 tables
Enforce referential integrity
Normal, default joins for now
49. FactoryAccess Accel. Introduction v1.0249
Import Labor Table
Now import the instructor
supplied labor.txt file into
your labor table
Try changing an EmpNo or
WoNO to an invalid value
and see what happens
50. Factory Access Accel. Introduction v1.0250
Accelerated Introduction to Access
End of Module
P.O. Box 6142
Laguna Niguel, CA 92607
949-489-1472
http://www.d2associates.com
slides.1@dhdursoassociates.com