Welcome to SPN

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

Sign Up Now!
  1. Monthly (Recurring) Target: $300 :: Achieved: $95
      Become a Supporter    ::   Make a Contribution    Let's do it!

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

More people are visiting & reading SPN than ever but far fewer are paying to sustain it. Advertising revenues across the online media have fallen fast. So you can see why we need to ask for your help. Donating to SPN's is vote for free speech, for diversity of opinions, for the right of the people to stand up to religious bigotry. Without any affiliation to any organization, this constant struggle takes a lot of hard work to sustain as we entirely depend on the contributions of our esteemed writers/readers. We do it because we believe our perspective matters – because it might well be your perspective, too... Fund our efforts and together we can keep the world informed about the real Sikh Sikhi Sikhism. If everyone who writes or reads our content, who likes it, helps us to pay for it, our future would be much more secure. Every Contribution Matters, Contribute Generously!

    Become a Supporter      ::     Make a Contribution     



Share This Page