Welcome to SPN

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

Sign Up Now!

Maximising and Restoring forms

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

  1. MartinR

    MartinR
    Expand Collapse
    Guest

    I want my main user interface form to at all times be maximised. I want
    forms that are opened from my main user interface form to open as a
    restored size. I can do this easily but when i close those forms my
    main user interface also has moved to a restored size. I do not want to
    have my main user inter face opening each time as the data would be
    refreshed then. Is there a way of setting the main user interface form
    to always be maximised?

    Any ideas, Thanks
     
  2. Loading...

    Similar Threads Forum Date
    Sikh Foundation Preserving and Restoring - keeping our heritage alive! Sikh Organisations Jul 11, 2010
    Sikh News SGPC to focus on restoring Sikh history (IE via Yahoo! India News) Breaking News May 31, 2008
    Sikh News SGPC to focus on restoring Sikh history (Express India) Breaking News May 31, 2008

  3. Wayne-I-M

    Wayne-I-M
    Expand Collapse
    Guest

    Private Sub Form_Open(Cancel As Integer)
    DoCmd.Maximize
    End Sub



    --
    Wayne
    Manchester, England.



    "MartinR" wrote:

    > I want my main user interface form to at all times be maximised. I want
    > forms that are opened from my main user interface form to open as a
    > restored size. I can do this easily but when i close those forms my
    > main user interface also has moved to a restored size. I do not want to
    > have my main user inter face opening each time as the data would be
    > refreshed then. Is there a way of setting the main user interface form
    > to always be maximised?
    >
    > Any ideas, Thanks
    >
    >
     
  4. MartinR

    MartinR
    Expand Collapse
    Guest

    That will only work when the form is reopened. When a form is opened
    from my main user interface form and is opened as a restored size, my
    user inter face form also gets changed to a restored size, so when i go
    back to view it its not maximised.

    Any other ideas?
     
  5. Wayne-I-M

    Wayne-I-M
    Expand Collapse
    Guest

    Not really sure what you mean by
    > When a form is opened from my main user interface form and is opened as a restored size,


    But try this

    Private Sub Form_Current()
    DoCmd.Maximize
    End Sub

    If this will not work please can you explain in simple terms (I'm a bit slow
    this morning) whats happening with the form sizes - and if poss can you post
    the code you use to size your forms.


    --
    Wayne
    Manchester, England.



    "MartinR" wrote:

    > That will only work when the form is reopened. When a form is opened
    > from my main user interface form and is opened as a restored size, my
    > user inter face form also gets changed to a restored size, so when i go
    > back to view it its not maximised.
    >
    > Any other ideas?
    >
    >
     
  6. JK

    JK
    Expand Collapse
    Guest

    Further to the DoCmd.Maximaized as Wayne suggested:

    In Form design properties, set the MinMax Buttons to None
    Apparently it can't be set in VBA

    Regards/JK


    "MartinR" <martin.ryan@esbi.ie> wrote in message
    news:1153903703.993517.151290@p79g2000cwp.googlegroups.com...
    > That will only work when the form is reopened. When a form is opened
    > from my main user interface form and is opened as a restored size, my
    > user inter face form also gets changed to a restored size, so when i go
    > back to view it its not maximised.
    >
    > Any other ideas?
    >
     
  7. MartinR

    MartinR
    Expand Collapse
    Guest

    Sorry but that didnt work either.
     
  8. Wayne-I-M

    Wayne-I-M
    Expand Collapse
    Guest

    Use the this on your "main" form (the one you want to stay maximised)

    Private Sub Form_Open(Cancel As Integer)
    DoCmd.Maximize
    End Sub

    Set the PopUp value to "Yes" for all other forms. If you want them to be
    centered then set this (AutoCenter) to "Yes". If you leave this at "No" then
    you can set the position and size of each "other" form and no affect the size
    of the "main" form

    Let me know if we are getting there.



    --
    Wayne
    Manchester, England.



    "MartinR" wrote:

    > Sorry but that didnt work either.
    >
    >
     
  9. Pieter Wijnen

    Pieter Wijnen
    Expand Collapse
    Guest

    use the Activate Event
    ie

    (general)
    Private Declare Function IsZoomed Lib "User32.dll" (ByVal hWnd As Long) As
    Long

    Private Sub Form_Activate()
    If Not IsZoomed(Me.Hwnd) Then
    DoCmd.Maximize
    End If
    End Sub

    The reason why you need to use IsZoomed is that DoCmd tends to Reactivate
    the form

    Pieter

    "Wayne-I-M" <WayneIM@discussions.microsoft.com> wrote in message
    news:BFD463CE-C8A5-40A7-8A66-FD54CB35685F@microsoft.com...
    > Use the this on your "main" form (the one you want to stay maximised)
    >
    > Private Sub Form_Open(Cancel As Integer)
    > DoCmd.Maximize
    > End Sub
    >
    > Set the PopUp value to "Yes" for all other forms. If you want them to be
    > centered then set this (AutoCenter) to "Yes". If you leave this at "No"
    > then
    > you can set the position and size of each "other" form and no affect the
    > size
    > of the "main" form
    >
    > Let me know if we are getting there.
    >
    >
    >
    > --
    > Wayne
    > Manchester, England.
    >
    >
    >
    > "MartinR" wrote:
    >
    >> Sorry but that didnt work either.
    >>
    >>
     
  10. Pieter Wijnen

    Pieter Wijnen
    Expand Collapse
    Guest

    use the Activate Event
    ie

    (general)
    Private Declare Function IsZoomed Lib "User32.dll" (ByVal hWnd As Long) As
    Long

    Private Sub Form_Activate()
    If Not IsZoomed(Me.Hwnd) Then
    DoCmd.Maximize
    End If
    End Sub

    The reason why you need to use IsZoomed is that DoCmd tends to Reactivate
    the form

    Pieter

    "Wayne-I-M" <WayneIM@discussions.microsoft.com> wrote in message
    news:BFD463CE-C8A5-40A7-8A66-FD54CB35685F@microsoft.com...
    > Use the this on your "main" form (the one you want to stay maximised)
    >
    > Private Sub Form_Open(Cancel As Integer)
    > DoCmd.Maximize
    > End Sub
    >
    > Set the PopUp value to "Yes" for all other forms. If you want them to be
    > centered then set this (AutoCenter) to "Yes". If you leave this at "No"
    > then
    > you can set the position and size of each "other" form and no affect the
    > size
    > of the "main" form
    >
    > Let me know if we are getting there.
    >
    >
    >
    > --
    > Wayne
    > Manchester, England.
    >
    >
    >
    > "MartinR" wrote:
    >
    >> Sorry but that didnt work either.
    >>
    >>




    --
    ----------------------------------------
    I am using the free version of SPAMfighter for private users.
    It has removed 4367 spam emails to date.
    Paying users do not have this message in their emails.
    Get the free SPAMfighter here: http://www.spamfighter.com/len
     
  11. Wayne-I-M

    Wayne-I-M
    Expand Collapse
    Guest

    Hi Pieter

    I'm sure you're right about this but I though that the "IsZoomed" was a
    standard declaration module and not directly behind the form. I have a copy
    of the MS module but have never used it as it seems a bit over the top for a
    simple to solve problem.

    Also I think that the original question

    “I want my main user interface form to at all times be maximisedâ€

    was simply asking about trying to stop the main form from reducing (after
    DoCmd.Maximize - OnLoad) when any subforms where shut. As he wanted his main
    form to stay "maximised" then surely the answer would have simply been to
    make the other forms PopUp (and dialog). It may be a bit of a cheat but that
    what I tend to do.

    Would you advise a standard module?

    Any advice appreciated

    Cheers

    --
    Wayne
    Manchester, England.



    "Pieter Wijnen" wrote:

    > use the Activate Event
    > ie
    >
    > (general)
    > Private Declare Function IsZoomed Lib "User32.dll" (ByVal hWnd As Long) As
    > Long
    >
    > Private Sub Form_Activate()
    > If Not IsZoomed(Me.Hwnd) Then
    > DoCmd.Maximize
    > End If
    > End Sub
    >
    > The reason why you need to use IsZoomed is that DoCmd tends to Reactivate
    > the form
    >
    > Pieter
    >
    > "Wayne-I-M" <WayneIM@discussions.microsoft.com> wrote in message
    > news:BFD463CE-C8A5-40A7-8A66-FD54CB35685F@microsoft.com...
    > > Use the this on your "main" form (the one you want to stay maximised)
    > >
    > > Private Sub Form_Open(Cancel As Integer)
    > > DoCmd.Maximize
    > > End Sub
    > >
    > > Set the PopUp value to "Yes" for all other forms. If you want them to be
    > > centered then set this (AutoCenter) to "Yes". If you leave this at "No"
    > > then
    > > you can set the position and size of each "other" form and no affect the
    > > size
    > > of the "main" form
    > >
    > > Let me know if we are getting there.
    > >
    > >
    > >
    > > --
    > > Wayne
    > > Manchester, England.
    > >
    > >
    > >
    > > "MartinR" wrote:
    > >
    > >> Sorry but that didnt work either.
    > >>
    > >>

    >
    >
    >
    > --
    > ----------------------------------------
    > I am using the free version of SPAMfighter for private users.
    > It has removed 4367 spam emails to date.
    > Paying users do not have this message in their emails.
    > Get the free SPAMfighter here: http://www.spamfighter.com/len
    >
    >
    >
     
  12. Pieter Wijnen

    Pieter Wijnen
    Expand Collapse
    Guest

    Yes, A DoCmd.Restore will affect All forms, so the .Popup is the only way to
    ensure it'll stay maxed all the time
    And Yes the IsZoomed Function is a part of the Operating System, not
    Access - but Win API Calls are very usefull when the Access guys
    There is excellent code at http://www.mvps.org/access/API to ensure a form
    is sized to the limits of the MDI window, mimmicking the maxed size
    haven't (yet) implemented functionallity into VBA or other standard
    Libraries


    Pieter

    "Wayne-I-M" <WayneIM@discussions.microsoft.com> wrote in message
    news:BB70A792-6CC4-466B-A411-0F76645EBC2B@microsoft.com...
    > Hi Pieter
    >
    > I'm sure you're right about this but I though that the "IsZoomed" was a
    > standard declaration module and not directly behind the form. I have a
    > copy
    > of the MS module but have never used it as it seems a bit over the top for
    > a
    > simple to solve problem.
    >
    > Also I think that the original question
    >
    > "I want my main user interface form to at all times be maximised"
    >
    > was simply asking about trying to stop the main form from reducing (after
    > DoCmd.Maximize - OnLoad) when any subforms where shut. As he wanted his
    > main
    > form to stay "maximised" then surely the answer would have simply been to
    > make the other forms PopUp (and dialog). It may be a bit of a cheat but
    > that
    > what I tend to do.
    >
    > Would you advise a standard module?
    >
    > Any advice appreciated
    >
    > Cheers
    >
    > --
    > Wayne
    > Manchester, England.
    >
    >
    >
    > "Pieter Wijnen" wrote:
    >
    >> use the Activate Event
    >> ie
    >>
    >> (general)
    >> Private Declare Function IsZoomed Lib "User32.dll" (ByVal hWnd As Long)
    >> As
    >> Long
    >>
    >> Private Sub Form_Activate()
    >> If Not IsZoomed(Me.Hwnd) Then
    >> DoCmd.Maximize
    >> End If
    >> End Sub
    >>
    >> The reason why you need to use IsZoomed is that DoCmd tends to Reactivate
    >> the form
    >>
    >> Pieter
    >>
    >> "Wayne-I-M" <WayneIM@discussions.microsoft.com> wrote in message
    >> news:BFD463CE-C8A5-40A7-8A66-FD54CB35685F@microsoft.com...
    >> > Use the this on your "main" form (the one you want to stay maximised)
    >> >
    >> > Private Sub Form_Open(Cancel As Integer)
    >> > DoCmd.Maximize
    >> > End Sub
    >> >
    >> > Set the PopUp value to "Yes" for all other forms. If you want them to
    >> > be
    >> > centered then set this (AutoCenter) to "Yes". If you leave this at
    >> > "No"
    >> > then
    >> > you can set the position and size of each "other" form and no affect
    >> > the
    >> > size
    >> > of the "main" form
    >> >
    >> > Let me know if we are getting there.
    >> >
    >> >
    >> >
    >> > --
    >> > Wayne
    >> > Manchester, England.
    >> >
    >> >
    >> >
    >> > "MartinR" wrote:
    >> >
    >> >> Sorry but that didnt work either.
    >> >>
    >> >>

    >>
    >>
    >>
    >> --
    >> ----------------------------------------
    >> I am using the free version of SPAMfighter for private users.
    >> It has removed 4367 spam emails to date.
    >> Paying users do not have this message in their emails.
    >> Get the free SPAMfighter here: http://www.spamfighter.com/len
    >>
    >>
    >>
     
  13. Pieter Wijnen

    Pieter Wijnen
    Expand Collapse
    Guest

    Yes, A DoCmd.Restore will affect All forms, so the .Popup is the only way to
    ensure it'll stay maxed all the time
    And Yes the IsZoomed Function is a part of the Operating System, not
    Access - but Win API Calls are very usefull when the Access guys
    There is excellent code at http://www.mvps.org/access/API to ensure a form
    is sized to the limits of the MDI window, mimmicking the maxed size
    haven't (yet) implemented functionallity into VBA or other standard
    Libraries


    Pieter

    "Wayne-I-M" <WayneIM@discussions.microsoft.com> wrote in message
    news:BB70A792-6CC4-466B-A411-0F76645EBC2B@microsoft.com...
    > Hi Pieter
    >
    > I'm sure you're right about this but I though that the "IsZoomed" was a
    > standard declaration module and not directly behind the form. I have a
    > copy
    > of the MS module but have never used it as it seems a bit over the top for
    > a
    > simple to solve problem.
    >
    > Also I think that the original question
    >
    > "I want my main user interface form to at all times be maximised"
    >
    > was simply asking about trying to stop the main form from reducing (after
    > DoCmd.Maximize - OnLoad) when any subforms where shut. As he wanted his
    > main
    > form to stay "maximised" then surely the answer would have simply been to
    > make the other forms PopUp (and dialog). It may be a bit of a cheat but
    > that
    > what I tend to do.
    >
    > Would you advise a standard module?
    >
    > Any advice appreciated
    >
    > Cheers
    >
    > --
    > Wayne
    > Manchester, England.
    >
    >
    >
    > "Pieter Wijnen" wrote:
    >
    >> use the Activate Event
    >> ie
    >>
    >> (general)
    >> Private Declare Function IsZoomed Lib "User32.dll" (ByVal hWnd As Long)
    >> As
    >> Long
    >>
    >> Private Sub Form_Activate()
    >> If Not IsZoomed(Me.Hwnd) Then
    >> DoCmd.Maximize
    >> End If
    >> End Sub
    >>
    >> The reason why you need to use IsZoomed is that DoCmd tends to Reactivate
    >> the form
    >>
    >> Pieter
    >>
    >> "Wayne-I-M" <WayneIM@discussions.microsoft.com> wrote in message
    >> news:BFD463CE-C8A5-40A7-8A66-FD54CB35685F@microsoft.com...
    >> > Use the this on your "main" form (the one you want to stay maximised)
    >> >
    >> > Private Sub Form_Open(Cancel As Integer)
    >> > DoCmd.Maximize
    >> > End Sub
    >> >
    >> > Set the PopUp value to "Yes" for all other forms. If you want them to
    >> > be
    >> > centered then set this (AutoCenter) to "Yes". If you leave this at
    >> > "No"
    >> > then
    >> > you can set the position and size of each "other" form and no affect
    >> > the
    >> > size
    >> > of the "main" form
    >> >
    >> > Let me know if we are getting there.
    >> >
    >> >
    >> >
    >> > --
    >> > Wayne
    >> > Manchester, England.
    >> >
    >> >
    >> >
    >> > "MartinR" wrote:
    >> >
    >> >> Sorry but that didnt work either.
    >> >>
    >> >>

    >>
    >>
    >>
    >> --
    >> ----------------------------------------
    >> I am using the free version of SPAMfighter for private users.
    >> It has removed 4367 spam emails to date.
    >> Paying users do not have this message in their emails.
    >> Get the free SPAMfighter here: http://www.spamfighter.com/len
    >>
    >>
    >>




    --
    ----------------------------------------
    I am using the free version of SPAMfighter for private users.
    It has removed 4367 spam emails to date.
    Paying users do not have this message in their emails.
    Get the free SPAMfighter here: http://www.spamfighter.com/len
     

Share This Page