lsp 121 access forms, reports, and switchboard. overview you’ve learned several of the basic...

33
LSP 121 Access Forms, Reports, and Switchboard

Post on 20-Dec-2015

215 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: LSP 121 Access Forms, Reports, and Switchboard. Overview You’ve learned several of the basic nuts-and-bolts of creating a database, entering data, and

LSP 121

Access Forms, Reports, and Switchboard

Page 2: LSP 121 Access Forms, Reports, and Switchboard. Overview You’ve learned several of the basic nuts-and-bolts of creating a database, entering data, and

Overview

• You’ve learned several of the basic nuts-and-bolts of creating a database, entering data, and querying it.

• Most people who interact with databases on a daily basis never get to this level.

• We need to give people a way to enter information into a database and get information out of a database (query) without having to go into the level of detail that we’ve learned in this course.

• Today we will learn how to do two things that will make it very easy for the average user to interact with a database:– Enter information using a ‘Form’– Retrieve information using a ‘Report’

Page 3: LSP 121 Access Forms, Reports, and Switchboard. Overview You’ve learned several of the basic nuts-and-bolts of creating a database, entering data, and

Access Forms

Page 4: LSP 121 Access Forms, Reports, and Switchboard. Overview You’ve learned several of the basic nuts-and-bolts of creating a database, entering data, and

• A graphical database such as Access allows you to – View records– Create new records– Modify existing records

using “Forms”.

Here is a view of one of the records from the Listings table in our Real Estate database.

We will create this form together today.

Page 5: LSP 121 Access Forms, Reports, and Switchboard. Overview You’ve learned several of the basic nuts-and-bolts of creating a database, entering data, and

Displaying Data – The Form

• One way to start a form is to use the Form Wizard– Create Forms More Forms Form Wizard– Let’s create a form for our Real Estate database,

for the Listings table (we’ll do a little bit of today’s activity but not all of it)

Page 6: LSP 121 Access Forms, Reports, and Switchboard. Overview You’ve learned several of the basic nuts-and-bolts of creating a database, entering data, and

Forms Continued

• Now go back into Design View to edit the form• Resize windows• Move fields around• Many more properties / controls available

Page 7: LSP 121 Access Forms, Reports, and Switchboard. Overview You’ve learned several of the basic nuts-and-bolts of creating a database, entering data, and

Toolbox of Basic Controls

• Checkbox controls – displays a check box; useful for Yes/No fields

• Label controls – headings, labels, captions, instructions• Text Box controls – data is displayed or entered here• Toggle buttons, option / radio buttons, check boxes• Option group – contains multiple toggle buttons• List box – a pull down menu which is always down• Combo box – a pull down menu which you must pull down,

and also lets you add an option that is not on the list• When working with forms, notice Table button (or Field List),

Toolbox button, and Wizard button in Toolbox

Page 8: LSP 121 Access Forms, Reports, and Switchboard. Overview You’ve learned several of the basic nuts-and-bolts of creating a database, entering data, and

Label

Checkbox

Textfield

Subform

List / Combo boxes

Some examples ofCONTROLS

Navigate between records

Page 9: LSP 121 Access Forms, Reports, and Switchboard. Overview You’ve learned several of the basic nuts-and-bolts of creating a database, entering data, and

Form practice,contd• Let’s try another example - WE MAY LEAVE THIS OUT IN SUMMER• Suppose you had a table containing information used to record people who wish to obtain a

bank loan such as a mortgage. • Create a table called ‘LoanApplicant’ with fields for ApplicantID (autoNumber, primary key),

FullName (text), Married (yes/no), Employed (yes/no), HomeOwner (yes/no), City (text), State (text),

– Go ahead and place this table in your RealEstate database for now even though it’s not really related to real estate.

• Now create a form from this table. For each field though, apply the following “properties” to each object (name, married, etc). To modify an object’s properties, click on Design Tools Property Sheet. In that sheet, you can use the select box to choose the field you wish to modify.

– Name text 50, Married Yes/No, Employed Yes/No, Home Owner Yes/No, City text 50, and State text 2

• Make Name a text box, Married a toggle button, Employed a check box, Home Owner an option button, City a combo box, and State a list box

– You can create this form within your Real Estate database even though there is no corresponding table. In the real world, though, forms are typically intended to work with a table that has already been created.

Page 10: LSP 121 Access Forms, Reports, and Switchboard. Overview You’ve learned several of the basic nuts-and-bolts of creating a database, entering data, and

Sample Form

• Click on Add Existing Fields button. If you can’t click on this, click on Properties and set Record Source to appropriate table

• Make sure Use Control Wizards button is pressed• Click on ab| (Text Box), then click and drag on Name

field• Click on Toggle Button, then click and drag on

Married field• Now put a caption or a picture in the toggle button

using Properties

Page 11: LSP 121 Access Forms, Reports, and Switchboard. Overview You’ve learned several of the basic nuts-and-bolts of creating a database, entering data, and

Properties

• Pretty much everything in Access has a list of properties associated with it

• To display properties, you can click on View Properties from the menu bar

• Or you can right click on an item• Let’s look at some properties

Page 12: LSP 121 Access Forms, Reports, and Switchboard. Overview You’ve learned several of the basic nuts-and-bolts of creating a database, entering data, and

Creating a Form Using Multiple Tables

• Create form for main table• On toolbox, click on subform button (make

sure the Wizard button is pressed)• Answer the wizard’s questions

Page 13: LSP 121 Access Forms, Reports, and Switchboard. Overview You’ve learned several of the basic nuts-and-bolts of creating a database, entering data, and

*** Forms Continued

• Note – if you change the data on the form, you are changing it in the database!

• You can use the form for entering new data• You can even create a form for a query.

However, if you enter new data on the query form, it changes the data in the table!

• Let’s stop here and try our activity

Page 14: LSP 121 Access Forms, Reports, and Switchboard. Overview You’ve learned several of the basic nuts-and-bolts of creating a database, entering data, and

REPORTS• Reports are yet another way to view the

information from a database. However, the operative word here is ‘view’. That is, reports are meant to be viewed/printed. They are not used for searching, entering, or editing information.

• Because reports are meant to be viewed, Access gives you many options for layout and design.

Page 15: LSP 121 Access Forms, Reports, and Switchboard. Overview You’ve learned several of the basic nuts-and-bolts of creating a database, entering data, and

Parts of a Report

• A report has the following parts:– Report header (one per report)– Page header (one per page)– Detail (line(s) of information)

• e.g. summary of each customer

– Page footer (one per page)– Report footer (one per report)

Page 16: LSP 121 Access Forms, Reports, and Switchboard. Overview You’ve learned several of the basic nuts-and-bolts of creating a database, entering data, and

ABC Monthly Report (page header)

Employee ID Expense Job TitleJones 123 $134.40 Engineer(detail section)Smith 234 $333.22 ProgrammerZygote 345 $123.33 Analyst

April 19, 2007 (page footer)

An Access Report

Page 17: LSP 121 Access Forms, Reports, and Switchboard. Overview You’ve learned several of the basic nuts-and-bolts of creating a database, entering data, and

Creating a Report• Use the Wizard to create a report• Here are the first questions:

Page 18: LSP 121 Access Forms, Reports, and Switchboard. Overview You’ve learned several of the basic nuts-and-bolts of creating a database, entering data, and

Creating a Report

• Do you want to group items in your report? For example, do you want to group by job title?

Page 19: LSP 121 Access Forms, Reports, and Switchboard. Overview You’ve learned several of the basic nuts-and-bolts of creating a database, entering data, and

Creating a Report

• Or maybe you want to group them by city?

