Application Window Size

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
 
J

Jon Lewis

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
 
I

Ian King

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
 
J

Jon Lewis

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
 
D

DanRoss

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)
 

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