ACC: ShowToolbar May Not Show Library Database Custom ToolbarsID: Q153673
|
Advanced: Requires expert coding, interoperability, and multiuser skills.
The ShowToolbar action does not show custom toolbars that are stored in
library databases, unless the library database is loaded as an add-in.
Microsoft Access version 2.0 and Microsoft Access version 7.0 or later differ in the way they load library databases. For performance reasons, Microsoft Access 7.0 or later does not load a library database into memory until code in an active application calls that library. Code in the library database can open objects, such as forms and reports, but the ShowToolbar action will not show or hide a toolbar unless the library database was loaded as an add-in.
The following example creates a database that can be loaded with the Add-in
Manager:
Table: UsysRegInfo
----------------------------
Field Name: Subkey
Data Type: Text
Field Size: 255
Field Name: Type
Data Type: Number
Field Size: Long Integer
Field Name: ValName
Data Type: Text
Field Size: 255
Field Name: Value
Data Type: Text
Field Size: 255
HKEY_CURRENT_ACCESS_PROFILE\Menu Add-Ins\Custom Toolbars
Subkey Type ValName Value
----------- ---- ------- -----
(see above) 0
(see above) 1 Expression =LoadToolbars()
(see above) 1 Library |ACCDIR\Toolbars.mda
Function LoadToolbars()
DoCmd.ShowToolbar "NewBar"
End Function
Function LoadToolbars()
docmd.ShowToolBar "NewBar"
End Function
?LoadToolbars()
Run-time error '2094':
Microsoft Access can't find the toolbar 'NewBar.'
"Building Applications with Microsoft Access for Windows 95", Chapter 12,
"Using Library Databases and Dynamic-Link Libraries", page 295, and Chapter
16, "Creating Wizards, Builders, and Add-ins", pages 359-375
For more information about creating and testing Add-ins, please see the
following article in the Microsoft Knowledge Base:
Q143270 ACC95: Creating and Testing Add-ins Paper Available on MSL
For more information about the UsysRegInfo table, search on "USysRegInfo"
using the Microsoft Access for Windows 95 Help Index.
For more information about using Utility Toolbars, search on "Utility
Toolbars," using the Microsoft Access for Windows 95 Help Index.
Additional query words: Run-time add-in
Keywords : kberrmsg kbusage GnlApp
Version : 7.0, 97
Platform : WINDOWS
Issue type : kbprb
Last Reviewed: April 29, 1999