Results 1 to 3 of 3
  1. #1
    McHammer is offline Novice
    Windows XP Access 2002
    Join Date
    Apr 2010
    Location
    Italy, Milan
    Posts
    2

    Minimize access window problem


    Hi everybody,
    first post in this nice forum. My english is limited and my access knowledge too so I hope to be clear enough in explaining my problem and get you help.
    I want to minimize the access windows and have my forms only in modal popup way. I just found and copied a module (see below) that does it well except for a small side effect. I have some "animated" buttons (e.g. change font size/colour/picture etc. on click/mouse move events) on a secondary form and, after an on click event, the access window get back. Main form remains always on the background. Running the same command (e.g save record and close secondary form) from a simple button created by access toolbox (no focus on it), everything works and the access window remains minimezed. I'd like to keep my buttons, but I don't know how to move around this problem. Can someone help and explain me what's going on?

    Thanks in advance

    Here below the module. I just call the function fSetAccessWindow (SW_SHOWMINIMIZED) on form load event of the main form.

    Option Compare Database
    Option Explicit

    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

  2. #2
    ajetrumpet is offline VIP
    Windows Vista Access 2007
    Join Date
    Mar 2010
    Location
    N/A
    Posts
    2,694
    a workaround to having to minimize the access window is to simply maximize the forms and position your controls accordingly. forms maximized don't show the access window, except for maybe the title bar, which isn't an issue with most people

  3. #3
    McHammer is offline Novice
    Windows XP Access 2002
    Join Date
    Apr 2010
    Location
    Italy, Milan
    Posts
    2
    I prefer to use popup windows and nice buttons, if possible of course.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 15
    Last Post: 04-11-2015, 08:15 AM
  2. 2 questions about Access' main window
    By nford in forum Access
    Replies: 16
    Last Post: 02-28-2010, 02:47 PM
  3. get window nfo
    By alcoool in forum Access
    Replies: 3
    Last Post: 01-18-2010, 09:58 AM
  4. Access Window On top
    By Jas_The_Ace in forum Programming
    Replies: 0
    Last Post: 02-28-2009, 04:28 PM
  5. Use fixed height and width for the Access window
    By AndrewAfresh in forum Access
    Replies: 3
    Last Post: 07-05-2006, 09:20 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums