Solved

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

Posted on 2010-08-19
6
1,015 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
6 Comments
 
LVL 85

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 85
ID: 33473508
But Shell doesn't give you the accObj object, which is needed to continue working with the application.
0
SharePoint Admin?

Enable Your Employees To Focus On The Core With Intuitive Onscreen Guidance That is With You At The Moment of Need.

 
LVL 9

Expert Comment

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

Expert Comment

by:Rey Obrero (Capricorn1)
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

SharePoint Admin?

Enable Your Employees To Focus On The Core With Intuitive Onscreen Guidance That is With You At The Moment of Need.

Question has a verified solution.

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

It’s the first day of March, the weather is starting to warm up and the excitement of the upcoming St. Patrick’s Day holiday can be felt throughout the world.
You need to know the location of the Office templates folder, so that when you create new templates, they are saved to that location, and thus are available for selection when creating new documents.  The steps to find the Templates folder path are …
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

691 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