keep navigation pane locked after link table

supmktg

Registered User.
Local time
Today, 13:44
Joined
Mar 25, 2002
Messages
360
I don't want users to have access to the navigation pane in a 2007 app. I have the option to show the navigation pane unchecked, but that doesn't hide it. So, I'm locking the navigation pane when the main form opens with this code:

Code:
DoCmd.LockNavigationPane True

From time to time, the app will create a new table in a remote mdb and then link to that table with:

Code:
DoCmd.TransferDatabase acLink, "Microsoft Access", DbPath, acTable, strTblName, strTblName

When that occurs, the navigation pane becomes visible. How can I permanently lock the navigation pane as I could in previous versions of Access?

Thanks,
Sup
 
I have created the following function to hide the navigation pane after linking a table:

Code:
Public Function HideNav(strTblName As String)
DoCmd.SelectObject acTable, strTblName, True
DoCmd.RunCommand acCmdWindowHide
End Function

I call this function each time I link a table like this:

Code:
DoCmd.TransferDatabase acLink, "Microsoft Access", DbPath, acTable, strTblName, strTblName

Call HideNav(strTblName)

The problem is it doesn't work every time!

When it does work, Access first opens the nav pane wide and then hides it which I'm sure seems as silly to the user as it does to me. When it doesn't work, it leaves the nav pane wide open to curious users for the duration.

The app is an mdb in a version previous to 2007. I know that I am not the only one experiencing this frustration as I have found many posts about it. Unfortunately, I haven't found a solution that works.

Has anyone here been able to successfully hide the nav pane and prevent it from opening?

Thanks,
Sup
 
Run the database either in Access Runtime or use the Runtime switch in the shortcut to force the full version into runtime mode.

Runtime has no navigation pane.
 
It seemed that the times that my HideNav function didn't work, it was being called from a modal form. After many searches I found this post:
http://social.msdn.microsoft.com/Forums/en-US/accessdev/thread/0a34dbec-5078-4e16-b6a7-78f62c39f1bf/

which helped me put together the following function which works from modal forms:
Code:
Function HideNav2(ByRef CalledFromForm As Form)
    
    If SysCmd(acSysCmdAccessVer) > 11 Then
        
        If (CalledFromForm.Modal = True) Then     
 
            CalledFromForm.Modal = False            
  
            DoCmd.SelectObject acTable, , True
            DoCmd.RunCommand acCmdWindowHide   
  
            CalledFromForm.Modal = True           
  
        Else                                
 
            DoCmd.SelectObject acTable, , True
            DoCmd.RunCommand acCmdWindowHide    
  
        End If
    End If

End Function

The nav pane still pops open for a second, but so far this is the best solution that I can find for my circumstances.

I hope this will help others with this problem.

Sup
 

Users who are viewing this thread

Back
Top Bottom