How do I control MS Access navigation pane by macro or VBA?

0

I would like to use either macro's or VBA to programatically control the Access Navigation Pane (i.e. hide and unhide it). I've found plenty of resources to hide the Navigation Pane (e.g. RunMenuCommand>WindowHide, Display Navigation Pane checkbox), but I haven't been able to find a solution that will let me hide and unhide the pane.

Ideally I'd like to have the Autoexec macro hide the Navigation Pane, and then have a button on a user field that can unhide and then re-hide it. I've tried RunMenuCommand>WindowUnhide without any success. Again, either macro or VBA would be fine for a solution.

EDIT: Right now I'm using the Autoexec macro to NavigateTo>MinimizeWindow and then a button click to toggle between NavigateTo>WindowMaximize and >WindowMinimize (syntax may be off a bit, I don't have it open currently). I'd prefer to Hide/Unhide to minimize the likelihood of accidental changes-it would take a conscious effort to open the pane-not just random navigation by an inexperienced user. FWIW, this is more about accessibility to it and not really a security issue.

dav

Posted 2013-05-17T11:53:54.957

Reputation: 8 378

Can you share the of code you're using now? – CharlieRB – 2013-05-17T12:49:46.173

Does it have to be hidden or can it be minimized? It will be much easier to minimize and maximize the window. – CharlieRB – 2013-05-17T13:46:54.477

Answers

2

As a developer you should always hide the Navigation Pane from users.

Go to File - Options - Current Database - Navigation and uncheck to Display Navigation Pane. Now when users open the database they won't get the Navigation Pane.

When you want to work on the database with the Navigation Pane just hold the shift key while opening up your database.

leach613

Posted 2013-05-17T11:53:54.957

Reputation: 21