Hiding Access

M

Mark A. Sam

My client wanted a small form which displayed stats to reside on the top of
screen. It is probably a application better suited for VB or C++, but I
don't know them so I did it in Access. I am able to hide Access behind the
popup window, however resizing it will make it inconvenient when the user
opens Access for other applications. I found a function on the Access Web
which is exactly what I need (posted below) , but isn't working the way I
need. I don't know if it is the Access Version or other issue like the
operating system.

My client is using Access 2000 on Win 2000 server. When I execute the
function, Access disappears but also the popup window I want to display.
However, and Access button resided on the task bar.

On my machine at home I tested the function using Access 2002 on Win XP.
Access disappeared as well as the popup window, however the Access button
also disappeared from the task bar and did not show up in the task manager
under the Applications tab. It did show under the processed tab however and
I was able to shut it down.

I would appreciate any help either with the function or another method of
hiding Access, but allowing the Popup screen to appear.

God Bless,

Mark A.Sam
'************ Code Start **********
' This code was originally written by Dev Ashish.
' It is not to be altered or distributed,
' except as part of an application.
' You are free to use it in any application,
' provided the copyright notice is left unchanged.
'
' Code Courtesy of
' Dev Ashish
'
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)
'Usage Examples
'Maximize window:
' ?fSetAccessWindow(SW_SHOWMAXIMIZED)
'Minimize window:
' ?fSetAccessWindow(SW_SHOWMINIMIZED)
'Hide window:
' ?fSetAccessWindow(SW_HIDE)
'Normal window:
' ?fSetAccessWindow(SW_SHOWNORMAL)
'
Dim loX As Long
Dim loForm As Form
On Error Resume Next
Set loForm = Screen.ActiveForm
If Err <> 0 Then 'no Activeform
If nCmdShow = SW_HIDE Then
MsgBox "Cannot hide Access unless " _
& "a form is on screen"
Else
loX = apiShowWindow(hWndAccessApp, nCmdShow)
Err.Clear
End If
Else
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
End If
fSetAccessWindow = (loX <> 0)
End Function

'************ Code End **********
 
R

Rick Brandt

Mark A. Sam said:
My client wanted a small form which displayed stats to reside on the top of
screen. It is probably a application better suited for VB or C++, but I
don't know them so I did it in Access. I am able to hide Access behind the
popup window, however resizing it will make it inconvenient when the user
opens Access for other applications. I found a function on the Access Web
which is exactly what I need (posted below) , but isn't working the way I
need. I don't know if it is the Access Version or other issue like the
operating system.

My client is using Access 2000 on Win 2000 server. When I execute the
function, Access disappears but also the popup window I want to display.
However, and Access button resided on the task bar.

Does your form have the Popup property set to Yes. It needs to as that is the
only way that an Access form can exist "outside" the main Access window.
 
M

Mark A. Sam

Rick,

Yes, in fact I am able to hide the Access Window behind the form.

God Bless,

Mark
..
 
D

Dirk Goldgar

Rick Brandt said:
Does your form have the Popup property set to Yes. It needs to as
that is the only way that an Access form can exist "outside" the main
Access window.

The form may need to have both its Popup and Modal properties set to
Yes.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top