?
Solved

Access 2007: Code to hide the navigation pane does NOT work

Posted on 2014-04-02
11
Medium Priority
?
1,019 Views
Last Modified: 2014-06-17
Hi

I have several Access 2007 frontend apps (which link to tables in a backend database). Regardless if I relink (per VBA) the tables or not, and REGARDLESS of the following code used as the LAST action in the main form Load:

    DoCmd.SelectObject acTable, , True
    DoCmd.RunCommand acCmdWindowHide

the navigation pane stays open (in about 90% of the cases). This drives me nuts ! I even made a copy of such an app, uncheck all the things that one can uncheck, including the "Show navigation pane", but the nav pane STILL shows up. Then as the last step, I made an accde from that app, and the nav pane STILL shows up !

What shall I do ? Accept that MS Access 2007 has a big bug in that respect and let my users see all the tables and queries and forms which I defined, or what ?

Anybody can help me further ?

Thanks
Bernard
0
Comment
Question by:bthouin
  • 5
  • 3
9 Comments
 
LVL 31

Expert Comment

by:Helen Feddema
ID: 39973703
I use something like this code to hide or show the navigation pane, from hot keys in the AutoKeys macro.  Ctrl-H calls HideDBWindow and Ctrl-S calls ShowDBWindow.

Public Function ShowDBWindow()
'Created by Helen Feddema 4-Apr-2010
'Last modified by Helen Feddema 4-Apr-2010

On Error Resume Next

   DoCmd.SelectObject objecttype:=acTable, _
      InDatabaseWindow:=True
  
End Function

Public Function HideDBWindow()
'Created by Helen Feddema 4-Apr-2010
'Last modified by Helen Feddema 4-Apr-2010

On Error Resume Next

   DoCmd.SelectObject objecttype:=acTable, _
      InDatabaseWindow:=True
   DoCmd.RunCommand acCmdWindowHide
  
End Function

Open in new window


AutoKeys macro
0
 
LVL 1

Author Comment

by:bthouin
ID: 39974575
Hi Helen

Your code and my code are the same. I've tried using the InDatabaseWindow keyword instead of nothing for the last parameter in the DoCmd.SelectObject statement, it does not change anything.

I've seen the 2 lines of VBA code in your post in so many other posts on the internet and in EE posts.

I'm sorry, but these 2 lines of code just DO.NOT.work !
0
 
LVL 14

Expert Comment

by:Bill Ross
ID: 39980025
Hi,

I think your code is fine.  Something is reopening the ribbon somewhere.  You need to find that and correct it...

FYI - do not run this code in AutoExec.  That won't work.  Run it in the OnOpen event of a start up form.  

Thanks,

Bill
0
Nothing ever in the clear!

This technical paper will help you implement VMware’s VM encryption as well as implement Veeam encryption which together will achieve the nothing ever in the clear goal. If a bad guy steals VMs, backups or traffic they get nothing.

 
LVL 1

Author Comment

by:bthouin
ID: 39985282
Hi Bill

Sorry, but that doesn't work either. Regardless of what I do, of where I put the code, and of what variations I use in the code, the navigation pane invariably is opened after the end of my main form load.

Common guys, there MUST be a way to have this highly irritating navigation pane closed !

Help me !
0
 
LVL 1

Author Comment

by:bthouin
ID: 40111304
I've requested that this question be deleted for the following reason:

My question has no real answers. There is a fundamental bug in Access in the area of hiding the navigation pane, which is simply not possible if using the format .mdb or .accdb or .accde. The only way to do it, which I found elsewhere, is to use the .accdr format.
0
 
LVL 14

Expert Comment

by:Bill Ross
ID: 40111302
Hi,

There is something incorrect in your application that is opening the Nav Pane.  I have many apps and the user never sees the Nav Pane.  Please post a sample accdb or mdb (code works in both) and I'll try to help.

Regards,

Bill
0
 
LVL 14

Expert Comment

by:Bill Ross
ID: 40111305
There is an answer...
0
 
LVL 1

Accepted Solution

by:
bthouin earned 0 total points
ID: 40121648
Hi SouthMod and Bill

I'm sorry, but the amount of work to achieve what you're asking doesn't justify the solution of the problem. I have no time to do that. Also, my applications are running at a bank, so I just cannot make them available, and as mentioned making a "sample" is just not realistic.

I have actually found one "solution", as recommended by another of the EE gurus: I use now the accdr (runtime) format for my Access aps, which keeps the apps locked at all time, and not only solves the navigation pane problem, but also blocks  an app startup with shift key, and opening the code pane with Alt+F11. I know one can also turn off these 2 last ones, but the effort needed to make an accdr is so ridiculously low that it beats any other solution hands down.

So please close/delete this question.

Thanks
Bernard
0
 
LVL 1

Author Closing Comment

by:bthouin
ID: 40138853
This is not a solution but a workaround, but it works for me, so I'll leave it at that.
0

Featured Post

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Question has a verified solution.

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

The Windows Phone Theme Colours is a tight, powerful, and well balanced palette. This tiny Access application makes it a snap to select and pick a value. And it doubles as an intro to implementing WithEvents, one of Access' hidden gems.
Windows Explorer let you handle zip folders nearly as any other folder: Copy, move, change, and delete, etc. In VBA you can also handle normal files and folders, but zip folders takes a little more - and that you'll find here.
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…
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…
Suggested Courses

850 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