Page 20: LSP 121 Access Forms, Reports, and Switchboard. Overview You’ve learned several of the basic nuts-and-bolts of creating a database, entering data, and

Creating a Report

• For the remaining fields, do you want them in any particular order?

Page 21: LSP 121 Access Forms, Reports, and Switchboard. Overview You’ve learned several of the basic nuts-and-bolts of creating a database, entering data, and

Creating a Report

• Finally, do you want a total of all salaries?• Click on Summary Options and get this:

Page 22: LSP 121 Access Forms, Reports, and Switchboard. Overview You’ve learned several of the basic nuts-and-bolts of creating a database, entering data, and

Creating a Report

• What kind of report layout would you like?

Page 23: LSP 121 Access Forms, Reports, and Switchboard. Overview You’ve learned several of the basic nuts-and-bolts of creating a database, entering data, and

Creating a Report

• Finally, you may have to go into Design View to “clean up” the report

Page 24: LSP 121 Access Forms, Reports, and Switchboard. Overview You’ve learned several of the basic nuts-and-bolts of creating a database, entering data, and
Page 25: LSP 121 Access Forms, Reports, and Switchboard. Overview You’ve learned several of the basic nuts-and-bolts of creating a database, entering data, and

Let’s Try an Example• Using the Real Estate database, create a report which uses the

fields from the Listings table and includes the Listing Number, Address, City, Frame Type and Taxes. • Group by City• Total and Average the Taxes (in the ‘Sort Order’ wizard window, click

on ‘Summary Information’)

• Important: If the area assigned to the design is not large enough to display the full value (e.g. if the area to display taxes is small), all you will see are number signs (e.g ####). In this case, you need to go to the ‘Design View’, single-click the appropriate box, and drag the right margin to make it wider.• You may encounter this when displaying the taxes in our example.

Page 26: LSP 121 Access Forms, Reports, and Switchboard. Overview You’ve learned several of the basic nuts-and-bolts of creating a database, entering data, and

The Switchboard

(optional)

Page 27: LSP 121 Access Forms, Reports, and Switchboard. Overview You’ve learned several of the basic nuts-and-bolts of creating a database, entering data, and

The Switchboard

• The Switchboard pulls it all together• After defining and populating the database,

creating the forms and reports, you can roll it all into one nice package to give to your client (user)

Page 28: LSP 121 Access Forms, Reports, and Switchboard. Overview You’ve learned several of the basic nuts-and-bolts of creating a database, entering data, and

Creating a Switchboard

Page 29: LSP 121 Access Forms, Reports, and Switchboard. Overview You’ve learned several of the basic nuts-and-bolts of creating a database, entering data, and

Creating a Switchboard

• Then click on the Yes button

Page 30: LSP 121 Access Forms, Reports, and Switchboard. Overview You’ve learned several of the basic nuts-and-bolts of creating a database, entering data, and

Creating a Switchboard

• Then click on Edit

Page 31: LSP 121 Access Forms, Reports, and Switchboard. Overview You’ve learned several of the basic nuts-and-bolts of creating a database, entering data, and

Creating a Switchboard

• To add buttons to the Switchboard, click on New

Page 32: LSP 121 Access Forms, Reports, and Switchboard. Overview You’ve learned several of the basic nuts-and-bolts of creating a database, entering data, and

Creating a Switchboard

• Then enter the name you want to appear on the Switchboard, what the Switchboard operation is, and where the form/report/query is coming from

• Let’s try an example

Page 33: LSP 121 Access Forms, Reports, and Switchboard. Overview You’ve learned several of the basic nuts-and-bolts of creating a database, entering data, and

Creating a Switchboard

• How do you make it so the switchboard is the first thing to open when a user runs Access?– Click on the Office button in upper-left corner– Click on Access Options in bottom right of this smaller

window– Click on Current Database on left margin– Under the Display Form option, select Switchboard

from the drop-down list– Now when someone opens this database, the

switchboard will automatically pop up