Cannot maximize second database

N

NevilleT

I am opening a second Access database from within an Access database. The
problem I have is that I cannot get the second database to maximize. It
opens at postage stamp size. The code I am using is

Set appAccess = New Access.Application
appAccess.Visible = True
appAccess.OpenCurrentDatabase strDBName
appAccess.DoCmd.Maximize
appAccess.DoCmd.OpenForm strFormName
 
B

BeWyched

Hi NevilleT

Delete the last line of your coding and, instead, add the strFormName form
to the application's StartUp page - Tools > StartUp > Display Form.

That should sort it - I don't know why but it should! I had the same problem
which manifested itself when the specified form was a pop-up/modal.

Cheers.

BW
 
N

NevilleT

Thanks for the tip. For some reason it is now displaying at about half
screen size. I will try your tip however and see if it helps.
Thanks
Neville
 
D

DAVID

appAccess.DoCmd.Maximize

As it happens, that command doesn't maximise
Access -- it maximises the form open inside
Access.

What you want is
DoCmd.RunCommand acCmdAppMaximize

Since you don't have a form open inside Access,
perhaps that version of Access and that version
of Windows has decided that you don't need a
very large window?

(david)
 
N

NevilleT

Hi David
That did not work but I understand the theory. I finally solved it by
creating an autoexec macro to maximize the application. Another odd thing is
that if I don't open the form from the first database, the second opens then
immediatly closes. No problem to open it from the calling database but am
curious as to why the second one opens then closes.

Thanks for your help David
 
D

DAVID

Don't know what exactly is going on, (maybe
it's a security setting? or a problem on your
PC?) but it is possible to open either in
a user mode (stay open until you shut it) or
in a system mode (close when appAccess goes out
of scope). When you open like that you normally
have to either have a global appAccess object,
or do something to switch the application into
user mode.

(david)
 

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