pat_nospam
Registered User.
- Local time
- Today, 16:54
- Joined
- Oct 14, 2003
- Messages
- 151
Hiding Access (application disappears!)
Well, I can get the first window to minimize appropriately, but clicking on buttons to go to other forms seems to make the entire application disappear. Occasionally, when I load the application, the whole application disappears as well (no minimizing or anything) - the only place it still shows up is in the Task List.
Any ideas?
I'm using this in my form:
--------
Private Sub Form_Open(Cancel As Integer)
SetAccessWindow (SW_HIDE)
End Sub
--------
Access 2002 SP2 & Windows XP using the following code and modules:
Option Compare Database
'Window modus const
Global Const SW_HIDE = 0
Global Const SW_SHOWNORMAL = 1
Global Const SW_SHOWMINIMIZED = 2
Global Const SW_SHOWMAXIMIZED = 3
'Private function
Private Declare Function apiShowWindow Lib "user32" _
Alias "ShowWindow" (ByVal hwnd As Long, _
ByVal windowModus As Long) As Long
Function SetAccessWindow(windowModus As Long)
Dim loX As Long
Dim currentForm As Form
On Error Resume Next
'Declaratie
Set currentForm = Screen.ActiveForm
If Err <> 0 Then
loX = apiShowWindow(hWndAccessApp, windowModus)
Err.Clear
End If
If windowModus = SW_SHOWMINIMIZED And currentForm.Modal = True Then
MsgBox "Cannot minimize Access with " & (currentForm.Caption + " ") & "form on screen"
ElseIf windowModus = SW_HIDE And currentForm.PopUp <> True Then
MsgBox "Cannot hide Access with " & (currentForm.Caption + " ") & "form on screen"
Else
loX = apiShowWindow(hWndAccessApp, windowModus)
End If
SetAccessWindow = (loX <> 0)
End Function
Well, I can get the first window to minimize appropriately, but clicking on buttons to go to other forms seems to make the entire application disappear. Occasionally, when I load the application, the whole application disappears as well (no minimizing or anything) - the only place it still shows up is in the Task List.
Any ideas?
I'm using this in my form:
--------
Private Sub Form_Open(Cancel As Integer)
SetAccessWindow (SW_HIDE)
End Sub
--------
Access 2002 SP2 & Windows XP using the following code and modules:
Option Compare Database
'Window modus const
Global Const SW_HIDE = 0
Global Const SW_SHOWNORMAL = 1
Global Const SW_SHOWMINIMIZED = 2
Global Const SW_SHOWMAXIMIZED = 3
'Private function
Private Declare Function apiShowWindow Lib "user32" _
Alias "ShowWindow" (ByVal hwnd As Long, _
ByVal windowModus As Long) As Long
Function SetAccessWindow(windowModus As Long)
Dim loX As Long
Dim currentForm As Form
On Error Resume Next
'Declaratie
Set currentForm = Screen.ActiveForm
If Err <> 0 Then
loX = apiShowWindow(hWndAccessApp, windowModus)
Err.Clear
End If
If windowModus = SW_SHOWMINIMIZED And currentForm.Modal = True Then
MsgBox "Cannot minimize Access with " & (currentForm.Caption + " ") & "form on screen"
ElseIf windowModus = SW_HIDE And currentForm.PopUp <> True Then
MsgBox "Cannot hide Access with " & (currentForm.Caption + " ") & "form on screen"
Else
loX = apiShowWindow(hWndAccessApp, windowModus)
End If
SetAccessWindow = (loX <> 0)
End Function