Results 1 to 5 of 5

Thread: Menu Bar

  1. #1
    5 Star Lounger
    Join Date
    Mar 2001
    Posts
    989
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Menu Bar

    How can I automatically hide the Menu Bar when someone uses my Database?

  2. #2
    3 Star Lounger
    Join Date
    Feb 2001
    Location
    NYC,USA,Earth
    Posts
    273
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Menu Bar

    IMHO, you shouldn't really hide the menu bar as that is a natural feature of windows programs and I usually try to develop my apps with as many of the standard features of windows programs as I think are necessary. I think it makes users more comfortable and the application more user friendly. If you want to change what's available to the user on the default menus then develop your own menus and toolbars. I use custom toolbars and menu bars for almost everything I develop. And once you create them you can copy them to other apps and modify them.

  3. #3
    5 Star Lounger
    Join Date
    Mar 2001
    Posts
    989
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Menu Bar

    I intend to use Custom toolbars for the application, but I still need to know how to hide the Menu Bar automatically, on the OnOpen event of the main Switchboard. Andy.

  4. #4
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    The Netherlands
    Posts
    216
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Menu Bar

    You can use the startup settings.
    You can set them using the following code.
    Be careful with the AllowBypassKey property. Once set to false the SHIFT key doesn't work anymore when starting up the application.
    So, before you try this make a backup and a backup from the backup!
    Children, don't try this at home!


    fnChangeProperty "StartupShowDBWindow", dbBoolean, False
    fnChangeProperty "AllowBuiltinToolbars", dbBoolean, False
    fnChangeProperty "AllowToolbarChanges", dbBoolean, False
    fnChangeProperty "AllowShortcutMenus", dbBoolean, False
    fnChangeProperty "AllowFullMenus", dbBoolean, False
    fnChangeProperty "AllowBreakIntoCode", dbBoolean, False
    fnChangeProperty "AllowSpecialKeys", dbBoolean, False
    fnChangeProperty "AllowBypassKey", dbBoolean, False

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

    Set dbs = CurrentDb
    On Error GoTo fnChangeProperty_Err
    dbs.Properties(strPropName) = varPropValue
    fnChangeProperty = True

    fnChangeProperty_Exit:
    Set dbs = Nothing
    Exit Function

    fnChangeProperty_Err:
    '************************************************* *****************
    'If not found, make it
    '************************************************* *****************
    If Err = conPropNotFoundError Then ' Property not found.
    Set prp = dbs.CreateProperty(strPropName, varPropType, varPropValue)
    dbs.Properties.Append prp
    Resume Next
    '************************************************* *****************
    'Else, ignore error
    '************************************************* *****************
    Else
    fnChangeProperty = False
    Resume fnChangeProperty_Exit
    End If
    End Function

  5. #5
    3 Star Lounger
    Join Date
    Feb 2001
    Location
    NYC,USA,Earth
    Posts
    273
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Menu Bar

    I'm not sure if you can. I create a custom toolbar to display when the db opens using the startup settings in the tools menu (access97). I then set the modal property of the opening switchboard to true along with the pop up property. I then remove the close button from the forms menu bar so the only way the user can close the form is by using the Exit command on the switchboard which closes the db.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •