Software Catalog:
Hide the Details With Automation

Construct a Main Menu

The previous section finished our interactive application. To make it work the user must deal with the Microsoft Access database window and several confusing objects. To make the application more convenient and user-friendly we will build a main menu form to allow the user to simply push a button to access the wanted part of the application.

To automate an application we first need to look at all the tables, forms, queries, reports, macros, and programming code and decide exactly which of these objects the user will use directly. Then we build a form with command buttons linked to them. Here we go!

To begin open a new form in design view, but do not link it with any table or query. You will only see a gray grid in design view.

Several properties of the form need to be adjusted to give the appearance of a regular window instead of a data form. To get the form property sheet click on the form somewhere outside the grid. Here's a list of the properties and their values:

Property
Value
Record Source:
Filter:
Order By:
Allow Filters:
Caption:
Default View
Views Allowed
Allow Edits
Allow Deletions
Allow Additions
Data Entry
Control Box
Min Max Buttons
Close Button
(leave blank)
(leave blank)
(leave blank)
No
Main Menu
Single Form
Form
No
No
No
No
Yes
Both Enabled
Yes















Property
Value
Recordset Type:
Record Locks:
Scroll Bars:
Record Selectors:
Navigat. Buttons:
Dividing Lines
Auto Resize
Auto Center
Pop Up
Modal
Border Style
Whats This Button
Width
Picture
Snapshot
No Locks
Neither
No
No
No
No
Yes
No
No
Thin
No
4.75"
(none)

The picture property is where you can add a bitmap background. The remainder of the form properties are unchanged. There are a few properties of the detail section that need to be changed:
Height
Back Color
Special Effect
2.2917"
Click … and take your pick.)
Sunken

Now that we have a normal looking window instead a data window we can add the objects we need from the toolbox. Add a label near the upper left corner. Stretch it to make space for a large font, 3½" or 4" . Type Software Catalog , click outside the label and then select the label. Choose a nice looking font in a bold style and make the size about 20 points. Click the center alignment button.

Drop two more labels on the form, one under the word Software and the other under Catalog. Type Data Entry/Editing in the first label and Reports in the second. Select both labels and choose a font, make it bold, italics, and centered. You can leave the default 8 point font size.

Now choose the Command Button Tool from the toolbox and put 4 of them under the Data Entry/Editing label and 3 under the Reports label. Choose the first column of command buttons (shift-click them all or draw a marquee around them with your cursor). Choose Format | Align | Left. Repeat for the group under the Reports label. Be sure the side-by-side buttons are aligned horizontally (select Format | Align | Top).

Click in each button to put the cursor in the button to type a caption for each, or you can do it on the property sheet for each button. Type Manufacturers in the first, Programs in the second, Systems in the third, and Vendors fourth. Caption the report buttons Systems Software List, Mfg. Phone List, Mfg. Mail Labels . You will need to adjust the widths of these fields to about 1.3", adjust the Reports label to the same width.

In the associated property sheet, name each command button starting with Manufacturers name them as follows: cmdManufacturers, cmdPrograms, cmdSystems, cmdVendors, cmdSoftwareList, cmdMfgPhoneList, and cmdMfgMailLabels.

Add an image control to the lower right corner of the form. Click the ellipsis at the Picture property and navigate to a bitmap you would like to display on your form. I chose Software.BMP from the collection of clipart that comes with MS Office. On my machine the location is C:\Program Files\Microsoft Office\Clipart\Popular\Software.BMP.

Switching from to design view move things around until the appearance suits you. Then you're ready to write some macros to link the command buttons with the forms and reports.

Open a new macro. Choose OpenForm in the Action column and choose Manufacturer Entry / Edit in the Form Name field near the bottom of the window. Save as OpenManufacturersEntry . Close the macro window. Select cmdManufacturers go to the Event page of the property sheet. Select On Click and click on the … button, then select OpenManufacturersEntry. That is all there is to it! Test your work and save.

Now repeat the procedure for each of the remaining command buttons. Here's a summary:


































Macro Name
Macro Action
Form Name
Command Button
On Click
OpenProgramMaster
OpenForm
Program Master
cmdPrograms
OpenProgramMaster
Macro Name
Macro Action
Form Name
Command Button
On Click
OpenSystemsEntry
OpenForm
System Entry / Edit
cmdSystems
OpenSystemsEntry
Macro Name
Macro Action
Form Name
Command Button
On Click
OpenVendorsEntry
OpenForm
Vendors Entry / Edit
cmdVendors
OpenVendorsEntry
Macro Name
Macro Action
Report Name
View
Command Button
On Click
OpenSoftwareList
OpenReport
Systems Software List
Print Preview
cmdSoftwareList
OpenSoftwareList
Macro Name
Macro Action
Report Name
View
Command Button
On Click
OpenMfgPhoneList
OpenReport
Manufacturers Telephone List
Print Preview
cmdMfgPhoneList
OpenMfgPhoneList
Macro Name
Macro Action
Report Name
View
Command Button
On Click
OpenMfgMailLabels
OpenReport
Manufacturers Mail Labels
Print Preview
cmdMfgMailLabels
OpenMfgMailLabels

If a button doesn't work. First check to see that you linked the macro to the command button's On Click event.

***** NOT RECOMMENDED!! *****

To hide Microsoft Access details from the user we must write one more macro!








Macro Name
Macro Action
Macro Action
Macro Action
Command
Macro Action
Form Name
AutoExec
Echo
Hourglass
RunCommand
WindowHide
OpenForm
Main Menu

The AutoExec macro will execute automatically when you load the Software database, just like your AutoExec.BAT file (if it exists) runs when your computer boots. It will show the Main Menu window and give the user access to the forms and reports, but nothing else. To get to your database window and the remainder of the application use the Access menu choices Window | Unhide and choose Software from the popup menu. (Modern versions of Microsoft Access do not have the required Window menu to unhide the application objects.)

To hide the details:

  1. Click the Office Button in the upper left corner of the Access window.
  2. Click the Access Options button at the bottom of the pop-up menu.
  3. Click Current Database on the menu at left.
  4. Under Navigation, uncheck the Display Navigation Pane checkbox.
To unhide the Navigation Pane to give access to all the objects of your application, just go to the Current Database page, and check that checkbox to Display the Navigation Pane. No Autoexec macro is necessary.

If you have been working along you now have a fully working, user-friendly Microsoft Access Application. We have explored many of the features offered by this database manager. This should be enough to get you started developing your own applications.





Return to Beginning
Continue
Previous
This document authored by Pat Tyler
Copyright July 1997