Maximize the screen

klwu

Brainy!!
Local time
Today, 11:31
Joined
Sep 13, 2004
Messages
47
Is there any code to make the database screens always stay in maximized?
Especially when the user opens up the database. I want Access maximizes itself when someone executes the database. Any idea? Thanks.
 
Windows API

I successfully use the following code in the form set to be the start-up form of the database (AC97)...

Doesn't make the application window stay maximized, but does maximize both the application window (first) and start-up form (second) when it is opened.

Code:
Private Declare Function apiShowWindow Lib "user32" _
    Alias "ShowWindow" (ByVal hWnd As Long, _
          ByVal nCmdShow As Long) As Long


Private Sub Form_Open(Cancel As Integer)
    Const SW_SHOWMAXIMIZED As Long = 3
    Dim lngResult As Long

    'Maximize the MS Access appplication window
    lngResult = apiShowWindow(hWndAccessApp, SW_SHOWMAXIMIZED)
    
    'Maximise the form
    DoCmd.Maximize
End Sub

HTH

Regards

John.
 
Last edited:
Of course I have since found a much easier way of doing this in This Thread :)

But similar to the poster in the linked thread, I couldn't find this method, as I was searching help (AC97) for maximize, and the properties/methods of the application object, to no avail. :mad:
 
Additionally, opening the form as modal or dialog should keep it's focus and not let you click on another window until the form is closed.

-modest
 

Users who are viewing this thread

Back
Top Bottom