Results 1 to 10 of 10
  1. #1
    Greyhound Friend is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Mar 2014
    Posts
    8

    Problem with hiding Ribbon & Navigation Code

    I’m a newbie to Access and VB, but have learned a lot from this forum. Thank you.

    From what I’ve been able to piece together from the posts here is that the code below should hide the ribbon and navigation pane. Where am I making my mistake?

    Any help is greatly appreciated.

    Sub HideRibbon()
    Dim i As Integer
    For i = 1 To CommandBars.Count
    DoCmd.ShowToolbar "Ribbon", acToolbarNo


    DoCmd.NavigateTo "acNavigationCategoryObjectType"
    DoCmd.Minimize
    Next i
    End Sub


    Deb

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,930
    The procedure works.

    What event are you using to call the Sub?
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    Greyhound Friend is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Mar 2014
    Posts
    8
    Thank you for your quick reply! I was trying it from the run command within VB. I want it to run when the database opens. Where would I put that? (Sorry, don't mean to sound so stupid...)

  4. #4
    Greyhound Friend is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Mar 2014
    Posts
    8
    I thought about your question some more. A form called Main Menu is opened when the database opens. My thought is that when that form opens, that would be the event the runs the Sub, right? That would also allow me to bypass the Sub by holding the shift key when I open the database. Is my logic right?

  5. #5
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,930
    Hiding the ribbon and Navigation Pane can be accomplished with database Option settings. No code required. Correction, that will hide all but the Home tab. The code actually hides everything. Very interesting.

    However, unless you also disable function keys, F11 can expand the Navigation Pane.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  6. #6
    Greyhound Friend is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Mar 2014
    Posts
    8
    Thank you. I tried it and like you said, the Home tab remains. How do I run the code...or is that too much to answer here?

  7. #7
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2013
    Posts
    7,862
    Placing the following in a form's load event should hide the Backstage

    DoCmd.ShowToolbar "Ribbon", acToolbarNo

  8. #8
    Greyhound Friend is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Mar 2014
    Posts
    8
    YES! Thank you SO much.

  9. #9
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,930
    Glad you got it working. You had the right idea in post 4.

    Did you also disable the function keys in database Option settings? Uncheck "Use Access Special Keys"
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  10. #10
    Greyhound Friend is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Mar 2014
    Posts
    8
    I did now. Thank you. This forum is an amazing help.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Hiding ribbon window
    By data808 in forum Access
    Replies: 18
    Last Post: 03-22-2014, 04:42 PM
  2. Hiding Navigation Pane kills macro
    By SemiAuto40 in forum Programming
    Replies: 3
    Last Post: 12-09-2011, 02:05 PM
  3. Hiding the Ribbon in a dB Application
    By jtvcs in forum Access
    Replies: 0
    Last Post: 03-26-2011, 09:41 AM
  4. Hiding The Ribbon
    By rashidhussain in forum Forms
    Replies: 1
    Last Post: 03-01-2011, 03:36 AM
  5. Hiding ribbon
    By jgelpi16 in forum Access
    Replies: 3
    Last Post: 12-16-2010, 11:12 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums