Collapse Navigation Pane When Form Loads

L

Lisa

Say, is there an easy way to have the Navigation Pane collapse when a form
loads? I'm not a programmer.

Thanks.
 
D

Damon Heron

In the form's Activation Event, found in the properties sheet,
add this code (in the VB window):

Private Sub Form_Activate()
SendKeys "{F11}" <<<< add this code here
End Sub

Of course, if the nav pane is already closed, this will open it ( it toggles
back and forth - try the F11 key to see)...

Damon
 
L

Lisa

I had used SendKeys in the macro and it worked, but was far clunkier. This
is easier. Thanks so much.
 
H

Hans Up

Mark said:
To hide the pane use:

DoCmd.RunCommand acCmdWindowHide

When I tried that in Form_Open event code, it hid my form.
Changing Form_Open to the following both hid the navigation panel and
left my form visible.

DoCmd.SelectObject acTable, , True
DoCmd.RunCommand acCmdWindowHide
 
M

Mark Andrews

Good reply, I just put up what I saw on the website. I usually just hide
the navigation pane at startup by unchecking the box in Access options.

I would use this code over the sendkeys method.

Mark
 
H

Hans Up

Mark said:
Good reply, I just put up what I saw on the website. I usually just hide
the navigation pane at startup by unchecking the box in Access options.

Good point. I was curious to see it work. But didn't pause to consider
whether I would actually use it. :)
I would use this code over the sendkeys method.

Me, too.

Regards,
Hans
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top