Application Window Size

  • Thread starter Thread starter Ian King
  • Start date Start date
I

Ian King

I have a database which has the facilty to open another mdb and then open a
specific form. I have used the 'CreateObject("Access.Application")' method.

It runs fine, but the application window opens in reduced size.

The only code examples I can find to maximize the application window is by
using the Shell command.

Is there another way of maximising the application window?

Many thanks

Ian King
 
Using the ShowWindow API function is one way.

Paste the following into a standard module in the app to be opened:

Private Declare Function ShowWindow Lib "user32" _
(ByVal hwnd As Long, ByVal nCmdShow As Long) As Long
Private Const SW_MAXIMIZE = 3

Public Function MaximiseApp()
ShowWindow Application.hWndAccessApp, SW_MAXIMIZE
End Function

You can then call the function MaximiseApp either from the app's autoexec
macro or the open event of the app's startup form.

HTH

Jon
 
Thanks very much for the code.

Couldn't get it to work in the db being called, but modified it to be used
in the db doing the call - works brilliantly.

Ian King
 
Strange but glad you got it working!
Ian King said:
Thanks very much for the code.

Couldn't get it to work in the db being called, but modified it to be used
in the db doing the call - works brilliantly.

Ian King
 
I think from the controling app you can also do something like this

Dim a As Access.Application
Set a = New Access.Application
a.Visible = True
a.RunCommand (acCmdAppMaximize)
 
Back
Top