Form_Resize & Minimize

D

Dirk Goldgar

a said:
I have Switchboard form(StartUp Form) with No Minimize No Maximize No
Control box

In the form resize I put this code because I don't want allow the user to
change the layout of the form I want the form as is (Maximized on Screen)

Private Sub Form_Resize()

DoCmd.Maximize

End Sub



And I have this command button with this code

Private Sub cmdMinimize _Click()

DoCmd.RunCommand acCmdAppMinimize

End Sub

I want The code in this button Minimize the form but with the code in
form_resize I can't minimize the form

How can I force the form to minimize?

How can I cancel the Form_Resize from the command button

I hope you understand me


You could use a module-level flag variable to control whether the form may
be resized or not. For example,

'----- start of example code -----
Dim mblnAllowResize As Boolean ' Variable defined at module level

Private Sub Form_Resize()

If mblnAllowResize = False Then
DoCmd.Maximize
End If

End Sub

Private Sub cmdMinimize _Click()

mblnAllowResize = True
DoCmd.Minimize

End Sub
'----- end of example code -----

But you'll need some means to set the flag variable back to False and
restore the form. I'm not sure what that would be, but maybe this will give
you an idea.
 
A

a

I have Switchboard form(StartUp Form) with No Minimize No Maximize No
Control box

In the form resize I put this code because I don't want allow the user to
change the layout of the form I want the form as is (Maximized on Screen)

Private Sub Form_Resize()

DoCmd.Maximize

End Sub



And I have this command button with this code

Private Sub cmdMinimize _Click()

DoCmd.RunCommand acCmdAppMinimize

End Sub

I want The code in this button Minimize the form but with the code in
form_resize I can't minimize the form

How can I force the form to minimize?

How can I cancel the Form_Resize from the command button

I hope you understand me
 

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

Top