Set Startup Properties from Visual Basic

Microsoft Access Visual Basic

Show All

Set Startup Properties from Visual Basic

   

In a Microsoft Access database (.mdb), startup properties are properties of a Database object. A Database object is a DAO object supplied by the Microsoft Jet database engine, but startup properties are defined by Microsoft Access, so they aren't automatically recognized by the Jet database engine. If a startup property hasn't been set previously, you must create it and add it to the Properties collection of the Database object.

In a Microsoft Access project (.adp), startup properties are properties of a CurrentProject object and like the Database object in an Access database (.mdb), startup properties aren't automatically recognized by the Jet database engine. If a startup property hasn't been set previously, you must create it and add it to the AccessObjectProperties collection of the CurrentProject object.

When you set startup properties from Visual Basic, you should include error-handling code to verify that the property exists in the Properties or AccessObjectProperties collection. For more information about setting properties defined by Microsoft Access, see Set Properties of Data Access Objects in Visual Basic or Set Properties of ActiveX Data Objects in Visual Basic.

The names of the startup properties differ from the text that appears in the Startup dialog box, available by clicking Startup on the Tools menu. The following table provides the name of each startup property as it's used in Visual Basic code.

Text in Startup dialog box Property name
Application Title AppTitle
Application Icon AppIcon
Display Form/Page StartupForm
Display Database Window StartupShowDBWindow
Display Status Bar StartupShowStatusBar
Menu Bar StartupMenuBar
Shortcut Menu Bar StartupShortcutMenuBar
Allow Full Menus AllowFullMenus
Allow Default Shortcut Menus AllowShortcutMenus
Allow Built-In Toolbars AllowBuiltInToolbars
Allow Toolbar/Menu Changes AllowToolbarChanges
Allow Viewing Code After Error AllowBreakIntoCode
Use Access Special Keys AllowSpecialKeys