DoCmd.TransferSharePointList
(1)
NetUIHWND
(1)
Application.hWndAccessApp
(1)
Access 2007
(1)
AcLinkSharePointList
(1)
AcSysCmdAccessVer
(1)
MDIClient
(1)
IsDbWindowVisible
(1)

Navigation Pane Appears when Linking Sharepoint List

Asked By agf
17-Nov-09 02:10 PM
I posted this on microsft.public.access - but this is probably a
better group to post on.

I have an Access application that needs to perform some
initialisation
and data synchronisation with some sharepoint lists.  I have a splash
screen that displays progress, but it is proving impossible to keep
the navigation pane hidden whilst the synchronisation runs - even
though the database has the show navaigation check box unchecked.

The problem seems to be when a DoCmd.TransferSharePointList
acLinkSharePointList,"http:...." command is executed.


As this statement completes execution, the navigation pane appears
and
the splash screen loses focus.  I am unable to hide the navigation
screen so it then spoils the user interface for the rest of the
application - and I do not want users to access it anyway.


How can I stop it appearing or if not, how can I hide it again
programmatically.


Thanks


Andrew

Here is some code by Dirk Goldgar MVP, that should do what you want.

Jeanette Cunningham replied to agf
17-Nov-09 03:23 PM
Here is some code by Dirk Goldgar MVP, that should do what you want.

Returns True if the Access Navigation Pane or Database Window is visible,
otherwise False.
' Example: ?isDbWindowVisible()

Public Function isDbWindowVisible() As Boolean
Dim hWindow As Long
If Int(SysCmd(acSysCmdAccessVer)) >= 12 Then  ' Access 2007 Navigation
Pane
hWindow = FindWindowEx(Application.hWndAccessApp, 0,
hWindow = FindWindowEx(hWindow, 0, "NetUIHWND", vbNullString)
Else                             ' Access 20003 Database Window
hWindow = FindWindowEx(Application.hWndAccessApp, 0, "MDIClient",
vbNullString)
hWindow = FindWindowEx(hWindow, 0, "Odb", vbNullString)
End If
isDbWindowVisible = (isWindowVisible(hWindow) <> 0)
End Function


The above code can be used to hide the Navigation Pane such as in the
function below:

' Hide the Access Database Window or Navigation Pane.
' Example:  DbWindowHide

Function DbWindowHide() As Boolean

If isDbWindowVisible() Then
Application.Echo False



Jeanette Cunningham MS Access MVP -- Melbourne Victoria Australia

zhangkaifeng replied to agf
26-Nov-09 11:30 PM

         

zhangkaifeng replied to agf
27-Nov-09 04:23 AM

         
Post Question To EggHeadCafe