Solved

Have my startup property changes take effect with out restarting

Posted on 2009-05-13
3
386 Views
Last Modified: 2013-11-27
I'm running the following code to set the startup properties based on the user type.  I have an autoexec macro that kicks off a "runfirst" modual.  In the modual I determin the user level (based on NT login) and call either SetStartupPropertiesAdmin or SetStartupProperties based on the login.

I can get the code to set the properties however I have to restart in order for the properites to take effect - not good -.  Is there a way to set the properties and not have to restart?  
Sub SetStartupPropertiesAdmin()

    ChangeProperty "StartupForm", dbText, "fmnuMainMenu"

    ChangeProperty "StartupShowDBWindow", dbBoolean, False

    ChangeProperty "StartupShowStatusBar", dbBoolean, False

    ChangeProperty "AllowBuiltinToolbars", dbBoolean, False

    ChangeProperty "AllowToolbarChanges", dbBoolean, False

    ChangeProperty "AllowFullMenus", dbBoolean, True

    ChangeProperty "AllowShortcutMenus", dbBoolean, True

    ChangeProperty "AllowBreakIntoCode", dbBoolean, True

    ChangeProperty "AllowSpecialKeys", dbBoolean, True

    ChangeProperty "AllowBypassKey", dbBoolean, True

End Sub

Sub SetStartupProperties()

    ChangeProperty "StartupForm", dbText, "fmnuMainMenu"

    ChangeProperty "StartupShowDBWindow", dbBoolean, False

    ChangeProperty "StartupShowStatusBar", dbBoolean, False

    ChangeProperty "AllowBuiltinToolbars", dbBoolean, False

    ChangeProperty "AllowToolbarChanges", dbBoolean, False

    ChangeProperty "AllowFullMenus", dbBoolean, False

    ChangeProperty "AllowShortcutMenus", dbBoolean, False

    ChangeProperty "AllowBreakIntoCode", dbBoolean, False

    ChangeProperty "AllowSpecialKeys", dbBoolean, False

    ChangeProperty "AllowBypassKey", dbBoolean, False

End Sub
 

Function ChangeProperty(strPropName As String, _

                        varPropType As Variant, _

                        varPropValue As Variant) As Integer

    Dim prp As Property

    Const conPropNotFoundError = 3270
 

    On Error GoTo Change_Err

    CurrentDb.Properties(strPropName) = varPropValue

    ChangeProperty = True
 

Change_Bye:

    Exit Function
 

Change_Err:

    If err = conPropNotFoundError Then

        ' Property not found.

        Set prp = CurrentDb.CreateProperty(strPropName, varPropType, varPropValue)

        CurrentDb.Properties.Append prp

        Resume Next

    Else ' Unknown error.

        ChangeProperty = False

        Resume Change_Bye

    End If

End Function

Open in new window

0
Comment
Question by:joe_GDB
3 Comments
 
LVL 77

Expert Comment

by:peter57r
ID: 24377506
No.
0
 

Author Comment

by:joe_GDB
ID: 24377748
Is there anyway to set the startup properties based on user levels.  If so could you suggest a solution, it looks like I may be going about this the wrong way!
0
 
LVL 84

Accepted Solution

by:
Scott McDaniel (Microsoft Access MVP - EE MVE ) earned 500 total points
ID: 24380812
You're setting the properties correctly, but as peter said many of them require a restart. You can't get around this. You could use this utility:

http://www.trigeminal.com/lang/1033/utility.asp?ItemID=8 (the SOON utility)

To shut down your database and reopen it after changing your startup properties.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In the previous article, Using a Critera Form to Filter Records (http://www.experts-exchange.com/A_6069.html), the form was basically a data container storing user input, which queries and other database objects could read. The form had to remain op…
QuickBooks® has a great invoice interface that we were happy with for a while but that changed in 2001 through no fault of Intuit®. Our industry's unit names are dictated by RUS: the Rural Utilities Services division of USDA. Contracts contain un…
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…

863 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now