Report Preview Toolbar Locked

Novice1

Registered User.
Local time
Today, 15:20
Joined
Mar 9, 2004
Messages
385
I'm using the Hide The Access Window module ...
http://www.tek-tips.com/faqs.cfm?fid=2562

I love the look and feel of the windows. I simply cannot print my reports. The print toolbar (print, pdf, etc.) is locked.

I added the mcrRestore to each report but nothing I seem to do unlocks the toolbar. Any suggestions?
 
This WEB was Posted: 10 Oct 02 (Edited 27 Sep 06). Maybe this code needs to be updated. I'm getting the same results in Access 2013 that you are. I noticed that mcrHide macro basically runs the this line of code:

Code:
 dwReturn = ShowWindow(Application.hWndAccessApp, SW_SHOWMINIMIZED)

and the mcrRestore macro runs:

Code:
dwReturn = ShowWindow(Application.hWndAccessApp, SW_SHOWMAXIMIZED)

If I add the line Const SW_RESTORE = 9 before the fAccessWindow function along with the other constants and change the line run by the mcrRestore macro to:
Code:
 dwReturn = ShowWindow(Application.hWndAccessApp, SW_RESTORE)

I get back control of the stuff that was locked. But that was just a guess, I'm not sure it that the way to fix this, and I'm not THAT interested. But if you want to try to fix this code that along with https://msdn.microsoft.com/en-us/library/windows/desktop/ms633548(v=vs.85).aspx might get you started.
 
I can't unlock the toolbar. I reworked the code as suggested but it's not working. Any help please. Should be a way to turn on/turn off.

Option Compare Database

''''
' Start Code '
''''
Private Declare Function IsWindowVisible Lib "user32" (ByVal hwnd As Long) As Long
Dim dwReturn As Long

Const SW_HIDE = 0
Const SW_SHOWMINIMIZED = 2
Const SW_SHOWMAXIMIZED = 3
Const SW_RESTORE = 9

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 Procedure = "Restore" Then
dwReturn = ShowWindow(Application.hWndAccessApp, SW_RESTORE)
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 '
'''
 
I changed

Code:
If Procedure = "Show" Then
    dwReturn = ShowWindow(Application.hWndAccessApp, SW_SHOWMAXIMIZED)
End If
to

Code:
If Procedure = "Show" Then
    dwReturn = ShowWindow(Application.hWndAccessApp, SW_RESTORE)
End If
the part that mcrRestore macro runs and that unlocked the toolbar, but that broke it in some other way which I don't recall. I think you will need to fully understand what this IsWindowVisible API does to get this working right.
 
I'm still having problems. The print preview options are locked (cannot print). However, if I minimize the report, then maximize the report, the print preview options are unlocked.

Any ideas on how to fix my problem?
 
Print preview options are locked (cannot print). However, if I minimize the report, then maximize the report, the print preview options are unlocked.

Any ideas on how to fix my problem?
 
Are you sure the report has the focus set on it?
For me it sound as it hasn't, then when you minimize/maximize the report gets the focus.
Post a stripped down version of your database with some sample data in it.
 
Last edited:

Users who are viewing this thread

Back
Top Bottom