Hide Access windows - but not from Process bar ...

Steff_DK

Registered User.
Local time
Today, 23:51
Joined
Feb 12, 2005
Messages
110
Hi everyone,

I am using this code to hide Access when my DB is running.
Forms are set to Modal + PopUp, and then it works.

However, Access is also hidden from the Process bar in the buttom of my screen so I cannot switch between running apps unless I use ALT+TAB.
Is there a way to modify the below code to unhide from process bar??

Btw the below code was taken from tek-tips forum (not to claim credit for the code) ;)

Code:
Global Const SW_HIDE = 0
Global Const SW_SHOWNORMAL = 1
Global Const SW_SHOWMINIMIZED = 2
Global Const SW_SHOWMAXIMIZED = 3

Private Declare Function apiShowWindow Lib "user32" _
Alias "ShowWindow" (ByVal hWnd As Long, _
ByVal nCmdShow As Long) As Long

Function fSetAccessWindow(nCmdShow As Long)

Dim loX As Long
Dim loForm As Form
On Error Resume Next
Set loForm = Screen.ActiveForm

If Err <> 0 Then
loX = apiShowWindow(hWndAccessApp, nCmdShow)
Err.Clear
End If

If nCmdShow = SW_SHOWMINIMIZED And loForm.Modal = True Then
MsgBox "Cannot minimize Access with " _
& (loForm.Caption + " ") _
& "form on screen"
ElseIf nCmdShow = SW_HIDE And loForm.PopUp <> True Then
MsgBox "Cannot hide Access with " _
& (loForm.Caption + " ") _
& "form on screen"
Else
loX = apiShowWindow(hWndAccessApp, nCmdShow)
End If
fSetAccessWindow = (loX <> 0)
End Function
 
If I use the SW_SHOWMINIMIZED constant value, it works for me - the forms show up, and the access window is minimized to the task bar. If you use SW_HIDE, the access window is hidden from the task bar altogether.

HTH
 
hy
I try use this code for report but no work....
 

Users who are viewing this thread

Back
Top Bottom