Access VBA Error trying torun code when db opens

Murray Brown
Murray Brown used Ask the Experts™
on
Hi
I have an Access database that I use as the backend in a split database solution. I have no forms in it so am using the following code to try  to hide the navigation pane. I call this code from in the AutoExec macro shown in the image but am getting the error below
Public Function HideNav()
    If InStr(N, "accde") > 0 Then
         'select the navigation pange
         Call DoCmd.NavigateTo("acNavigationCategoryObjectType")
         'hide the selected object
         Call DoCmd.RunCommand(acCmdWindowHide)
    End If
End Function

1
2
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
President / Owner CARDA Consultants Inc.
Distinguished Expert 2018
Commented:
Try

HideNav()
Murray BrownASP.net/VBA/VSTO Developer

Author

Commented:
thanks very much

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial