Maximising and Restoring forms

M

MartinR

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
 
M

MartinR

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?
 
G

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

JK

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
 
G

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

Pieter Wijnen

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
 
P

Pieter Wijnen

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



--
 
G

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
 
P

Pieter Wijnen

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
 
P

Pieter Wijnen

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 said:
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



--
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Resizeing Windows 1
Specify size of datasheet form 4
Open a form while hiding Access DB interface. 1
Forms 2
report error message 1
Database Display 4
Maximising forms 1
Main and Sub Forms repost 2

Top