Hiding Access

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: Mark A. Sam (msam_at_Plan-It-Earth.Net)
Date: 11/25/04


Date: Thu, 25 Nov 2004 07:50:47 -0500

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 **********



Relevant Pages

  • Re: PHP Session in new window
    ... In the form that submits to the popup window, ... Create a hidden field in my form with the session ID ... >> Problem is on return (successful transaction etc) I cannot access the ...
    (alt.php)
  • Re: Open access-application with fixed size
    ... >I am trying to open Access with a popupform in front an access window hide. ... > ' This code was originally written by Dev Ashish. ... > Global Const SW_SHOWNORMAL = 1 ...
    (microsoft.public.access.formscoding)
  • Re: Frontpage query
    ... You need to select a target other than the default target which is probably ... To open your flash in a popup window while keeping your viewers on the ...
    (microsoft.public.frontpage)
  • Re: Why so much emotion about IWB 2.0.5? was re: other stuff and re: IBM Web Browser v2.0.5 is here
    ... It looks like IBM has fixed some of the problems reported as fixed in Mozilla 1.7.5. ... MFSA 2005-13 "Window Injection Spoofing" is still there. ... If you don't have popups blocked, the spoofed window does open, but it opens as a popup window so it doesn't seem very serious since popup windows can display just about anything their creator wants, anyway. ... You could be a victim in this way but it looks unlikely since there would first have to be the malicious website with the bad link and then you would have to be pretty 'unwise' to enter any significant data into ...
    (comp.os.os2.apps)
  • Re: Problem with session time out
    ... > still open up the child window and the redirection to the login page was ... But i would like to redirect on the parent ... > window instead of the popup window. ...
    (microsoft.public.dotnet.framework.aspnet)