37
1 All Powder Board and Ski Microsoft Access Workbook Chapter 6: Forms, Reports, and Applications Jerry Post Copyright © 2003

1 All Powder Board and Ski Microsoft Access Workbook Chapter 6: Forms, Reports, and Applications Jerry Post Copyright © 2003

Embed Size (px)

Citation preview

Page 1: 1 All Powder Board and Ski Microsoft Access Workbook Chapter 6: Forms, Reports, and Applications Jerry Post Copyright © 2003

1

All Powder Board and Ski

Microsoft Access WorkbookChapter 6: Forms, Reports, and ApplicationsJerry PostCopyright © 2003

Page 2: 1 All Powder Board and Ski Microsoft Access Workbook Chapter 6: Forms, Reports, and Applications Jerry Post Copyright © 2003

2

Form Types

Style Style Description CategoryCustomer

Last NameFirst NamePhoneAddressCity

Ski Board Style

Sale

Customer Salesperson

ItemID Description Price Quantity Value

Main

Grid

Main and

Subform

Page 3: 1 All Powder Board and Ski Microsoft Access Workbook Chapter 6: Forms, Reports, and Applications Jerry Post Copyright © 2003

3

Customer Main Form

Combo box

Record navigation

Text boxLabel

Page 4: 1 All Powder Board and Ski Microsoft Access Workbook Chapter 6: Forms, Reports, and Applications Jerry Post Copyright © 2003

4

Main Form Wizard

Select table Select/transfer fields

Page 5: 1 All Powder Board and Ski Microsoft Access Workbook Chapter 6: Forms, Reports, and Applications Jerry Post Copyright © 2003

5

Form Design View

Toolbox to add controls

Properties to control objects

Right click to open control properties

Right click to open form properties

Switch to design or display view

Field List Box

Page 6: 1 All Powder Board and Ski Microsoft Access Workbook Chapter 6: Forms, Reports, and Applications Jerry Post Copyright © 2003

6

Data Source Properties

Record Source = Customer table

Form properties Control properties

Control Source = CustomerID column

Page 7: 1 All Powder Board and Ski Microsoft Access Workbook Chapter 6: Forms, Reports, and Applications Jerry Post Copyright © 2003

7

Adding Command Buttons

Page 8: 1 All Powder Board and Ski Microsoft Access Workbook Chapter 6: Forms, Reports, and Applications Jerry Post Copyright © 2003

8

Initial Grid Form

Page 9: 1 All Powder Board and Ski Microsoft Access Workbook Chapter 6: Forms, Reports, and Applications Jerry Post Copyright © 2003

9

Grid Form Wizard

Datasheet style is simpler than Tabular

Tabular style has more design options

Page 10: 1 All Powder Board and Ski Microsoft Access Workbook Chapter 6: Forms, Reports, and Applications Jerry Post Copyright © 2003

10

Add a Combo Box

Delete the text box

Add a combo box

Page 11: 1 All Powder Board and Ski Microsoft Access Workbook Chapter 6: Forms, Reports, and Applications Jerry Post Copyright © 2003

11

Combo Box Role

SkiBoardStyle

Style Desc Category

Downhill Ski

ProductCategory

BoardBootsClothesElectronicGlassesSki

Display

Select

Page 12: 1 All Powder Board and Ski Microsoft Access Workbook Chapter 6: Forms, Reports, and Applications Jerry Post Copyright © 2003

12

Combo Box Runtime

Click the arrow

Select the item

Chosen value is transferred to form

Page 13: 1 All Powder Board and Ski Microsoft Access Workbook Chapter 6: Forms, Reports, and Applications Jerry Post Copyright © 2003

13

Main/Subform by Sale

Page 14: 1 All Powder Board and Ski Microsoft Access Workbook Chapter 6: Forms, Reports, and Applications Jerry Post Copyright © 2003

14

Initial Sale Form

Need combo box

Fix layout and sizing

Multiply price by quantity Calculate subtotal

Page 15: 1 All Powder Board and Ski Microsoft Access Workbook Chapter 6: Forms, Reports, and Applications Jerry Post Copyright © 2003

15

Initial Sale Form Improvements

Page 16: 1 All Powder Board and Ski Microsoft Access Workbook Chapter 6: Forms, Reports, and Applications Jerry Post Copyright © 2003

16

Most of the Sale Form

Display the subtotal

Page 17: 1 All Powder Board and Ski Microsoft Access Workbook Chapter 6: Forms, Reports, and Applications Jerry Post Copyright © 2003

17

Expression Builder to Copy Subtotal

Open the Sale form

Select the subform

Double click the subtotal control

Formula to copy the subtotal value

Page 18: 1 All Powder Board and Ski Microsoft Access Workbook Chapter 6: Forms, Reports, and Applications Jerry Post Copyright © 2003

18

Final Sale Form

Page 19: 1 All Powder Board and Ski Microsoft Access Workbook Chapter 6: Forms, Reports, and Applications Jerry Post Copyright © 2003

19

Create the Customer Sales Report

Select all columns from the Customer, Sale, and SaleItem tables

Customer break

Sale break

SaleItem detail

Page 20: 1 All Powder Board and Ski Microsoft Access Workbook Chapter 6: Forms, Reports, and Applications Jerry Post Copyright © 2003

20

Report Summary Options

Select this button to calculate subtotals easily

Page 21: 1 All Powder Board and Ski Microsoft Access Workbook Chapter 6: Forms, Reports, and Applications Jerry Post Copyright © 2003

21

Summary Options

Page 22: 1 All Powder Board and Ski Microsoft Access Workbook Chapter 6: Forms, Reports, and Applications Jerry Post Copyright © 2003

22

Initial Report

Customer break

Sale break

SaleItem detail

Page 23: 1 All Powder Board and Ski Microsoft Access Workbook Chapter 6: Forms, Reports, and Applications Jerry Post Copyright © 2003

23

Report Design

Customer break

Sale break

SaleItem detail

Value textbox properties

Page 24: 1 All Powder Board and Ski Microsoft Access Workbook Chapter 6: Forms, Reports, and Applications Jerry Post Copyright © 2003

24

Final Design

Page break

Correct total

Page 25: 1 All Powder Board and Ski Microsoft Access Workbook Chapter 6: Forms, Reports, and Applications Jerry Post Copyright © 2003

25

Final Report (One Page)

Page 26: 1 All Powder Board and Ski Microsoft Access Workbook Chapter 6: Forms, Reports, and Applications Jerry Post Copyright © 2003

26

Customer Totals Without Items

SELECT Customer.CustomerID, Customer.LastName, Customer.FirstName, Customer.Phone, Customer.EMail, Sale.SaleID, Sale.SaleDate, Sale.ShipCity, Sale.ShipState, Sum([SalePrice]*[QuantitySold]) AS [Value]

FROM (Customer INNER JOIN Sale ON Customer.CustomerID = Sale.CustomerID) INNER JOIN SaleItem ON Sale.SaleID = SaleItem.SaleID

GROUP BY Customer.CustomerID, Customer.LastName, Customer.FirstName, Customer.Phone, Customer.EMail, Sale.SaleID, Sale.SaleDate, Sale.ShipCity, Sale.ShipState

ORDER BY Customer.LastName, Customer.FirstName;

Page 27: 1 All Powder Board and Ski Microsoft Access Workbook Chapter 6: Forms, Reports, and Applications Jerry Post Copyright © 2003

27

Sales Total Design

Page 28: 1 All Powder Board and Ski Microsoft Access Workbook Chapter 6: Forms, Reports, and Applications Jerry Post Copyright © 2003

28

Subreport: Sales and Rentals

Subreport properties

Link main customer report (master) to subreport (child)

Page 29: 1 All Powder Board and Ski Microsoft Access Workbook Chapter 6: Forms, Reports, and Applications Jerry Post Copyright © 2003

29

Subreport Display

Page 30: 1 All Powder Board and Ski Microsoft Access Workbook Chapter 6: Forms, Reports, and Applications Jerry Post Copyright © 2003

30

Creating a Switchboard Form

Start in design view

Add command buttons

Open forms or reports

Page 31: 1 All Powder Board and Ski Microsoft Access Workbook Chapter 6: Forms, Reports, and Applications Jerry Post Copyright © 2003

31

Creating Toolbars and Menus

Create a new toolbar

Page 32: 1 All Powder Board and Ski Microsoft Access Workbook Chapter 6: Forms, Reports, and Applications Jerry Post Copyright © 2003

32

Toolbars and Menus

Drag commands onto the toolbar

Page 33: 1 All Powder Board and Ski Microsoft Access Workbook Chapter 6: Forms, Reports, and Applications Jerry Post Copyright © 2003

33

HTML Help

Form

Help File

AllPowder.chm

HTML Topic

HTML Topic

HTML Topic

HTML Topic

HTML Topic

HTML Topic

Properties:

Help File: AllPowder.chm

Help Context ID: 1

1 Topic A2 Topic B3 Topic C4 Topic D5 Topic E6 Topic F

compile

Page 34: 1 All Powder Board and Ski Microsoft Access Workbook Chapter 6: Forms, Reports, and Applications Jerry Post Copyright © 2003

34

HTML Help Files<Object type="application/x-oleobject" classid="clsid:1e2a7bd0-dab9-11d0-b93a-00c04fc99f9e"> <PARAM name="Keyword" value="Contents"> <PARAM name="Keyword" value="Introduction"> <PARAM name="Keyword" value="Start"> <PARAM name="Keyword" value="Management"></OBJECT><HTML><HEAD><TITLE>All Powder Board and Ski Shop</TITLE><LINK rel="stylesheet" type="text/css" href="Styles.css"></HEAD><BODY><H1>Introduction to the All Powder Board and Ski Shop</H1><TABLE><TR><TD><IMG SRC='BoardLogo1.gif' border='0'></TD><TD>All Powder Board and Ski Shop sells and rents snowboards and skis for all levels of riders and skiers.</TD></TR></TABLE><H2>The Board and Ski Shop</H2><UL><LI><A HREF=’Customers.html'>Customers</A></LI><LI><A HREF=’Sales.html'>Sales </A></LI></UL></BODY></HTML>

Page 35: 1 All Powder Board and Ski Microsoft Access Workbook Chapter 6: Forms, Reports, and Applications Jerry Post Copyright © 2003

35

Topics Map File

#define AllPowder 100

#define Customers 10000

#define Sales 20000

Page 36: 1 All Powder Board and Ski Microsoft Access Workbook Chapter 6: Forms, Reports, and Applications Jerry Post Copyright © 2003

36

Help Compiler and File

Page 37: 1 All Powder Board and Ski Microsoft Access Workbook Chapter 6: Forms, Reports, and Applications Jerry Post Copyright © 2003

37

Help File on Access Form

File name

Topic number