Solved

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

Posted on 2014-04-02
11
977 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Ransomware: The New Cyber Threat & How to Stop It

This infographic explains ransomware, type of malware that blocks access to your files or your systems and holds them hostage until a ransom is paid. It also examines the different types of ransomware and explains what you can do to thwart this sinister online threat.  

 
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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

In Part II of this series, I will discuss how to identify all open instances of Excel and enumerate the workbooks, spreadsheets, and named ranges within each of those instances.
This article describes a method of delivering Word templates for use in merging Access data to Word documents, that requires no computer knowledge on the part of the recipient -- the templates are saved in table fields, and are extracted and install…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
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.

737 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