Presentation is loading. Please wait.

Presentation is loading. Please wait.

1 All Powder Board and Ski Microsoft Access Workbook Chapter 6: Forms and Reports Jerry Post Copyright © 2007.

Similar presentations


Presentation on theme: "1 All Powder Board and Ski Microsoft Access Workbook Chapter 6: Forms and Reports Jerry Post Copyright © 2007."— Presentation transcript:

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

2 2 Form Types StyleStyle DescriptionCategory Customer Last Name First Name Phone Address City Ski Board Style Sale CustomerSalesperson ItemIDDescriptionPriceQuantityValue Main Grid Main and Subform

3 3 Customer Main Form Combo box Record navigation Text box Label

4 4 Action Start the form wizard Select the Customer table Transfer all columns to the right window Use the Columnar layout Select a style Enter a name for the form

5 5 Main Form Wizard Select table Select/transfer fields

6 6 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

7 7 Data Source Properties Record Source = Customer table Form propertiesControl properties Control Source = CustomerID column

8 8 Action Switch Customer form to design view Add a label as a form title Add a command button Select Record Operation/Delete Record Add a command button to insert records Run the form and test the buttons View/Tab Order and verify sequence Save the form

9 9 Adding Command Buttons

10 10 Initial Grid Form

11 11 Action Create a new form with the wizard Table: SkiBoardStyle Columns: All Select the Datasheet layout Test the form

12 12 Grid Form Wizard Datasheet style is simpler than Tabular Tabular style has more design options

13 13 Action Switch to form Design view Delete the box for Category Add a combo box Select the first lookup option Choose the ProductCategory table Choose the Category and CategoryDescription columns Set column widths Select the Category column Store value into the Category column Rename the combo box Set the tab order Run the form and test the combo box

14 14 Add a Combo Box Delete the text box Add a combo box

15 15 Combo Box Role SkiBoardStyle StyleDescCategory DownhillSki ProductCategory Board Boots Clothes Electronic Glasses Ski Display Select

16 16 Combo Box Runtime Click the arrow Select the item Chosen value is transferred to form

17 17 Action Create a new form with the wizard Sale table, all columns Customer table use name, phone, and columns Employee table, use the name SaleItem table, all columns except SaleID ItemModel table, use Category, ModelID, and ListPrice Finish the wizard and test the form

18 18 Main/Subform by Sale

19 19 Initial Sale Form Need combo box Fix layout and sizing Multiply price by quantityCalculate subtotal

20 20 Action Switch to Design view Replace CustomerID, EmployeeID, and PaymentMethod with combo boxes Use the Row Source property of the combo boxes to set a sort order Set tab order and run the form

21 21 Initial Sale Form Improvements

22 22 Most of the Sale Form Display the subtotal

23 23 Action Open the sub form in Design view Insert a combo box for the SKU Add a text box to compute Value=QuantitySold*SalePrice Add a text box to the footer to compute the subtotal: =Sum(QuantitySold*SalePrice) Set tab order Test the sub form calculations Open the main form in Design view Add subtotal text box and use the expression builder to copy the subtotal value from the subfrom subtotal Test the form

24 24 Expression Builder to Copy Subtotal Open the Sale form Select the subform Double click the subtotal control Formula to copy the subtotal value

25 25 Final Sale Form

26 26 Action Create a new report with the wizard Customer table, use all columns Sale table, use all columns SaleItem table, use all columns Verify the group breaks Click the Summary Options button Compute totals for the Quantity Finish the wizard and switch to design view

27 27 Customizing Form Properties Form properties Text box

28 28 Action Make a copy of the Customer form. In Design View, add a header. Drag the Customer title onto the header. Set the background color of the header to yellow.

29 29 Create the Customer Sales Report Select all columns from the Customer, Sale, and SaleItem tables Customer break Sale break SaleItem detail

30 30 Action Create a new report with the wizard

31 31 Report Summary Options Select this button to calculate subtotals easily

32 32 Summary Options

33 33 Initial Report Customer break Sale break SaleItem detail

34 34 Report Design Customer break Sale break SaleItem detail Value textbox properties

35 35 Action Delete some unnecessary columns Move items around to improve the look Add a text box in the Detail section called Value to compute [QuantitySold]*[SalePrice] Set currency format Edit the Sum calculations to be Sum([QuantitySold]*[SalePrice] Run the form and clean up the layout

36 36 Final Design Page break Correct total

37 37 Final Report (One Page)

38 38 Action Create a new query to total sales by customer Save the query Create a new report based on the query For the Customer group, set the Keep Together property to Whole Group Run the report

39 39 Customer Totals Without Items SELECT Customer.CustomerID, Customer.LastName, Customer.FirstName, Customer.Phone, Customer. , 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. , Sale.SaleID, Sale.SaleDate, Sale.ShipCity, Sale.ShipState ORDER BY Customer.LastName, Customer.FirstName;

40 40 Sales Total Design

41 41 Action Create a simple report based on the Customer table Create a Sale sub-report from the Sale and SaleItem tables, grouping it by SaleItem. Create a Rental sub-report from the Rental and RentalItem tables Open the Customer report in design view Drag and drop the two sub-reports onto the Detail section of the Customer report Use properties of the sub-reports to set the Link Child and Link Master Fields to CustomerID Run the report

42 42 Subreport: Sales and Rentals Subreport properties Link main customer report (master) to subreport (child)

43 43 Subreport Display

44 44 Action Create a blank form in Design view Set the properties to remove the scroll bars and navigation buttons Add command buttons to open other forms (Form Operations/Open Form) and reports Use colors and graphics to make the form appealing Run the form and test all buttons

45 45 Creating a Switchboard Form Start in design view Add command buttons Open forms or reports

46 46 Action Choose View/Toolbars/Customize On the Toolbars tab create a new toolbar Click the Commands tab Drag the main form icon onto the toolbar Add a Customers menu option and drag the customer forms and reports onto it Add the Help icon Test the toolbar

47 47 Creating Toolbars and Menus Create a new toolbar

48 48 Toolbars and Menus Drag commands onto the toolbar

49 49 Action Create at least three HTML help files for the All Powder forms using an HTML editor or Wordpad If necessary, download and install the HTML Help workshop Create a new project in the workshop Add the HTML files Edit the HTML files to add keywords Create the mapping file with a text editor and add it to the project Set project options to build the TOC and index files Compile and test the help file Edit the database forms and add the help file name and ContentID Run the form and press the F1 key to test the help files

50 50 HTML Help Form Help File AllPowder.chm HTML Topic Properties: Help File: AllPowder.chm Help Context ID: 1 1 Topic A 2 Topic B 3 Topic C 4 Topic D 5 Topic E 6 Topic F compile

51 51 HTML Help Files All Powder Board and Ski Shop Introduction to the All Powder Board and Ski Shop All Powder Board and Ski Shop sells and rents snowboards and skis for all levels of riders and skiers. The Board and Ski Shop Customers Sales