Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access VBA
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old October 22nd, 2004, 06:23 PM
Registered User
 
Join Date: Oct 2004
Location: , , .
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?


Reply With Quote
  #2 (permalink)  
Old October 22nd, 2004, 06:40 PM
Authorized User
 
Join Date: Oct 2004
Location: Austin, TX, USA.
Posts: 59
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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
    Me.SetFocus

John Viescas, author
"Microsoft Office Access 2003 Inside Out"
"Running Microsoft Access 2000"
"SQL Queries for Mere Mortals"
Reply With Quote
  #3 (permalink)  
Old October 24th, 2004, 05:15 PM
Registered User
 
Join Date: Oct 2004
Location: , , .
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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
    Me.SetFocus

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

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

Best Regards,
Hans Hansson



Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

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 03: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



All times are GMT -4. The time now is 04:05 AM.


Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.