J
Jasper Recto
I found this code on the Internet to hide the access window (Below). I'm
suppposed to create 2 macros that Hide the window and Show the window
mcrHide fAccessWindow ("Minimize", False, False)
mcrShow fAccessWindow ("Show", False, False)
On the Startup form, I set the On Open option to mcrHide.
To preview reports, I set the On Open option to mcrShow and the On Close
option to mcrHide
The problem I'm having is that when I preview the reports, I don't have the
option to print them becuase the menu bar is hidden.
Looking at the code below, is there a way to make it so that the print
option appears for the user to print?
Thanks,
Jasper
''''
' Start Code '
''''
Private Declare Function IsWindowVisible Lib "user32" (ByVal hwnd As Long)
As Long
Dim dwReturn As Long
Const SW_HIDE = 0
Const SW_SHOWNORMAL = 1
Const SW_SHOWMINIMIZED = 2
Const SW_SHOWMAXIMIZED = 3
Private Declare Function ShowWindow Lib "user32" (ByVal hwnd As Long, _
ByVal nCmdShow As Long) As Long
Public Function fAccessWindow(Optional Procedure As String, Optional
SwitchStatus As Boolean, Optional StatusCheck As Boolean) As Boolean
If Procedure = "Hide" Then
dwReturn = ShowWindow(Application.hWndAccessApp, SW_HIDE)
End If
If Procedure = "Show" Then
dwReturn = ShowWindow(Application.hWndAccessApp, SW_SHOWMAXIMIZED)
End If
If Procedure = "Minimize" Then
dwReturn = ShowWindow(Application.hWndAccessApp, SW_SHOWMINIMIZED)
End If
If SwitchStatus = True Then
If IsWindowVisible(hWndAccessApp) = 1 Then
dwReturn = ShowWindow(Application.hWndAccessApp, SW_HIDE)
Else
dwReturn = ShowWindow(Application.hWndAccessApp, SW_SHOWMAXIMIZED)
End If
End If
If StatusCheck = True Then
If IsWindowVisible(hWndAccessApp) = 0 Then
fAccessWindow = False
End If
If IsWindowVisible(hWndAccessApp) = 1 Then
fAccessWindow = True
End If
End If
End Function
'''
' End Code '
suppposed to create 2 macros that Hide the window and Show the window
mcrHide fAccessWindow ("Minimize", False, False)
mcrShow fAccessWindow ("Show", False, False)
On the Startup form, I set the On Open option to mcrHide.
To preview reports, I set the On Open option to mcrShow and the On Close
option to mcrHide
The problem I'm having is that when I preview the reports, I don't have the
option to print them becuase the menu bar is hidden.
Looking at the code below, is there a way to make it so that the print
option appears for the user to print?
Thanks,
Jasper
''''
' Start Code '
''''
Private Declare Function IsWindowVisible Lib "user32" (ByVal hwnd As Long)
As Long
Dim dwReturn As Long
Const SW_HIDE = 0
Const SW_SHOWNORMAL = 1
Const SW_SHOWMINIMIZED = 2
Const SW_SHOWMAXIMIZED = 3
Private Declare Function ShowWindow Lib "user32" (ByVal hwnd As Long, _
ByVal nCmdShow As Long) As Long
Public Function fAccessWindow(Optional Procedure As String, Optional
SwitchStatus As Boolean, Optional StatusCheck As Boolean) As Boolean
If Procedure = "Hide" Then
dwReturn = ShowWindow(Application.hWndAccessApp, SW_HIDE)
End If
If Procedure = "Show" Then
dwReturn = ShowWindow(Application.hWndAccessApp, SW_SHOWMAXIMIZED)
End If
If Procedure = "Minimize" Then
dwReturn = ShowWindow(Application.hWndAccessApp, SW_SHOWMINIMIZED)
End If
If SwitchStatus = True Then
If IsWindowVisible(hWndAccessApp) = 1 Then
dwReturn = ShowWindow(Application.hWndAccessApp, SW_HIDE)
Else
dwReturn = ShowWindow(Application.hWndAccessApp, SW_SHOWMAXIMIZED)
End If
End If
If StatusCheck = True Then
If IsWindowVisible(hWndAccessApp) = 0 Then
fAccessWindow = False
End If
If IsWindowVisible(hWndAccessApp) = 1 Then
fAccessWindow = True
End If
End If
End Function
'''
' End Code '