Friday, February 12, 2016

Database Startup Properties

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


The following options can be set using the Application.SetOption command:
Compact on CloseAuto CompactFalse
Remove personal information from file properties on saveRemove Personal InformationTrue
Use Windows-themed Controls on FormsThemed Form ControlsTrue
Enable Layout ViewDesignWithDataTrue
Check for truncated number fieldsCheckTruncatedNumFieldsTrue
Preserve source image formatPicture Property Storage Format0
Convert all picture data to bitmapsPicture Property Storage Format1
Track name AutoCorrect infoTrack Name AutoCorrect InfoFalse
Perform name AutoCorrectPerform Name AutoCorrectFalse
Log name AutoCorrect changesLog Name AutoCorrect ChangesTrue
Show list of values in: Local indexed fieldsShow Values In IndexedTrue
Show list of values in: Local nonindexed fieldsShow Values In Non-IndexedTrue
Show list of values in: ODBC fieldsShow Values In RemoteFalse


The following options can be set using the CurrentDB.Properties collection:
Application TitleAppTitleText
Application IconAppIconText
Display FormStartupFormText
Display Status BarStartupShowStatusBarTrue
Overlapping WindowsUseMDIMode1
Tabbed DocumentsUseMDIMode0
Display Document TabsShowDocumentTabsTrue
Display Navigation PaneStartupShowDBWindowTrue
Ribbon NameCustomRibbonIDText
Shortcut Menu BarStartupShortcutMenuBarText
Allow Full MenusAllowFullMenusTrue
Allow Default Shortcut MenusAllowShortcutMenusTrue


Application.SetOption "Auto Compact", True
CurrentDB.Properties("AllowFullMenus") = False
CurrentDB.Properties.Append CurrentDB.CreateProperty("CustomRibbonID", dbText, "MyRibbon")

Original post date: February 27, 2013

1 comment: