Welcome to SPN

Register and Join the most happening forum of Sikh community & intellectuals from around the world.

Sign Up Now!

Form Maximize Problem

Discussion in 'Information Technology' started by MarcoR, Jul 28, 2006.

  1. MarcoR

    MarcoR
    Expand Collapse
    Guest

    I have a form which is maximized on open with Docmd.Maximize.
    I have a few command buttons to preview reports on that form.
    Whenever I preview a report and close the report, the form is no longer
    maximized.
    How can I keep the form maximized after preview of a form?
     
  2. Loading...


  3. OP
    RB Smissaert

    RB Smissaert
    Expand Collapse
    Guest

    If you have/can get the hwnd of that form then this will do it:

    Private Declare Function SetWindowLong _
    Lib "user32" Alias _
    "SetWindowLongA" (ByVal hwnd As Long, _
    ByVal nIndex As Long, _
    ByVal dwNewLong As Long) As
    Long
    Private Declare Function ShowWindow _
    Lib "user32" (ByVal hwnd As Long, _
    ByVal nCmdShow As Long) As Long

    Sub MaxWindow(lHwnd As Long)

    ShowWindow lHwnd, 0
    SetWindowLong lHwnd, -20, &H40101
    ShowWindow lHwnd, 3

    End Sub

    RBS


    "MarcoR" <MarcoR@discussions.microsoft.com> wrote in message
    news:9F14D05E-239E-49D6-A1A3-26C0E343BCEC@microsoft.com...
    >I have a form which is maximized on open with Docmd.Maximize.
    > I have a few command buttons to preview reports on that form.
    > Whenever I preview a report and close the report, the form is no longer
    > maximized.
    > How can I keep the form maximized after preview of a form?
     
  4. OP
    xRoachx

    xRoachx
    Expand Collapse
    Guest

    Hi Marco -- In addition to what RB recommended, you can also try moving the
    code to the On Load event...

    "MarcoR" wrote:

    > I have a form which is maximized on open with Docmd.Maximize.
    > I have a few command buttons to preview reports on that form.
    > Whenever I preview a report and close the report, the form is no longer
    > maximized.
    > How can I keep the form maximized after preview of a form?
     
Since you're here... we have a small favor to ask...     Become a Supporter      ::     Make a Contribution     


Share This Page