[AccessD] Bypassing Default start up behavior

Michael R Mattys mmattys at rochester.rr.com
Wed Apr 16 18:10:49 CDT 2008


I should note that I have always used these methods:

'HKEY_CURRENT_USER\Software\Microsoft\Office\9.0\Access\Settings
'Tabs: 'View, General, Edit/Find, Keyboard, Datasheet,
Forms/Reports, Advanced, Tables/Queries

Sub SetStartupProperties()
        ChangeProperty "Track Name AutoCorrect Info", 4, 1
        ChangeProperty "Perform Name AutoCorrect", 4, 1
        ChangeProperty "Log Name AutoCorrect Changes", 4, 0
        ChangeProperty "Auto Compact", 4, 0
        ChangeProperty "Show Values in Snapshot", 4, 1
        ChangeProperty "Show Values in Server", 4, 0
        ChangeProperty "Built-In Toolbars Available", 1, True
        ChangeProperty "Can Customize Toolbars", 1, True
        ChangeProperty "Key Assignment Macro", 10, "AutoKeys"
        ChangeProperty "Large Toolbar Buttons", 1, False
        ChangeProperty "Move Enclosed Controls", 1, False
        ChangeProperty "Show Status Bar", 1, True
        ChangeProperty "Show Startup Dialog Box", 1, False
        ChangeProperty "Show New Object Shortcuts", 1, True
        ChangeProperty "Show Hidden Objects", 1, True
        ChangeProperty "Show System Objects", 1, True
        ChangeProperty "ShowWindowsInTaskbar", 1, False
        ChangeProperty "Show Conditions Column", 1, True
        ChangeProperty "Show Macro Names Column", 1, True
        Application.SetOption "Error Trapping", 2
        Application.SetOption "Control Wizards", True
        Application.SetOption "Prefs Migrated", True
        Application.SetOption "Maximized", True
        Application.SetOption "Left Margin", 0.5
        Application.SetOption "Right Margin", 0.5
        Application.SetOption "Top Margin", 0.5
        Application.SetOption "Bottom Margin", 0.5
        Application.SetOption "Confirm Record Changes", False
        Application.SetOption "Confirm Document Deletions", False
        Application.SetOption "Confirm Action Queries", False
        ChangeProperty "Show Values in Indexed", 4, 1
        ChangeProperty "Show Values in Non-Indexed", 4, 1
        ChangeProperty "Show Values in Remote", 4, 0
        ChangeProperty "Show Values Limit", 4, 1000
        Application.SetOption "Move After Enter", 1
        Application.SetOption "Arrow Key Behavior", 0
        Application.SetOption "Behavior Entering Field", 1
        Application.SetOption "Cursor Stops at First/Last Field", 0
        Application.SetOption "Default Font Color", 0
        Application.SetOption "Default Background Color", 8
        Application.SetOption "Default Gridlines Color", 0
        Application.SetOption "Default Font Name", "Arial"
        Application.SetOption "Default Font Weight", 3
        Application.SetOption "Default Font Size", 10
        Application.SetOption "Default Font Italic", 0
        Application.SetOption "Default Font Underline", 0
        Application.SetOption "Default Gridlines Horizontal", True
        Application.SetOption "Default Gridlines Vertical", True
        Application.SetOption "Default Column Width", 1
        Application.SetOption "Default Cell Effect", 0
        Application.SetOption "Show Animations", True
        Application.SetOption "Selection Behavior", 0
        Application.SetOption "Form Template", "Normal"
        Application.SetOption "Report Template", "Normal"
        Application.SetOption "Always Use Event Procedures", True
        Application.SetOption "Ignore DDE Requests", False
        Application.SetOption "Enable DDE Refresh", True
        Application.SetOption "OLE/DDE Timeout (Sec)", 30
        Application.SetOption "Number of Update Retries", 2
        Application.SetOption "ODBC Refresh Interval (Sec)", 1500
        Application.SetOption "Refresh Interval (Sec)", 60
        Application.SetOption "Update Retry Interval (Msec)", 250
        Application.SetOption "Default Open Mode for Databases", 0
        Application.SetOption "Default Record Locking", 0
        Application.SetOption "Use Row Level Locking", True
        ChangeProperty "Row Limit", 4, 10000
        Application.SetOption "Hyperlink Color", 5
        Application.SetOption "Followed Hyperlink Color", 12
        Application.SetOption "Underline Hyperlinks", False
End Sub

Function ChangeProperty(strPropName As String, varPropType As Variant, 
varPropValue As Variant) As Integer
    Dim dbs As DAO.Database, prp As DAO.Property
    Const conPropNotFoundError = 3270

    Set dbs = CurrentDb
    On Error GoTo Change_Err

        'With dbs.Properties(strPropName)
        '    Debug.Print "ChangeProperty " & Chr(34) & .Name & Chr(34) & "," 
& .Type & "," & .Value
        'End With

    dbs.Properties(strPropName) = varPropValue
    ChangeProperty = True

Change_Bye:
    Exit Function

Change_Err:
    'Debug.Print "Application.SetOption " & Chr(34) & strPropName & Chr(34) 
& "," & varPropValue
    If Err = conPropNotFoundError Then  ' Property not found.
        Set prp = dbs.CreateProperty(strPropName, varPropType, varPropValue)
        dbs.Properties.Append prp
        Resume Next
    Else
         'Unknown error.
        ChangeProperty = False
        Resume Change_Bye
    End If
End Function




Michael R. Mattys
MapPoint & Access Dev
www.mattysconsulting.com

----- Original Message ----- 
From: "Michael R Mattys" <mmattys at rochester.rr.com>
To: "Access Developers discussion and problem solving" 
<accessd at databaseadvisors.com>
Sent: Wednesday, April 16, 2008 6:49 PM
Subject: Re: [AccessD] Bypassing Default start up behavior


> Hi Don,
>
> I'm looking at this page:
> http://support.microsoft.com/kb/q173646/
> and (better) this page:
> http://my.advisor.com/Articles.nsf/AID/FISHS01




More information about the AccessD mailing list