Access Forms 1. Forms Provide an easy way to Enter data Modify data View data 2

Embed Size (px)

Citation preview

  • Slide 1

Access Forms 1 Slide 2 Forms Provide an easy way to Enter data Modify data View data 2 Slide 3 Forms Forms can be sculpted to match any of a companys paper forms Can be structured to display large amount of data on one screen Entire customer record Forms can be designed to show multiple records Forms can be multi-page 3 Slide 4 Forms You can embed subforms into a form Allows you to work with data from two or more linked tables Forms do not store database information They display information from one or more tables Forms can contain code associated with form events Error trapping Automate certain types of data entry 4 Slide 5 Form Types Simple form Displays a single record A continuous form displays several records simultaneously on a form Multiple-page forms Forms with lots of information are designed as multiple-page forms information distributed across several form pages 5 Slide 6 Form Types Subform Multiple records (relationship table) Other Datasheet PivotTable PivotChart 6 Slide 7 Simple Data Entry Form 7 data entry form As form is filled in and the enter key is pressed or next record is clicked on, data will be written to the table. Slide 8 Form Navigation Navigation buttons located in the Toolbar facilitate moving between records in Form view Click the master form Next record button to advance to the next (empty in this case) record Click the First record button to move to and display the first record in the database through the form 8 Slide 9 9 warning dialog box for form Navigation buttons Slide 10 Continuous Form 10 Slide 11 11 message dialog box for form Slide 12 Form with subform 12 Main Form Subform Main Form Slide 13 Creating a Simple Form AutoForm Form wizard helps you create various types of forms Modify to suit your needs in design view Design View This is completely from scratch 13 Slide 14 Altering form in design View You can select an object and then drag it to another location on a form An objects sizing handles allow you to click and alter the objects shape You can right click to view an objects property sheet and to alter various properties of an object 14 Slide 15 Auto Form in 2K7 15 First, Highlight table that will be source Then, Click on form under the create tab Slide 16 Initial Design 16 Slide 17 Wizard 17 Slide 18 18 Slide 19 19 Initial Design Slide 20 Modify Layout in Design View 20 Slide 21 21 Highlight an item and right click to see property sheet Slide 22 Form Controls Controls can be incorporated into forms that can give users choices for data entry examples combo boxes, list boxes, and option buttons Tab Controls Other controls 22 Slide 23 23 combo box option buttons Slide 24 Form with Subform Many forms involve more than one table joined together Main Form displays one record Sub form contains multiple records from relationship table 24 Slide 25 25 Typical Tables in Sale Order/Sale Event Note: This example assumes we are selling inventory & we have a customer table in the Database Customer Table Inventory Table Sale order table & Sale table Sales order-Inventory relationship Table Sales-Inventory Relationship Table Sales Rep(employee) Table Slide 26 26 Sales Orders When customers decide to buy products or services, they send a purchase order The selling firm records the receipt of this order as a sales order Sales orders contain common components that identify: When the sales order occurred Which customer placed the order Which inventory item(s) the customer wishes to buy Slide 27 27 Slide 28 28 Sales Orders Firms record sales orders in a Sales Order table, which we name tblSalesOrder We use a foreign key link to the CustomerNumber field in the tblCustomer table to identify which customer placed the order We use a relationship table to model the many- to-many link between tblSalesOrder and tblInventory Slide 29 29 Sale Order Table Slide 30 30 The Sales Order Table Table that will store the basic information about the Sales Order entity. The table in this example requires five fields: A primary key, SalesOrderNumber A date, SalesOrderDate A foreign key link to tblCustomer, CustomerNumber A record of the customers purchase order number, CustomerPONumber Sales rep # Slide 31 31 The Sales Order-Inventory Table tblSalesOrder-Inventory, is a relationship table that records the many-to-many link between tblSalesOrder and tblInventory The Sales Order-Inventory table in this example needs four fields to store: The primary key of tblSalesOrder The primary key of tblInventory The quantity of each inventory item that appears on each sales order The price of each inventory item that appears on each sales order Slide 32 SaleOrder-Inventory Table 32 Slide 33 Sale Order Entry Form 33 Slide 34 Sale Order Entry Form 34 Slide 35 35 Sale Order Table Slide 36 36 SaleOrder-Inventory Table Slide 37 37 The Sales Order Entry form will used five tables to: Read from tblCustomer tblInventory tblSalesRep Write to tblSalesOrder tblSalesOrder-Inventory Slide 38 Sale entry form Typically sale entry form mirrors sale order entry form(using previous example) Read from tblCustomer tblInventory tblSalesRep Only difference would be tables written to tblSales tblSales-Inventory 38 Slide 39 Another example Northwind on next slide 39 Slide 40 Northwind Form with subform 40 Main Form Subform Main Form Primary Key Slide 41 41 Slide 42 42 Slide 43 43 Slide 44 Tables needed for Northwind order Form Customer table Read data from this table Products table Read data from this table Employee Table Read data from this table Order table Order data written to this table Order details table Order detail data written to this table 44 Slide 45 Purchase Order Entry Form 45 Slide 46 46 Purchase Order Entry Form Slide 47 47 Purchase Order Entry Form Slide 48 Tables needed for Purchase order Form Vendor table Read data from this table Materials Inventory table Read data from this table Purchase Order table Order data written to this table Purchase Order-materials Inventory table Order detail data written to this table 48 Slide 49 Auto form 2K3 Tables Select table that autoform will use Select Autoform Slide 50 Form Wizard 2K3 Forms Create form by using wizard Follow the prompts Slide 51 Form design issue Possible issues if two different groups need access to same table Initial Customer entry from Credit limit for each customer Two forms, one for each group Limit what fields they can access Set up controls that prevent them from altering form 51 Slide 52 Customer Data entry form 52 Do not allow customers reps access to credit limit field Slide 53 53 Tab stop set to NO Slide 54 Credit Dept. Data entry 54 Only field that credit department can access is the Credit Limit field Slide 55 55 Tab stops set to no for all fields except the credit limit field