[ Main | Access | Tips ]
The MS recommended code at Setting Startup Options Programmatically in Access 2000 However that code doesn't easily handle setting multiple properties. That page though does have all the startup option property names.
The code that I use is as follows. I don't know where I originally found the code in the first place. As I occasionally get easily confused I put this code in my mdlAutoExec module. This module also has all the code used to do initializing, open forms, check the backend is correct and valid, etc, etc.
Dim intX As Integer
intX = AddAppProperty("AppTitle", dbText, "Sample Application Title")
intX = AddAppProperty("StartUpMenuBar", dbText, "Sample Startup Menu Bar")
intX = AddAppProperty("StartUpForm", dbText, "Sample Start Up Form")
intX = AddAppProperty("StartUpShowDBWindow", dbBoolean, False)
MsgBox "Now Exit and go back in to test."
Here's the code with which you can loop through the properties collection to
view your current settings. Note that there are a lot of settings you
really don't need to worry about. The three in my sample code above are
likely the most important ones.
On Error GoTo tagError
Dim prp As Property, i As Integer
Dim strPropName As String, varPropValue As Variant, varPropType As Variant
Dim varPropInherited As Variant, intPropPropCount As Integer
Dim strError As String
For i = 0 To (.Properties.Count - 1)
strPropName = .Properties(i).Name
varPropValue = Null
varPropValue = .Properties(i).Value
varPropType = .Properties(i).Type
varPropInherited = .Properties(i).Inherited
Debug.Print strPropName & ": " & varPropValue & ", " & _
varPropType & ", " & varPropInherited & ";" & strError
strError = ""
Select Case Err.Number
strError = Err.Number & "," & Err.Description
[ Access Tips | Access | Main ]
Auto FE Updater distribute new and updated Front End databases to your users with several mouse clicks.
Granite Fleet Manager - the best designed fleet maintenance tracking and management system available