[AccessD] Possible to set external ACCDB navigation properties through code
bensonforums at gmail.com
Tue Jan 29 14:03:05 CST 2019
I have a prep routine that needs to assign and change startup properties in
a copy of the current database.
My process copies the current database to a new location then uses DBEngine
to open that, and change properties.
I have been able to find out how to change most settings I need to tweak,
but not all. One of the ones that I want to change is whether or not system
and hidden objects are to be shown in the navigation pane. I only know how
to do this through the UI, and of course, Access does not have a record
macro feature so I cannot determine how to do it.
The below code shows as far as I got. Also, I am probably refreshing
database properties too frequently, but that is how I was debugging.
Probably I can get rid of all but the last Props.Refresh lines.
Set DBS = DBEngine(0).OpenDatabase(strTestVerionFolderDF & "\" &
Dir(strTestVerionFolderDF & "\*SF.ACCDB"))
Set Props = DBS.Properties
Set Prop = DBS.CreateProperty(Name:="StartUpForm", Type:=10,
Set Prop = DBS.CreateProperty(Name:="AllowSpecialKeys", Type:=1,
Props.Delete "Auto Compact"
Set Prop = DBS.CreateProperty(Name:="Auto Compact", Type:=4, Value:=1)
Set Prop = DBS.CreateProperty(Name:="appTitle", Type:=10,
Value:=Replace$(strTitle, "Dual File", "Single File"))
More information about the AccessD