Results 1 to 7 of 7
  1. #1
    kennyritch
    Guest

    Maximise Windows by Default (2000)

    Hi Folks

    Bit of a niggling problem I'd like some help with ...

    Is there anyway I can instruct Access to open a Database in a maximised window by default? I'm getting annoyed with having to click on the little 'maximise' button everytime.

    Sounds a bit lazy - I know - but any tips would be appreciated.

    Cheers,
    Kenny.

  2. #2
    4 Star Lounger
    Join Date
    Dec 2000
    Location
    London, Ontario, Canada
    Posts
    437
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Maximise Windows by Default (2000)

    Actually more of a Windows thing. Next time you close an Access session, hold down the Shift Key when you click the X, this makes the window size stick. Next time you open an Access session the window will size automatically to size you closed it. <img src=/S/smile.gif border=0 alt=smile width=15 height=15>

  3. #3
    Gold Lounger Rebel's Avatar
    Join Date
    Jul 2001
    Location
    Canada
    Posts
    3,024
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Maximise Windows by Default (2000)

    You can also assign a "Maximize" macro to the "OnOpen" event to the initial screen of your database. Everything from here forward will then open maximized. Just remember to design all of the remaining forms in the maximized format.

    John
    John
    A Child's Mind, Once Stretched by Imagination...
    Never Regains Its Original Dimensions

  4. #4
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Maximise Windows by Default (2000)

    Maximizing a form doesn't maximize the Access main window, it only maximizes the form itself and anything else you open in the window until it hits a Restore or Minimize command.
    Charlotte

  5. #5
    4 Star Lounger
    Join Date
    Jan 2001
    Location
    Altnau, Thurgau, Switzerland
    Posts
    447
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Maximise Windows by Default (2000)

    A little bit of windows API programming is called for:-

    'In a code module

    ' ShowWindow() Commands
    Public Const SW_HIDE = 0
    Public Const SW_SHOWNORMAL = 1
    Public Const SW_NORMAL = 1
    Public Const SW_SHOWMINIMIZED = 2
    Public Const SW_SHOWMAXIMIZED = 3
    Public Const SW_MAXIMIZE = 3
    Public Const SW_SHOWNOACTIVATE = 4
    Public Const SW_SHOW = 5
    Public Const SW_MINIMIZE = 6
    Public Const SW_SHOWMINNOACTIVE = 7
    Public Const SW_SHOWNA = 8
    Public Const SW_RESTORE = 9
    Public Const SW_SHOWDEFAULT = 10
    Public Const SW_MAX = 10


    Declare Function ShowWindow Lib "user32" Alias "ShowWindow" (ByVal hwnd As Long, ByVal nCmdShow As Long) As Long


    '************************************************* **********************************

    'In startup routine
    ShowWindow hWndAccessApp, SW_SHOWMAXIMIZED

  6. #6
    Silver Lounger
    Join Date
    Jan 2001
    Location
    Indianapolis, Indiana, USA
    Posts
    1,862
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Maximise Windows by Default (2000)

    I would agree. I've used the API call to maximize and it works VERY well!

    Just as an aside: I came across a website recommended by Chris Greaves (<A target="_blank" HREF=http://www.allapi.net>All API.NET</A>). There is a free API Tool that includes a complete reference with examples. Although this seems to be intended primarily for VB, everything I've tried works just the same in Access/VBA.

    This tool has totally taken away my fear of using API functions. Here's a link to the download page: <A target="_blank" HREF=http://www.allapi.net/agnet/index.php>http://www.allapi.net/agnet/index.php</A>

    HTH <img src=/S/thumbup.gif border=0 alt=thumbup width=15 height=15>

  7. #7
    4 Star Lounger
    Join Date
    Jan 2001
    Location
    Altnau, Thurgau, Switzerland
    Posts
    447
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Maximise Windows by Default (2000)

    The first time one meets the Windows API can be a frightening experience. I went through that learning curve many years ago with Visual C++ version 1.0. Virtually everything can be used with VBA. I may be wrong but I believe only calls requiring callback functions (such as EnumerateWindows) as not possible.

    as an aside I like C++ because of the control one has and in the past it was impossible to code dll's in Visual Basic. I used my first functional dll developed with Vis C++ ver 1.0 in Access 2.0 a couple of months after it (Access 2.0) had been released to 'solve' a problem that microsoft couldn't assist in solving.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •