Consulting

Results 1 to 3 of 3

Thread: Solved: Need to show menu bar in Access DB

  1. #1
    Site Admin
    Jedi Master
    VBAX Guru Jacob Hilderbrand's Avatar
    Joined
    Jun 2004
    Location
    Roseville, CA
    Posts
    3,712
    Location

    Solved: Need to show menu bar in Access DB

    Ok, so I have a little problem here that hopefully someone can help with.

    At work we have an Access data base that is used to input certain data. Unfortunately this program is regional and not open source at all for me.

    There is one menu bar at the top of the db that controls everything, but there is a problem. The menu bar is gone for some profiles (i.e. some people have it and some don't). I played around with it a bit and the menu bar can be de-docked and closed, but after that it cannot be shown again.

    I can go to the VBE and see all the macros and forms, however, the project is unviewable if I try to open one of the modules. There is no project password, its just unviewable. I am using Access 2002 so maybe the db was created in 2003 or with another program, I dunno.

    Anyways if this was Excel I would just write a script to enable the toolbar, but I am not sure how to do that with Access.

    Remember I cannot add any code to the project since it is unviewable so the code for any solution would have to be run from another Access db or perhaps Excel/Word.

    Let's use these names:
    Program Name: db1
    Project Name: project1
    Toolbar Name: toolbar1

    Thanks

  2. #2
    MS Excel MVP VBAX Mentor Andy Pope's Avatar
    Joined
    May 2004
    Location
    Essex, England
    Posts
    344
    Location
    Hi DRJ,

    This code will run from an excel code module.
    Adjust the path to suit.

        Dim intIndex As Integer
        Dim objDB As Object
        
        Set objDB = GetObject("C:\db1.mdb")
        For intIndex = 1 To objDB.CommandBars.Count
            If Not objDB.CommandBars(intIndex).BuiltIn Then
                If objDB.CommandBars(intIndex).Name = "toolbar1" Then
                    objDB.CommandBars(intIndex).Visible = True
                End If
            End If
        Next
    You might want to modify the code slightly so that first off it just prints all NON BuiltIn toolbars to the immediate window. That way you can see the actual names being used.
    Cheers
    Andy

  3. #3
    Site Admin
    Jedi Master
    VBAX Guru Jacob Hilderbrand's Avatar
    Joined
    Jun 2004
    Location
    Roseville, CA
    Posts
    3,712
    Location
    That worked perfectly.

    Thanks

Posting Permissions

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