80
Accelerated Computer Training for Working Professionals Factory 2010 Case Orange Coast Database Associates Course (800)355-9855 or http://ocdatabases.itgo.com Orange Coast Database Associates Specializing in Microsoft Office, Access, SQL, and related technologies Classes custom designed forWorking Professionals http://www.dhdursoassociates.com San Juan Capistrano, CA (800)355-9855 AIN100b Introduction to Microsoft Access Level 2

AIN100B Microsoft Access Level 2

Embed Size (px)

DESCRIPTION

AIN100B Microsoft Access course. covers external data, advanced queries, reports and forms and user navigation.

Citation preview

Page 1: AIN100B Microsoft Access Level 2

Accelerated Computer Training for Working Professionals Factory 2010 Case

Orange Coast Database Associates Course (800)355-9855 or http://ocdatabases.itgo.com

Orange CoastDatabase Associates

Specializing in Microsoft Office,

Access, SQL, and related technologiesClasses custom designed forWorking Professionals

http://www.dhdursoassociates.com

San Juan Capistrano, CA

(800)355-9855

AIN100b Introduction to MicrosoftAccess Level 2

Page 2: AIN100B Microsoft Access Level 2

Factory AIN100B1

AIN100B - Introduction to Access II

Quick introduction to Access forexperienced Windows users

P.O. Box 6142Laguna Niguel, CA 92607949-489-1472http://www.dhdursoassociates.com

FactoryAIN100B2

AIN100B - Introduction to Access II

Introduction (s) Facilities Course Packet (May vary by course and class)

– Student Questionnaire– Collaterals (Maps, Catalog, Etc.)– PowerPoint handouts for all sessions– Evaluation form in back– Training certificate

Page 3: AIN100B Microsoft Access Level 2

FactoryAIN100A3

FactoryAIN100A4

MS Access Introductory (100 Level)Curriculum

AIN100

AIA101

AMP110Macros

AIN104Reports& Forms

AIN102Queries

AIN100T Incl. A & B

Page 4: AIN100B Microsoft Access Level 2

Books

Microsoft Access Plain & Simple;Curtis Frye

Microsoft Access Bible; CaryPrague

Available from major booksellers

FactoryAIN100A5

FactoryAIN100B6

AIN100B – Introduction to Access II

Quick pace for experienced windows users

Assumes no prior knowledge of Access

End-user, not programmer, oriented

Somewhat structured towards personal use foranalysis and reporting

Two levels – Day 1 (AIN100A) and Day 2(AIN100B)

Page 5: AIN100B Microsoft Access Level 2

FactoryAIN100B7

AIN100B - Introduction to Access II

External Data

Reports

Forms

Advanced Queries

Macros

Switchboards (2007) orNavigation Forms (2010)

Course Topics:

FactoryAIN100B8

Introduction to Access

Industry Standard Approach:

Tables Table Designer

Queries Query designer

Reports Wizard then modify

Forms Wizard then modify

Macros Macro Designer

Access has many ways to accomplish tasks. As an acceleratedcourse we will cover only the most common.

Page 6: AIN100B Microsoft Access Level 2

FactoryAIN100B9

AIN100B - Introduction to Access II

2 Sessions

Lecture

Demo

Student “hands-on” - by the end of theclass the student will have constructed asmall, functional application

Exercises are cumulative – later examplesbuild on objects created earlier

Course Format:

FactoryAIN100B10

Database Design – Critical Topic

What do I want?– (Outputs)

What have I got?– (Inputs)

What do I need to do to getthere?– (Process)

Page 7: AIN100B Microsoft Access Level 2

FactoryAIN100B11

Define Your Needs First

Draw apicture

Write adescription

PRODUCTS

EMPLOYEESC.C.Toys

ORDERS

Note: we have a full day course (DBD201) on this important topic.

FactoryAIN100B12

AIN100B - Introduction to Access II

Session 1

– External Data

– Reports & Forms

Session 2

– Forms (cont’d)

– Automating Tasks

Course Schedule (3 hour sessions):

Page 8: AIN100B Microsoft Access Level 2

Factory Access Accel. Introduction v1.021

Introduction to Access

Module

Introduction to Access, ExternalData

P.O. Box 6142Laguna Niguel, CA 92607949-489-1472http://www.d2associates.com

FactoryAccess Accel. Introduction v1.022

Module Outline

Topic 1: Export tables

Topic 2: Import data

Topic 3: Link tables

Three short topics:

Page 9: AIN100B Microsoft Access Level 2

FactoryAccess Accel. Introduction v1.023

Module Hands On

– Export work_orders and employees tables

– Import work_orders text file

– Link employees excel file

Students “hands-on”:

FactoryAccess Accel. Introduction v1.024

Sample Application – Factory2000

Simple cost accountingapplication

Employees work on workorders

Clock labor hours for eachwork order

Page 10: AIN100B Microsoft Access Level 2

FactoryAccess Accel. Introduction v1.025

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?

FactoryAccess Accel. Introduction v1.026

Factory2000 Relational Database Structure

EmpNo fName lName Rate MgrNo

12 Bob Smith 15 13

13 Mary Chavez 20

14 Alicia Parks 25 12

EmpNo Wono Start End Hours

12 A1 1/1/01 1/31/01 20

14 C2 2/1/01 2/28/01 42

14 B3 1/1/01 2/28/01 40

employees

Labor

Wono Descr Std

A1 Casting 30

B3 Fitting 50

C2 Screws 70

Work_orders

Page 11: AIN100B Microsoft Access Level 2

FactoryAccess Accel. Introduction v1.027

Exporting a table

Very simple

Click File|Export (or save as)

Specify type: Access canexport to many types: Excel,Text, etc.

FactoryAccess Accel. Introduction v1.028

Exporting tables

Export Work_Orders to CSVtext file.

Export Employees to anExcel spreadsheet.

Note you can also export toanother Access table. Evenone elsewhere on a LAN!

Page 12: AIN100B Microsoft Access Level 2

FactoryAccess Accel. Introduction v1.029

Using External Data

Two methods:

– Import the data into a new (or existing table) in yourdatabase

– Link to the data. A table link appears in yourdatabase but the data stays in the original file.

FactoryAccess Accel. Introduction v1.0210

Importing Files

Another very important feature

Start from new table dialog, pickImport Table

It will start a wizard

Use advanced to select fields, etc.

Specifications can be saved for lateruse

Page 13: AIN100B Microsoft Access Level 2

FactoryAccess Accel. Introduction v1.0211

Importing a table from a Text File

Importing a Text File

FactoryAccess Accel. Introduction v1.0212

Importing from a text file

Import the instructor-suppliedlabor text file into the previouslycreated labor table

Save the specification

Page 14: AIN100B Microsoft Access Level 2

FactoryAccess Accel. Introduction v1.0213

Linking a table

Use new table dialog

Select Link Table

This will set up a connection to anexternal table. It does not becomepart of the Access database

Access can link to many types: Excel,ODBC connection, etc.

FactoryAccess Accel. Introduction v1.0214

Linking a table

Linking a Table

Page 15: AIN100B Microsoft Access Level 2

FactoryAccess Accel. Introduction v1.0215

Linking a table

Linking a Table

FactoryAccess Accel. Introduction v1.0216

Linking a table

Linking a Table

Page 16: AIN100B Microsoft Access Level 2

FactoryAccess Accel. Introduction v1.0217

Link a table

Link the EmployeesExcel

Give it a name likeEmployees_xls

Factory Access Accel. Introduction v1.0218

Introduction to Microsoft Access

[End of Module]

P.O. Box 6142Laguna Niguel, CA 92607949-489-1472http://www.d2associates.com

Module

Introduction to Access, ExternalData

Page 17: AIN100B Microsoft Access Level 2

Notes

19

Notes

20

Page 18: AIN100B Microsoft Access Level 2

Factory Access - Reports & Forms1

Microsoft Access

Module -

Reports

P.O. Box 6142Laguna Niguel, CA 92607949-489-1472http://www.d2associates.com

FactoryAccess - Reports & Forms2

Module Hands On

– Create a summary report

– Format the report

– Add a calculated field

– Add summary fields

– Add conditional formatting

– Sub-reports (optional) Create a sub-report

Create a master-detail report

Students “hands-on”:

Page 19: AIN100B Microsoft Access Level 2

FactoryAccess - Reports & Forms3

Creating reports

Two basic methods:– Report Wizard

– Report Designer

Common approach is to start w/the Wizard then modify the result

FactoryAccess - Reports & Forms4

Report Wizard

Building a Report by Using a Report Wizard

– Use the Report tab of the database window

– Can base report on table or query

– Report Wizard - a series of dialog boxes that stepsyou through the process of building a report

Page 20: AIN100B Microsoft Access Level 2

FactoryAccess - Reports & Forms5

FactoryAccess - Reports & Forms6

Report Wizard

After selecting the table or query you givethe Wizard additional information…

– Grouping – for summaries, etc.

– Sorting – for sort order within group, pluswhich summary function to use

– Format and style

Page 21: AIN100B Microsoft Access Level 2

FactoryAccess - Reports & Forms7

Report Wizard

Create a labor report

– Use qryLaborDetail query

– Select wono, empno, fname,lname, hours

– Group by wono

– Use summary options: sum hours,

– Layout and style to taste

– Save as rptLabor

FactoryAccess - Reports & Forms8

Report Design Window

Menu Bar and Toolbar Rulers - vertical and horizontal

Report Layout

Toolbox

Field List Box - used for adding fields to a reporttemplate

Properties Sheet or Section Detail Sheet - controls theappearance of a report object

Scroll Bars

Page 22: AIN100B Microsoft Access Level 2

FactoryAccess - Reports & Forms9

Report Designer

FactoryAccess - Reports & Forms10

Redesigning a Report

Able to move field and title boxes around thedesign template via a drag operation

Able to resize the report bands using selectionhandles

Able to add additional titles using label control

Able to align text as well as change the fontand size of type used

Can add background fill effects, etc.

Page 23: AIN100B Microsoft Access Level 2

FactoryAccess - Reports & Forms11

Report Designer

Open rptLabor in design view– Format headings

– Remove extra subtotal row andreduce band height

– Fill title with grey background

– Etc.

– Save with same name(rptLabor)

FactoryAccess - Reports & Forms12

Report Designer Results

Page 24: AIN100B Microsoft Access Level 2

FactoryAccess - Reports & Forms13

Report Designer

Adding Fields– Use toolbox, or

– Drag and drop from field list

– Set control source on property sheet if appropriate(see below)

– Put SQL function around the control source for aggregatefields

Two types– Bound

– Unbound (no control source)

FactoryAccess - Reports & Forms14

Report DesignerF

unct

ion

Page 25: AIN100B Microsoft Access Level 2

FactoryAccess - Reports & Forms15

Report Designer

Open the report Labor indesign view

– Add a cost column (unboundcontrol)

– Format to taste

– Save report as rptLaborCost

FactoryAccess - Reports & Forms16

Report Designer

One more change to Laborreport– Add group and grand totals to

labor cost for the report

– Add an unbound textboxcontrol

– Use a formula, =sum(…), asthe control source

– Save as rptLaborCost_2

Page 26: AIN100B Microsoft Access Level 2

FactoryAccess - Reports & Forms17

Labor report with Cost Column

FactoryAccess - Reports & Forms18

Conditional Formatting

Format, Conditional Formatting commandsfrom Menu Bar

Can be used for forms or reports– Examines the contents of a field

– Based upon field’s contents able to specify: Font/Font size/Font color

Background color

Text attributes (boldface, underline, italics)

Try flagging stdhrs >= 70

Page 27: AIN100B Microsoft Access Level 2

FactoryAccess - Reports & Forms19

Subreports

Can have sub reports added to a mainreport

– to show detail– To add related information such as customer data

on an invoice

First create the sub report Then create the main report and drag the

sub report and drop it in place, or Use the subform/sub-report control

FactoryAccess - Reports & Forms20

Page 28: AIN100B Microsoft Access Level 2

FactoryAccess - Reports & Forms21

Sub Reports

Create a subreport namedsrptLaborDetail_3

– Base on qryLaborDetail_3

– Be sure to use tabular format

– Eliminate extraneous titleinformation

FactoryAccess - Reports & Forms22

Labor Sub Report

Page 29: AIN100B Microsoft Access Level 2

FactoryAccess - Reports & Forms23

Subreports

Make sure you have a permanentlink between work_orders andqryLaborDetail_3

Create a main reportrptWork_Orders_Main

– Base on work_orders table

– Expand the detail band and drag thesubreport srptLaborDetail_3 intoposition

Format to taste

FactoryAccess - Reports & Forms24

Sub Reports

Drag new subreport to main report, or usesub/form subreport control

Save as rptWork_OrdersFull

Page 30: AIN100B Microsoft Access Level 2

FactoryAccess - Reports & Forms25

Full Work Orders Report Results

Factory Access - Reports & Forms26

Microsoft Access

[End of Module]P.O. Box 6142Laguna Niguel, CA 92607949-489-1472http://www.d2associates.com

Module -

Reports

Page 31: AIN100B Microsoft Access Level 2

Notes

FactoryAccess - Reports & Forms27

Notes

FactoryAccess - Reports & Forms28

Page 32: AIN100B Microsoft Access Level 2

Factory Access - Reports & Forms1

Introduction to Microsoft Access

Module -

Forms

P.O. Box 6142Laguna Niguel, CA 92607949-489-1472http://www.d2associates.com

FactoryAccess - Reports & Forms2

Module Hands On

– Build two simple data entry forms

– Create an unbound form

– Create a sub-form

– Build a master-detail form from above forms

– Add totals

Students “hands-on”:

Page 33: AIN100B Microsoft Access Level 2

FactoryAccess - Reports & Forms3

Forms

Form - provides for customized data entryinstead of using the datasheet window

Also used to establish criteria for reports andqueries

Found on the Forms tab of the databasewindow

Form Wizards - a series of dialog boxesprompting you about your form requirements

FactoryAccess - Reports & Forms4

Form Wizard

Specify source table or query, fields, etc. (again, notefields can be bound or unbound)

Generally pick columnar style

Modify or preview result

Numerous properties can be set– Format (Appearance, scroll bars, etc.)

– Data (recordsource, etc.)

– Event (These can call macros and program code)

– Other

Page 34: AIN100B Microsoft Access Level 2

FactoryAccess - Reports & Forms5

FactoryAccess - Reports & Forms6

Form Wizard(Instructor Led)

Build a simple data entry form basedon the employees table– Modify the form when click finish

– Set the caption property to “MaintainEmployee Information”

– Make text labels “semi-bold”

– Size the form as desired

– Set record selector to “NO” if desired

– Save as frmEmployees

Page 35: AIN100B Microsoft Access Level 2

FactoryAccess - Reports & Forms7

Basic Employees form

FactoryAccess - Reports & Forms8

Form Wizard(On your own)

Build a simple data entry form basedon the work_orders table– Modify the form when click finish

– Set the caption property to “WorkOrders”

– Make text labels “semi-bold”

– Size the form as desired

– Set record selector to “NO” if desired

– Save as frmWork_Orders

Page 36: AIN100B Microsoft Access Level 2

FactoryAccess - Reports & Forms9

Basic Work Orders Form

FactoryAccess - Reports & Forms10

Form Designer

Design surface for forms

Add controls from toolbox

Some controls themselves have wizards whichcan invoke certain actions (run query, openreport, etc)

Page 37: AIN100B Microsoft Access Level 2

FactoryAccess - Reports & Forms11

FactoryAccess - Reports & Forms12

Form Designer

Build a criteria selection form for theparameter query qryParam (use designview)

– Add an unbound control named txtOrderNo

– Make sure the control wizard button is depressed

– Add a button which will run the param query

– Run the form. What happened? Why?

– Save as frmParam

Page 38: AIN100B Microsoft Access Level 2

FactoryAccess - Reports & Forms13

Fix the query and form then rerun

Change the variable names to look at the form

FactoryAccess - Reports & Forms14

Criteria Selection Form Results

Page 39: AIN100B Microsoft Access Level 2

FactoryAccess - Reports & Forms15

Subforms

Same idea as sub reports

Main form uses parent table; sub form useschild table

Several ways to create them

– Create sub form first, drag and drop to main form

– Use subform/subreport control

– Create with form wizard directly

FactoryAccess - Reports & Forms16

Subforms

Same idea as sub reports

Main form uses parent table; sub form useschild table

Make sure you have a permanent link

Create sub form first, drag and drop to mainform

Can also create with form wizard directly

Page 40: AIN100B Microsoft Access Level 2

FactoryAccess - Reports & Forms17

Typical Subform

FactoryAccess - Reports & Forms18

Subforms

Create a subform namedsfrmLaborDetail

– Use the form wizard

– Base on qryLaborDetail_3 query

– Pick tabular style (like a table orspreadsheet grid)

Page 41: AIN100B Microsoft Access Level 2

FactoryAccess - Reports & Forms19

Labor Detail Subform

FactoryAccess - Reports & Forms20

Subforms

Modify the frmWork_Orders form. Itwill be the new main form

– Drag and drop the sub formsfrmLaborDetail

– Remove extraneous labels

– Size and format as you like

– Save as frmWork_OrdersDetail

Page 42: AIN100B Microsoft Access Level 2

FactoryAccess - Reports & Forms21

Placing a subform on a main form

FactoryAccess - Reports & Forms22

Note link master and link child

Page 43: AIN100B Microsoft Access Level 2

FactoryAccess - Reports & Forms23

Work Orders Detail Form

FactoryAccess - Reports & Forms24

Sub Forms via the Wizard

Sub Forms can also be built automatically

Select parent table fields

Then child table fields

The child table will go in the subform

Page 44: AIN100B Microsoft Access Level 2

FactoryAccess - Reports & Forms25

Main and sub forms via Wizard(Instructor Demonstration)

FactoryAccess - Reports & Forms26

Totals on Master-Detail Forms

Common to add totals– Total of invoice line items

– Total of purchase order line items

– Etc.

Several ways– Add a total field to the subform footer (simplest)

– Add a total field to the main report using a domain aggregate

– Add a total field to the main report using an SQL aggregate

– Probably others!

Page 45: AIN100B Microsoft Access Level 2

FactoryAccess - Reports & Forms27

Adding a total to a sub form

Works just like totals in reports

Add the total field in the footer

– Add the sum so that control source reads =sum([fieldname]) with the equals sign

If desired can hide the footer field and add afield to the main form that references the totalfield on the subform

FactoryAccess - Reports & Forms28

Add a total to a sub form

Use the sfrmLaborDetail

Save as sfrmLaborDetail_Total

Expand the footer and add a field forhours

In the control source make sureexpression is =sum([hours])

Now add the sub form to thefrmEmployees main form

Page 46: AIN100B Microsoft Access Level 2

FactoryAccess - Reports & Forms29

Master-detail form with total

FactoryAccess - Reports & Forms30

Domain Aggregates(Concept demonstration)

Similar to Spreadsheet functions

Will total, etc., values in a field across several rows(records)

Can be used to populate a control on a form; say totalsor counts of “columns” in a sub form

There are several: dlookup(), dsum(), dcount(), davg(),etc.

– Syntax: Dname(“fieldname”,”source”, “criteria”)

– Note: quotes are mandatory

Page 47: AIN100B Microsoft Access Level 2

FactoryAccess - Reports & Forms31

Domain Aggregates

Use builder to help build domain aggregates

FactoryAccess - Reports & Forms32

Work Orders Formw/ Domain Aggregate

Page 48: AIN100B Microsoft Access Level 2

Factory Access - Reports & Forms33

Introduction to Microsoft Access

[End of Module]P.O. Box 6142Laguna Niguel, CA 92607949-489-1472http://www.d2associates.com

Module -

Forms

Notes

FactoryAccess - Reports & Forms34

Page 49: AIN100B Microsoft Access Level 2

Notes

FactoryAccess - Reports & Forms35

Notes

FactoryAccess - Reports & Forms36

Page 50: AIN100B Microsoft Access Level 2

Factory Access - Automating Tasks1

Module - Automating the Application -

Advanced Queries, Macros, ControlWizards

P.O. Box 6142Laguna Niguel, CA 92607949-489-1472http://www.dhdursoassociates.com

Microsoft Access

FactoryAccess - Automating Tasks2

Module Outline

Part 1: Advanced Queries

Part 2: Macros

Part 3: Control Wizards

Three parts:

Page 51: AIN100B Microsoft Access Level 2

FactoryAccess - Automating Tasks3

Module Hands On

– Create action queries

Maketable

Append

Delete

– Create macros

Simple

Run from form

Add where criteria

Add a condition

– Use the control wizard to close a form

Students “hands-on”:

FactoryAccess - Automating Tasks4

MS Access Training

Part 1Advanced Queries

Page 52: AIN100B Microsoft Access Level 2

FactoryAccess - Automating Tasks5

Advanced Queries

Several types of special-use queries– Action

Make table*

Append*

Delete*

Update

– Other Pass-through, crosstab etc.

We will cover those with an *; others as time andinterest permit

Reached through Query menu bar when querydesigner is open

FactoryAccess - Automating Tasks6

Page 53: AIN100B Microsoft Access Level 2

FactoryAccess - Automating Tasks7

MakeTable Query

Allows you to create a new table based ona query

Can be output to current database oranother one

Very simple

– Design your query as you normally would

– Pull down the query menu and select maketable. Assign the new table name

FactoryAccess - Automating Tasks8

MakeTable Query

Create an extract of theEmployees table

– Save table as Temp_Employees

– Select MgrNo = 13

– Save your query asqryMake_Temp_Employees

Page 54: AIN100B Microsoft Access Level 2

FactoryAccess - Automating Tasks9

MakeTable Query Results

FactoryAccess - Automating Tasks10

Append Query

Appends records to an existing table

Design query then pull down query menu andselect table to append to

Must indicate destination field for each sourcefield in query. This is done in a new QBE gridrow.

Can have additional “criteria” fields with nodestination

Page 55: AIN100B Microsoft Access Level 2

FactoryAccess - Automating Tasks11

FactoryAccess - Automating Tasks12

Append Query

Create and execute an append query

Select from Employees all recordswith MgrNo =12

Append to table Temp_Employees

Save the query asqryAppend_Temp_Employees

Page 56: AIN100B Microsoft Access Level 2

FactoryAccess - Automating Tasks13

Append Query Results

FactoryAccess - Automating Tasks14

Delete Query

Deletes records from an existing table

Go to query design window then pulldown query menu and select table todelete from

Establish the criteria in the criteria row

Page 57: AIN100B Microsoft Access Level 2

FactoryAccess - Automating Tasks15

Delete Query

Delete from temp_employees

– All records with rate less than 20

FactoryAccess - Automating Tasks16

Delete Query Results

Page 58: AIN100B Microsoft Access Level 2

FactoryAccess - Automating Tasks17

Other Advanced Queries

Union – “Adds” results of two queries into one result

Update – Update records in an existing table

SQL Pass-through – Send an SQL statement directlyto “back-end” database (Oracle, DB2, etc.)

Crosstab – Creates a crosstab result (similar to aspreadsheet)

Etc.

Factory Access - Automating Tasks18

Microsoft Access

Part 2

Introduction toMacros

Page 59: AIN100B Microsoft Access Level 2

FactoryAccess - Automating Tasks19

Introduction to Macros

Two ways of “programming” a taskin Access– Macros

– Visual Basic for Applications (VBA)

We will cover Macros primarily

We will also take a look at controlwizards which do use VBA

FactoryAccess - Automating Tasks20

Introduction to Macros

Elements of Macros– Events – what “fires” the macro

– Actions – what the macro does

– Action arguments – control the specifics of the action

– Conditions – circumstance under which the macro “fires”

Macro design grid – how macro is defined

Page 60: AIN100B Microsoft Access Level 2

FactoryAccess - Automating Tasks21

FactoryAccess - Automating Tasks22

Introduction to Macros

Create and run a simple macro, mcrFirst,to become familiar with the concepts

– Action = msgbox

– Arguments: “Hello, Macro”

information type

title = “My First Macro”

Page 61: AIN100B Microsoft Access Level 2

FactoryAccess - Automating Tasks23

Designing the First Macro

FactoryAccess - Automating Tasks24

My First Macro

Page 62: AIN100B Microsoft Access Level 2

FactoryAccess - Automating Tasks25

Automating Import/Export withMacros

Can string together several macros one afterthe other

Useful to do an import (or links, even) followedby data manipulation

As an example we will automate our prior threeaction queries

FactoryAccess - Automating Tasks26

Import Macro

Design a simple macro toimport a table

Action is transfertext

Arguments are labor textfile to be imported

Save as mcrImport

Page 63: AIN100B Microsoft Access Level 2

FactoryAccess - Automating Tasks27

Designing Import Macro

FactoryAccess - Automating Tasks28

Macro “Programs”

Create a new macro to run the actionqueries created earlier

Use open query action

Use the action query name as theargument

Add a msgbox

Open the import table when done

Save as mcrActionQueries

Page 64: AIN100B Microsoft Access Level 2

FactoryAccess - Automating Tasks29

More on Macros

Macros can be invoked depending on“condition”

Uses a condition column

Macro will run iff condition is true

Macros can be run one after another like a“program”. Example:– Do a maketable query , then an append query from

a different file. I.E different downloads from an ERPsystem

FactoryAccess - Automating Tasks30

MS Access Training

Part 3Control Wizards

Page 65: AIN100B Microsoft Access Level 2

FactoryAccess - Automating Tasks31

Control Wizards

Will create program code for you to perform atask

Form operations

Report operations

Etc.

Invoked by making sure the wizard button isdepressed when adding a control

FactoryAccess - Automating Tasks32

UseWizard

Various Actions

Using the Control Wizard

Page 66: AIN100B Microsoft Access Level 2

FactoryAccess - Automating Tasks33

Form Events

Forms and controls have “events”

These “fire” on certain actions. Examples:

– Click a button (onclick event)

– Before table is updated (beforeupdate event)

– After table is updated (afterupdate event)

– Etc.

FactoryAccess - Automating Tasks34

Form Events (cont’d)

When an event “fires” can execute:

– VBA Code

– Macro

This provides a method for “running” anapplication

Page 67: AIN100B Microsoft Access Level 2

FactoryAccess - Automating Tasks35

Control wizards

Create a criteria selection form

Add a button to run the actionqueries

Add a button to close the form

Run the form

That’s it!

FactoryAccess - Automating Tasks36

Form with Button to Launch Macro

Page 68: AIN100B Microsoft Access Level 2

Factory Access - Automating Tasks37

Microsoft Access

End of Module

P.O. Box 6142Laguna Niguel, CA 92607949-489-1472http://www.d2associates.com

Notes

FactoryAccess - Automating Tasks38

Page 69: AIN100B Microsoft Access Level 2

Notes

FactoryAccess - Automating Tasks39

Notes

FactoryAccess - Automating Tasks40

Page 70: AIN100B Microsoft Access Level 2

Factory Access Navigation1

Module – Navigation

P.O. Box 6142Laguna Niguel, CA 92607949-489-1472http://www.d2associates.com

Microsoft Access

Access navigation

Newer Access 2010 databases use the newNavigation forms

Older MDB databases still have theSwitchboard Manager tool available

FactoryAccess Navigation2

Page 71: AIN100B Microsoft Access Level 2

Creating a Navigation form

Select the desired style

FactoryAccess Navigation3

Navigation Forms

Drag and drop forms and reports one by one

FactoryAccess Navigation4

Page 72: AIN100B Microsoft Access Level 2

Adjust properties

Adjust properties as desired and save asfrmNavigation

FactoryAccess Navigation5

Set startup options (File | Options)

Set the Access options to open the navigationform when it starts up

FactoryAccess Navigation6

Page 73: AIN100B Microsoft Access Level 2

FactoryAccess Navigation7

Navigation Form

Update your existingnavigation form for the newobjects created.

FactoryAccess Navigation8

Switchboards

Create via a switchboard manager tool

Creates a tree of launch forms – mainform is called switchboard and is placedwith your other form objects

Page 74: AIN100B Microsoft Access Level 2

FactoryAccess Navigation9

Launching Switchboard Manager

FactoryAccess Navigation10

Switchboard Manager

Yes – we want to create a new switchboard!

Page 75: AIN100B Microsoft Access Level 2

FactoryAccess Navigation11

Switchboard Manager

FactoryAccess Navigation12

Switchboards

Create a switchboard for yourapplication

Page 76: AIN100B Microsoft Access Level 2

FactoryAccess Switchboards13

Add a macro to minimize databasewindow

Create macro (add to mcrForm macro group)

Invoke on form load of switchboard form

FactoryAccess Switchboards14

Updated mcrForm

Page 77: AIN100B Microsoft Access Level 2

FactoryAccess Switchboards15

Add to main switchboard loadevent

FactoryAccess Switchboards16

Switchboard test

Close your database

Reopen your database – the database windowshould be minimized

Page 78: AIN100B Microsoft Access Level 2

Factory Access Navigation17

Microsoft Access

End of Module

P.O. Box 6142Laguna Niguel, CA 92607949-489-1472http://www.d2associates.com

Please fill out and turn in yourend-of-course evaluations.

Notes

FactoryAccess Navigation18

Page 79: AIN100B Microsoft Access Level 2

Notes

FactoryAccess Navigation19

Notes

FactoryAccess Navigation20

Page 80: AIN100B Microsoft Access Level 2

Accelerated Computer Training for Working Professionals

Orange Coast Database Associates Course (800)355-9855 or http://ocdatabases.itgo.com

Orange CoastDatabase Associates

Specializing in Microsoft Office,

Access, SQL, and related technologiesComputer Training, Programming & Consulting

32422 Alipaz St., Suite A-15

San Juan Capistrano, CA

(800)355-9855 (Toll Free) | (949)489-1472 (Direct) | (949)485-6284 (Fax)

http://www.dhdursoassociates.com | [email protected]

Accelerated Computer Training