Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access VBA
Access VBA Discuss using VBA for Access programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access VBA section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old October 22nd, 2004, 06:23 PM
Registered User
Join Date: Oct 2004
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default Resize Access main window from Access form

When I open a certain form in Access I want the Access main window to disappear or at least get hidden behind the form.

I can not minimize it because that brings down my form too.

I have made my form Menu and the border Dialogue, so it can exist outside the main form.

My problem is that I can not change properties like width, height, left, and top for the main window.

I have tried following, but I do not know how to continue.

   AppActivate ("Microsoft Access")
   SendKeys "% ", False
   SendKeys "{Down}", False
   SendKeys "{Down}", False
   SendKeys "{Enter}", True

Is there anyone who can help me?

Old October 22nd, 2004, 06:40 PM
Authorized User
Join Date: Oct 2004
Posts: 59
Thanks: 0
Thanked 0 Times in 0 Posts

Put this in the Load event of your form:

    ' Select the database window
    DoCmd.SelectObject acForm, "<any form name>", True
    ' .. and hide it
    RunCommand acCmdWindowHide

    ' Make sure I have the focus

John Viescas, author
"Microsoft Office Access 2003 Inside Out"
"Running Microsoft Access 2000"
"SQL Queries for Mere Mortals"
Old October 24th, 2004, 05:15 PM
Registered User
Join Date: Oct 2004
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts

Thank you John,

Your solution works fine for forms and the database window.
What I wanted was to get rid of the Access application window.

Thanks to your sample solution I think I have found a solution to my problem.
This is what I have done:

    ' Select the Access application window
    AppActivate ("Microsoft Access")
    ' .. and minimize it
    RunCommand acCmdAppMinimize
    ' Set focus back to the form I started from

When I want to restore the application window I do this:

    ' Restore the Access application window
    AppActivate ("Microsoft Access")
    RunCommand acCmdAppRestore

Best Regards,
Hans Hansson

Similar Threads
Thread Thread Starter Forum Replies Last Post
Access Report from Access PivotTable Form Odeh Naber Access 2 July 24th, 2007 09:33 AM
Resizing Main Access Window McDiddy Access VBA 0 January 5th, 2007 04:33 AM
Window Resize arunmohanmp HTML Code Clinic 1 September 20th, 2006 03:27 AM
Resize and lock the Access Window dartcoach Access 5 June 23rd, 2005 10:35 AM
Application Window resize Draffus VB How-To 0 September 8th, 2004 03:49 PM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.