|
CSCI A114 / INFO I111
Lab Notes Six
First semester 2001-2002
|
Tutorial Project Six: MACROS, WIZARDS, SWITCHBOARDS.
PROJECT SIX: CREATING AN APPLICATION SYSTEM
USING
- MACROS,
- WIZARDS, AND
- THE SWITCHBOARD MANAGER
This
lab assignment is to be turned in (shown to the lab instructor next class period,
that is, on Friday. It is to be graded during the same class period and grades are
to be posted at the end of the day or Saturday but not later). The notes below contain
highlights from the lab manual, which contains the complete text. Please refer to the lab
manual for complete details. Do not use the notes below any more than a sketch of what
the lab should be.
Please save all the macros you create, so we can look at them.
Same goes for the switchboard pages and items.
.
The management of Bavant Marine Services is pleased with the tables, forms and reports that you have
created thus far. They have additional requests, however.
- They now realize they should have included
phone numbers for marinas in the database. They would like for you to add the phone number field to the
Marina table, the Billing Summary Report, and the Marina Update form. They would like to be able to type
only the digits in the phone number and and then have Access format the number appropriately. If the user
enters 6165552312, for example, Access will format the number as (616) 555-2312.
- Bavant is pleased
with the Marina Type combo box you placed in the Marina Update form, which allows users to select a marina
type from a list. They realized, however, that this combo box is not visible in Datasheet view.
- Finally,
they have heard about switchboard systems that enable a user to click a button or two to open any form or
table, preview any report, or print any report. They would like for you to create such a system for them
because they believe this will increase employee productivity.
Please start from the database you created for Lab Assignment 5 (which was Project 5).
Then create the Billing Summary report.
- Choose Tables, Marina, New Object: AutoForm, select Report, then Report Wizard, click OK.
- Select Marina Number, Name, Warranty, Non-warranty, push Next.
- No grouping levels (click Next), no sort order (click Next).
- Then choose Tabular layout and portrait orientation.
- Make sure "Adjust the field width so all fields fit on a page" is selected. Click Next.
- Choose Corporate style, click Next, type title
Billing Summary Report
- Click Finish, then if report appears for preview click Close when you're done previewing.
Then create the Marina Update form.
- Choose Tables, Marina, New Object, Form, Form Wizard.
- Add all fields except Marina Type and Tech Number.
- Choose Columnar layout, and Standard style, then type title
Marina Update Form
- Click Finish then close the form.
Now modify the form design as in project 4:
- Click Forms, right-click Marina Update Form, click Design View.
- Maximize the window if necessary. If a field box displays click its Close button. Dock toolbox if necessary.
- Move Warranty to the right, and place xNon-warranty under it.
- Click Text Box button on toolbox, then click under Non-warranty.
- Click inside text box and type
=[Warranty]+[Non-warranty]
- Place the new field properly, change its label to
Total Amount
- Change the format of the new field to Currency: right-click, Properties, Currency.
- Now make sure Control Wizards button is recessed, click Combo Box and place it on form under the new field.
- Select the "I will type in the values that I want", push Next, then type:
- Push Next, click store that value in this field: Marina Type, click Next, type label text:
Marina Type
- Click Finish, then place the field properly.
- Now click Combo Box in toolbox, place it under the previous one.
- Choose "I want the combo box to look up the values in a table or query", click Next.
- Click Technician table, Next, add: Tech Number, First Name, Last Name, click Next.
- Remove check mark on "Hide key column (recommended)" to make sure Tech Number displays.
- Resize columns properly, click Next, make sure Tech Number is selected, click Next.
- Click Store value in this field: Tech Number.
- Type label for the combo box: Technician Number.
- Click Finish, align the fields, we now add a title.
- Point to bottom border of the Form Header. Mouse pointer changes shape, drag the bottom lower.
- Click label in toolbox, place it in the Form Header, type title:
Marina Update Form
- Click outside the title, then right click it, Properties.
- Change Back Color to white, Fore Color to Blue, and Special Effect: Raised.
- Also change Font Size to 14 and Text Align to Distribute then close the sheet.
- Align, resize optimally, make sure all looks good. We now change tab stops.
- Right click Total Amount control, Properties, set Tab Stop to No. Close Prop sheet.
- Close and save the form. Use the form to see how it works.
You're now ready for Project Six.
1. Using Lookup Wizard
- Click Tables, right-click Marina, choose Design View.
- Click Data Type column of Marina Type and choose Lookup Wizard.
- Click the "I will type in the values that I want", then click Next.
- Type:
BIR, IWO, RSO, then click Next
- Make sure Marina Type is entered for the label, then click Finish.
2. Using Input Mask Wizard
- Click row selector for Marina Type, press INSERT. Add
Phone Number field.
- Data type for it should be Text, type Phone Number for description. Click Input Mask, Build (...).
- Make sure Phone Number is selected. If you're asked about saving the table say Yes.
- Click Next, click "With the symbols in the mask like this option button". Close, save.
- Enter some data using the input mask, see how it goes.
3. Using a Lookup Wizard field.
Open the Marina table in the datasheet view to see how it is.
4. Modifying a Report
- Click Reports, right-click Billing Summary Report, choose Design View, maximize.
- Select Warranty, Non-warranty in Page Header and Detail Section (use SHIFT). Make them all less wide.
- Enlarge Name in Page Header and Detail Section. Bring back the resized Warranty and Non-warranty controls.
- Click the Field List drag Phone Number in the Detail Section. Delete the label.
- Change Name to Name/Phone in Page Header. Close Field List.
- Click Text Box and place it in the Detail Section under Non-warranty.
- Right click new control and choose Properties, Control Source, then type
=[Warranty]+[Non-warranty]
- Change Format to Currency, then close Property sheet, then delete the label of the control.
- Add a label Total Amount in the Page Header section. View the report.
- Close and save the report.
5. Modifying the Form.
- Click Forms, right-click Marina Update Form, choose Design View, maximize window.
- Click Field List, add Phone Number under Zip Code. Align.
- View, close, save.
6. Changing the Tab Order.
In Design View right-click on the form, choose Tab Order. Click and drag selected rows.
7. Creating and Using Macros.
- Click Macros, New. First column is action column, second column is comment column.
- Add Echo, press F6 to move to arguments. Turn Echo On to off. Move to the Comment column and type:
Turn echo off to avoid screen flicker.
- Add the following in the same way:
Hourglass Turn on hourglass
OpenForm Open Marina Update Form
Hourglass Turn off hourglass
Echo Turn echo on
- Close, save, name: Open Marina Update Form.
8. Running a Macro
Click Macro, right-click the macro's name, choose Run.
9. Modifying a Macro.
- Click Macro, right-click Open Marina Update Form macro, choose Design View.
- Select fourth row, press INSERT. Add
Maximize Maximize the window
- Close and save.
10. Create Additional Macros as Indicated Below
| MACRO NAME |
ACTION |
ARGUMENT(S) |
COMMENT |
|
| Open Technician Master Form |
Echo |
Echo on: No |
Turn echo off to avoid screen flicker |
| |
Hourglass |
Hourglass on: Yes |
Turn on hourglass |
| |
Open Form |
Form Name: Technician Master Form |
Open Technician Master Form |
| |
Maximize |
|
Maximize the window |
| |
Hourglass |
Hourglass On: No |
Turn off hourglass |
| |
Echo |
Echo on: Yes |
Turn echo on |
|
| Open Marina Table |
Open Table |
Table Name: Marina |
Open Marina Table |
| |
|
View: Datasheet |
|
| |
Maximize |
|
Maximize the window |
|
| Open Technician Table | OpenTable | Table Name: Technician | Open Technician table |
| | | View: Datasheet | |
| | Maximize | | Maximize the window |
|
| Preview Billing Summary Report | OpenReport | Report Name: Billing Summary Report |
Preview Billing Summary Report
|
| | | View: Print Preview | |
| | Maximize | | Maximize the window |
|
| Print Billing Summary Report | Open Report | Report Name: Billing Summary Report |
Print Billing Summary Report
|
| | | View: Print | |
|
| Preview Marina Amount Report | OpenReport | Report Name: Marina Amount Report | Preview Marina Amount Report |
| | | View: Print | |
| | Maximize | | Maximize the window |
|
| Print Marina Amount Report | OpenReport | Report Name: Marina Amount Report | Print Marina Amount Report |
| | | View: Print | |
|
| Preview Technician / Marina Report | OpenReport |
Report Name: Technician / Marina Report
| Preview Technician / Marina Report |
| | | View: Print Preview | |
| | Maximize | | Maximize the window |
|
| Print Technician / Marina Report | OpenReport | Report Name: Technician / Marina Report |
Print Technician / Marina Report
|
| | View: print | | |
11. Creating and Using a Switchboard
- In the Database window click Tools, Database Utilities, SwitchBoard Manager.
- Click Yes to create a new SwitchBoard. Click New, type View Form, OK.
- Add
- View Table
- View Report
- Print Report
- With Main Switchboard selected click Edit. New, then enter:
Text Command Switchboard
View Form Go to Switchboard View Form
View Table Go to Switchboard View Table
View Report Go to Switchboard View Report
Print Report Go to Switchboard Print Report
Exit Application Exit Application N/A
- You're done with the Main Switchboard
Specification for Switchboard Pages and Items is included below:
Switchboard Page Switchboard Item Command Argument
Main Switchboard View Form Go to Switchboard Switchboard: View Form
View Table Go to Switchboard Switchboard: View Table
View Report Go to Switchboard Switchboard: View Report
Print Report Go to Switchboard Switchboard: Print Report
Exit Application Exit Application None
View Form Marina Update Form Run Macro Macro: Open Marina Update Form
Technician Master Form Run Macro Macro: Open Technician Master Form
Return to Main Switchboard Go to Switchboard Switchboard: Main Switchboard
View Table Marina Table Run Macro Macro: Open Marina Table
Technician Table Run Macro Macro: Open Technician Table
Return to Main Switchboard Go to Switchboard Switchboard: Main Switchboard
View Report View Billing Summary Report Run Macro Macro: Preview Billing Summary Report
View Marina Amount Report Run Macro Macro: Preview Marina Amount Report
View Technician/Marina Report Run Macro Macro: Preview Technician/Marina Report
Return to Main Switchboard Go to Switchboard Switchboard: Main Switchboard
Print Report Print Billing Summary Report Run Macro Macro: Print Billing Summary Report
Print Marina Amount Report Run Macro Macro: Print Marina Amount Report
Print Technician/Marina Report Run Macro Macro: Print Technician/Marina Report
Return to Main Switchboard Go to Switchboard Switchboard: Main Switchboard
12. Using a Switchboard.
To use the switchboard click the Forms object, right-click the switchboard, click Open.
Last updated: Sep 19, 2001 by Adrian German for
A114/I111