Public Sub HideDatabaseWindow(fHide As Boolean)
'Comments : Hides or shows the database window
'Parameters: fHide - true to hide the database window, false to un-hide it
'Returns : Nothing
Const cdmiForm = 0
Const cdmiWindow = 4
Const cdmiHide = 3
Const cdmiUnHide = 4
On Error GoTo PROC_ERR
' Move focus to the window
DoCmd.SelectObject acTable, "", True
' Use the window menu to hide or show the database window
If fHide Then
DoCmd.DoMenuItem cdmiForm, cdmiWindow, cdmiHide, , acMenuVer20
Else
'Turn off error handling to account for form sequencing issues
On Error Resume Next
DoCmd.DoMenuItem cdmiForm, cdmiWindow, cdmiUnHide, , acMenuVer20
On Error GoTo PROC_ERR
End If
PROC_EXIT:
Exit Sub
PROC_ERR:
MsgBox "Error: " & Err.Number & ". " & Err.Description, , _
"HideDatabaseWindow"
Resume PROC_EXIT
End Sub