p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/index.php)
-   Access VBA (http://p2p.wrox.com/forumdisplay.php?f=80)
-   -   Resize Access main window from Access form (http://p2p.wrox.com/showthread.php?t=20277)

hasseh October 22nd, 2004 06:23 PM

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?

JLovell October 22nd, 2004 06:40 PM

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"

hasseh October 24th, 2004 05:15 PM

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

All times are GMT -4. The time now is 06:02 PM.

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