Form maximize problem

  • Thread starter Thread starter Guest
  • Start date Start date
G

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?
 
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
 
Hi Marco -- In addition to what RB recommended, you can also try moving the
code to the On Load event...
 

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

Window Sizing Question 11
Maximize the form on the screen 6
Weird Problem with DoCmd.Maximize 2
open forms 1
Hidden close button on form? 4
open form NOT maximized 2
Maximize Form 1
Maximize a form 1

Back
Top