Show toolbar from a different MDB

  • I've sent a large MDB to a client and set the Startup options to prevent them from seeing the database window, menus, special keys, etc.

    Unfortunately I need to change the properties of one of the toolbars. There is a toolbar called 'Options' and I need to change the Allow Showing/Hiding property. I'd like to be able to run code from another file that will change this property (then i can set the code to run when they open this other file).

    i.e. run code in database B to change the property of a toolbar in database A.

    Anyone know how? Thanks

  • Alan,

    Here are a couple of functions that I use.  You can change the assignment of the db to be the db you want to change

    Richard

    Public Function SetStartupProperties()

        'ChangeProperty "StartupForm", dbText, "Customers"

        ChangeProperty "StartupShowDBWindow", dbBoolean, False

        ChangeProperty "StartupShowStatusBar", dbBoolean, True

        ChangeProperty "StartupMenuBar", dbText, "TRAPSMenu"

        ChangeProperty "AllowBuiltinToolbars", dbBoolean, True

        ChangeProperty "AllowFullMenus", dbBoolean, True

        Call ChangeProperty("AllowSpecialKeys", dbBoolean, False)

        Call ChangeProperty("AllowBreakIntoCode", dbBoolean, False)

        Call ChangeProperty("AllowBypassKey", dbBoolean, False)

    End Function

    Public Function ChangeProperty(strPropName As String, varPropType As Variant, varPropValue As Variant) As Integer

    On Error GoTo Change_Err

       

        Dim dbs As Database, prp As Property

        Const conPropNotFoundError = 3270

        Set dbs = CurrentDb

        dbs.Properties(strPropName) = varPropValue

        ChangeProperty = True

    Change_Bye:

        Exit Function

    Change_Err:

        If Err = conPropNotFoundError Then  ' Property not found...so create it

            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

     

  • press the SHIFT + enter .. when entering Database .. and you will see all things (I think you are using MS Access)


    Alamir Mohamed
    Alamir_mohamed@yahoo.com

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply