Microsoft Access 2010 Bible

(Rick Simeone) #1

Part IV: Professional Database Development


924


TABLE 26.4

Start-up Option Properties of the Application Object


Startup Option Property to Set Data Type
Application title AppTitle dbText
Application icon AppIcon dbText
Display form StartupForm dbText
Display database window StartupShowDBWindow dbBoolean
Display status bar StartupShowStatusBar dbBoolean
Menu bar StartupMenuBar dbText
Shortcut menu bar StartupShortcutMenuBar dbText
Allow full menus AllowFullMenus dbBoolean
Allow default shortcut menus AllowShortcutMenus dbBoolean
Allow built-in toolbars AllowBuiltInToolbars dbBoolean
Allow toolbar changes AllowToolbarChanges dbBoolean
Allow viewing code after error AllowBreakIntoCode dbBoolean
Use Access special keys AllowSpecialKeys dbBoolean

Depending on the user name (and password) provided on the login form, you can use VBA code in
the splash screen or switchboard form to set or reset any of these properties. Clearly these proper-
ties have a lot to do with controlling the Access environment at start-up.

Be aware that many of the database options in Table 26.4, such as AppIcon, require restarting the
Access database before they take effect.

Disabling start-up bypass
In old versions of Access, developers used the AutoExec macro to do things like hide the data-
base container, open a start-up form, and execute some start-up code. The problem was that any
user could easily bypass the AutoExec macro by holding down the Shift key while opening the
database.

The Access start-up properties provide some relief from reliance on start-up macros and other rou-
tines. Unfortunately, the user is still able to bypass your carefully designed start-up options by
holding down the Shift key as the application starts. Bypassing your start-up routines, of course,
will reveal the application’s design and objects that you’ve hidden behind the user interface.

Fortunately, the Access designers anticipated the need for bulletproofing an application’s start-up
by providing a database property named AllowBypassKey. This property, which accepts True
or False values, disables (or enables) the Shift key bypass at application start-up.
Free download pdf