Solved

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

Posted on 2014-04-02
11
937 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
11 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
 
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
Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

 
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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

I originally created this report in Crystal Reports 2008 where there is an option to underlay sections. I initially came across the problem in Access Reports where I was unable to run my border lines down through the entire page as I was using the P…
Experts-Exchange is a great place to come for help with solutions for your database issues, and many problems are resolved within minutes of being posted.  Others take a little more time and effort and often providing a sample database is very helpf…
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.

758 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now