home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Media Share 9
/
MEDIASHARE_09.ISO
/
dbase
/
acessq_a.zip
/
Q88907.TXT
< prev
next >
Wrap
Text File
|
1992-11-01
|
4KB
|
114 lines
How to Modify the Toolbar in Microsoft Access
Summary:
Although Microsoft Access does not include any end-user features for
modifying the toolbar at the top of the screen, you can modify the
toolbar if you know how to design a form and write Access Basic code.
This article discusses where toolbars are stored, how they work, and
how you can modify them.
NOTE: Modification of the toolbar was not intentionally designed into
Microsoft Access, so you may run into situations where your
modifications do not work. Test your modifications on noncritical
databases, since making these modifications is not guaranteed to work
correctly in every instance.
This article assumes that you have some experience with designing
forms and writing procedures in Access Basic.
More Information:
The various toolbars that appear when you are using Microsoft Access
are nothing more than forms stored in a database--the same kind of
forms that you create in Microsoft Access. These forms are stored in
UTILITY.MDA, a system database file that is loaded into memory when
you start Microsoft Access.
You cannot simply start Microsoft Access and open UTILITY.MDA to
modify these forms, however. This is because UTILITY.MDA is loaded as
a library database when you are using Microsoft Access, and Microsoft
Access does not allow you to open a library database while it is
active. To work around this, do the following:
1. Quit Microsoft Access if you have it open and make sure that no
instances of Microsoft Access are active.
2. Choose the MS-DOS Prompt icon in Program Manager and type the
following commands at the MS-DOS command prompt (the example below
assumes that your Microsoft Access system files are stored in a
directory called C:\ACCESS):
C:>CD \ACCESS
C:\ACCESS>COPY UTILITY.MDA UTILITY.NEW
3. Start Microsoft Access.
At this point, you can begin modifying the toolbars in UTILITY.NEW.
Open UTILITY.NEW as a database (a couple alerts will appear about
loading duplicate procedure names; ignore these alerts by choosing the
OK button). In the Database window, switch to Form view and note the
names of the forms. The forms in the Database window that end with the
characters "TB" are toolbar forms. At this point, you can open a
toolbar form and make a modification. After the modification is made,
you can change a setting in your MSACCESS.INI file that will force
Microsoft Access to use UTILITY.NEW instead of UTILITY.MDA as its
utility database.
It is important to point out that any functionality you add to new
controls on the toolbars must be supported by Access Basic--do not use
macros, as they will not work for this purpose.
The example below illustrates how you can add a toolbar button to your
form design toolbar that will toggle the toolbox on and off:
1. Open the form called FDTB in design mode. This is the toolbar that
appears when you bring up a form in design mode as you are doing
at this point.
2. Add a small command button next to right of the "paint palette"
toolbar button on the form. Make sure your button does not overlap
any other controls and that it does not alter the height of the
form.
3. For the button's OnPush property, specify:
=ToggleToolBox()
4. Save and close the form.
5. Create a new module called NewToolBarFunctions and add the
following function:
Function ToggleToolBox ()
DoCmd DoMenuItem 3, 2, 8
' The DoCmd command above invokes the forms design menu item
' View->Toolbox
End Function
6. Save and close the module and close the database.
7. Quit Microsoft Access.
8. From Program Manager, open Notepad.
9. In NotePad, open the file MSACCESS.INI from your Windows program
directory.
10. In MSACCESS.INI, locate the [Options] section and modify the
UtilityDB= line to read:
UtilityDB=C:\ACCESS\UTILITY.NEW
11. Save and close MSACCESS.INI and start Microsoft Access.
12. Open any database, and open any form in design mode. Note that the
button you added appears in the toolbar. Click the button to turn
the toolbox on and off.
In the same way you modified your form design toolbar using the steps
above, you can make other modifications to add functionality to your
Microsoft Access toolbars.