A recent question in the forums asked how to set certain options for the Current Database through code. Presumably, the purpose is to restrict the user from changing these settings manually when trying to bypass any security measures the developer designed into the database application. Doing a search through the Internet didn't produce a complete list of all possible database option settings, so I decided to put all the pieces of the puzzle together in one place.
So, what exactly are we talking about? Basically, we are interested in all the settings you can find in the Current Database tab when you open the Access Options window (see image below).
 |
Access Options |
Application.SetOption
The following options can be set using the Application.SetOption command:
Option | Property | Value |
Compact on Close | Auto Compact | False |
Remove personal information from file properties on save | Remove Personal Information | True |
Use Windows-themed Controls on Forms | Themed Form Controls | True |
Enable Layout View | DesignWithData | True |
Check for truncated number fields | CheckTruncatedNumFields | True |
Preserve source image format | Picture Property Storage Format | 0 |
Convert all picture data to bitmaps | Picture Property Storage Format | 1 |
Track name AutoCorrect info | Track Name AutoCorrect Info | False |
Perform name AutoCorrect | Perform Name AutoCorrect | False |
Log name AutoCorrect changes | Log Name AutoCorrect Changes | True |
Show list of values in: Local indexed fields | Show Values In Indexed | True |
Show list of values in: Local nonindexed fields | Show Values In Non-Indexed | True |
Show list of values in: ODBC fields | Show Values In Remote | False |
CurrentDB.Properties
The following options can be set using the CurrentDB.Properties collection:
Option | Property | Value |
Application Title | AppTitle | Text |
Application Icon | AppIcon | Text |
Display Form | StartupForm | Text |
Display Status Bar | StartupShowStatusBar | True |
Overlapping Windows | UseMDIMode | 1 |
Tabbed Documents | UseMDIMode | 0 |
Display Document Tabs | ShowDocumentTabs | True |
Display Navigation Pane | StartupShowDBWindow | True |
Ribbon Name | CustomRibbonID | Text |
Shortcut Menu Bar | StartupShortcutMenuBar | Text |
Allow Full Menus | AllowFullMenus | True |
Allow Default Shortcut Menus | AllowShortcutMenus | True |
Examples:
Application.SetOption "Auto Compact", True
CurrentDB.Properties("AllowFullMenus") = False
CurrentDB.Properties.Append CurrentDB.CreateProperty("CustomRibbonID", dbText, "MyRibbon")
Original post date: February 27, 2013