• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1254
  • Last Modified:

How do I maximize an external database window using VBA code in another Access Database?

Hi experts,

I asked a question yesterday relating to opening an external MS Access database from inside another MS Access database.  The code works in the fact that it opens up the external database, but it is not maximizing the external database window.  Instead, it is opening up the MS Access database window a third of the size if it were maximized.

The attach the code that has been used, and includes a Maximize line of code, which I thought was working, but is not.

Any help would be appreciated.

Regards
Terry
'Code below opens the external database
Set acObj = CreateObject("Access.application")
    acObj.OpenCurrentDatabase CurrentProject.Path & "\DatabaseB.mdb"
    acObj.Visible = True
    acObj.UserControl = True
    acObj.DoCmd.Maximize

Open in new window

0
TerenceHewett
Asked:
TerenceHewett
1 Solution
 
Scott McDaniel (Microsoft Access MVP - EE MVE )Infotrakker SoftwareCommented:
Maximize just maximizes the current object, not the entire window. You can try this:

accObj.DoCmd.RunCommand acCmdAppMaximize


0
 
borkiCommented:
Alternativly, you could use the shell command as in:

Shell "C:\Program Files (x86)\Microsoft Office\Office12\MSACCESS.EXE CurrentProject.Path & "\DatabaseB.mdb", vbMaximizedFocus

HTH

Felix
0
 
Scott McDaniel (Microsoft Access MVP - EE MVE )Infotrakker SoftwareCommented:
But Shell doesn't give you the accObj object, which is needed to continue working with the application.
0
Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

 
borkiCommented:
Hmm, good point, that might be a requirement...
0
 
Rey Obrero (Capricorn1)Commented:
(NO POINTS PLS)
sorry about that Terence, was in a bit hurry yesterday..
LSM post should do it.., just take Note that he is using accObj whereas your code is using acObj
0
 
TerenceHewettAuthor Commented:
Thanks for all posts. It looks as though the code LSM gave works a treat.  Thank you very much. No problems Cap. I am just really grateful for any help received.  

Regards to all

Terry
0

Featured Post

Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now