Solved

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

Posted on 2014-04-02
11
951 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
Use Case: Protecting a Hybrid Cloud Infrastructure

Microsoft Azure is rapidly becoming the norm in dynamic IT environments. This document describes the challenges that organizations face when protecting data in a hybrid cloud IT environment and presents a use case to demonstrate how Acronis Backup protects all data.

 
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

Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Programmer 14 49
A Function to parse a text string 4 36
Access datasheet - showing a number in scientific notation 4 21
Filter a form 8 14
I see at least one EE question a week that pertains to using temporary tables in MS Access.  But surprisingly, I was unable to find a single article devoted solely to this topic. I don’t intend to describe all of the uses of temporary tables in t…
As tax season makes its return, so does the increase in cyber crime and tax refund phishing that comes with it
Familiarize people with the process of utilizing SQL Server views from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Access…
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.

772 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