Solved

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

Posted on 2010-08-19
6
890 Views
Last Modified: 2013-11-27
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
Comment
Question by:TerenceHewett
6 Comments
 
LVL 84

Accepted Solution

by:
Scott McDaniel (Microsoft Access MVP - EE MVE ) earned 500 total points
ID: 33473426
Maximize just maximizes the current object, not the entire window. You can try this:

accObj.DoCmd.RunCommand acCmdAppMaximize


0
 
LVL 9

Expert Comment

by:borki
ID: 33473465
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
 
LVL 84
ID: 33473508
But Shell doesn't give you the accObj object, which is needed to continue working with the application.
0
Backup Your Microsoft Windows Server®

Backup all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

 
LVL 9

Expert Comment

by:borki
ID: 33473575
Hmm, good point, that might be a requirement...
0
 
LVL 119

Expert Comment

by:Rey Obrero
ID: 33474138
(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
 

Author Comment

by:TerenceHewett
ID: 33480992
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article is a continuation or rather an extension from Cascading Combos (http://www.experts-exchange.com/A_5949.html) and builds on examples developed in detail there. It should be understandable alone, but I recommend reading the previous artic…
Overview: This article:       (a) explains one principle method to cross-reference invoice items in Quickbooks®       (b) explores the reasons one might need to cross-reference invoice items       (c) provides a sample process for creating a M…
Familiarize people with the process of utilizing SQL Server views from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Access…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

914 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now