Results 1 to 6 of 6
  1. #1
    Star Lounger
    Join Date
    Feb 2001
    Posts
    57
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Minimize DB (Access 2000)

    Is there anyway to have the main database window minimize or resized to the size of a startup form?

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Minimize DB (Access 2000)

    If you want to minimize the Access application window to the taskbar, you need some Windows API stuff to do that:

    <img src=/w3timages/blueline.gif width=33% height=2>

    Public Type Rect
    X1 As Long
    Y1 As Long
    X2 As Long
    Y2 As Long
    End Type

    Public Type PointAPI
    x As Long
    y As Long
    End Type

    Public Type WindowPlacement
    Length As Long
    Flags As Long
    showCmd As Long
    ptMinPosition As PointAPI
    ptMaxPosition As PointAPI
    rcNormalPosition As Rect
    End Type

    Public Declare Function GetWindowPlacement Lib "user32" _
    (ByVal hWnd As Long, lpWndPl As WindowPlacement) As Long

    Public Declare Function SetWindowPlacement Lib "user32" _
    (ByVal hWnd As Long, lpWndPl As WindowPlacement) As Long

    Public Const SW_Maximize = 3
    Public Const SW_Minimize = 6
    Public Const SW_Restore = 9

    Public Sub AccessWindow(sw As Long)
    Dim wp As WindowPlacement
    GetWindowPlacement Application.hWndAccessApp, wp
    wp.showCmd = sw
    SetWindowPlacement Application.hWndAccessApp, wp
    End Sub

    <img src=/w3timages/blueline.gif width=33% height=2>

    To minimize the Access window, use

    AccessWindow SW_Minimize

    I don't know how to shrink the Access window so that a form fits precisely in the client area. Perhaps somebody else can help there.

  3. #3
    Star Lounger
    Join Date
    Feb 2001
    Posts
    57
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Minimize DB (Access 2000)

    Thanks, I tried this technique earlier, however I am searching for a way to shrink the Access window so that a form (which is a pop-up) fits exactly in the client area.

  4. #4
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Minimize DB (Access 2000)

    Why not just maximize the startup form?
    Charlotte

  5. #5
    Star Lounger
    Join Date
    Feb 2001
    Posts
    57
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Minimize DB (Access 2000)

    It is a small 3" x 3" popup form. It would be nice not to see the Access application window behind it if possible.

  6. #6
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Minimize DB (Access 2000)

    Well, there are a few tricks to accomplish this. The only one I remember at the moment is to reduce the height of the main window manually and then drag it off the screen before closing the database. If your startup form is a popup, it will popup on the screen the next time you open the database, but the main window will remain where you placed it. Position the startup form where you want it to appear and close the db again. If you play with it a bit, you can make it work. I've never even attempted to do this from code so I don't know if it can be done that way.

    There's another method that involves reducing the main window and hiding it behind the popup form, but I don't recall the specific ins and outs of it. It should be similar to the method I described above though.
    Charlotte

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •