1 All Powder Board and Ski Microsoft Access Workbook Chapter 6: Forms, Reports, and Applications...

Preview:

Citation preview

1

All Powder Board and Ski

Microsoft Access WorkbookChapter 6: Forms, Reports, and ApplicationsJerry PostCopyright © 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

3

Customer Main Form

Combo box

Record navigation

Text boxLabel

4

Main Form Wizard

Select table Select/transfer fields

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

6

Data Source Properties

Record Source = Customer table

Form properties Control properties

Control Source = CustomerID column

7

Adding Command Buttons

8

Initial Grid Form

9

Grid Form Wizard

Datasheet style is simpler than Tabular

Tabular style has more design options

10

Add a Combo Box

Delete the text box

Add a combo box

11

Combo Box Role

SkiBoardStyle

Style Desc Category

Downhill Ski

ProductCategory

BoardBootsClothesElectronicGlassesSki

Display

Select

12

Combo Box Runtime

Click the arrow

Select the item

Chosen value is transferred to form

13

Main/Subform by Sale

14

Initial Sale Form

Need combo box

Fix layout and sizing

Multiply price by quantity Calculate subtotal

15

Initial Sale Form Improvements

16

Most of the Sale Form

Display the subtotal

17

Expression Builder to Copy Subtotal

Open the Sale form

Select the subform

Double click the subtotal control

Formula to copy the subtotal value

18

Final Sale Form

19

Create the Customer Sales Report

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

Customer break

Sale break

SaleItem detail

20

Report Summary Options

Select this button to calculate subtotals easily

21

Summary Options

22

Initial Report

Customer break

Sale break

SaleItem detail

23

Report Design

Customer break

Sale break

SaleItem detail

Value textbox properties

24

Final Design

Page break

Correct total

25

Final Report (One Page)

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;

27

Sales Total Design

28

Subreport: Sales and Rentals

Subreport properties

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

29

Subreport Display

30

Creating a Switchboard Form

Start in design view

Add command buttons

Open forms or reports

31

Creating Toolbars and Menus

Create a new toolbar

32

Toolbars and Menus

Drag commands onto the toolbar

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

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>

35

Topics Map File

#define AllPowder 100

#define Customers 10000

#define Sales 20000

36

Help Compiler and File

37

Help File on Access Form

File name

Topic number

Recommended