Results 1 to 1 of 1

Thread: [FAQ's: OD] How do I resize Access' windows?

  1. #1

    Thread Starter
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,710

    [FAQ's: OD] How do I resize Access' windows?

    There are a few ways to resize Access:
    1.) Resize an Access Child window (Maximize to the Parent Access window or restore).
    2.) Resize the main Access Parent window (Maximize or resize to a certain size).
    3.) Method 1 + 2.

    Code in a standard Module or behind a Form...

    VB Code:
    1. '1. Maximize/Restore Access Child windows
    2. Option Explicit
    3. Option Compare Database
    4.  
    5. Private Sub MaximizeOrRestoreChild()
    6.     Application.DoCmd.Maximize
    7.     'Or
    8.     Application.DoCmd.Restore
    9. End Sub
    VB Code:
    1. '2. Resize/Maximize Access main window to a certin size
    2. Option Explicit
    3. Option Compare Database
    4.  
    5. Private Declare Function SetWindowPos Lib "user32.dll" (ByVal hwnd As Long, ByVal hWndInsertAfter As Long, _
    6. ByVal x As Long, ByVal y As Long, ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long) As Long
    7.  
    8. Private Sub ResizeApp()
    9.     'Resize main app window to 700 high x 1000 wide
    10.     'x and y are the orgin of the top/let corner
    11.     'cx and cy are the size of the window.
    12.     Application.RunCommand (acCmdAppRestore)
    13.     SetWindowPos Application.hWndAccessApp, 0, 0, 0, 700, 1000, 0
    14. End Sub
    15.  
    16. Private Sub MaximizeApp()
    17.     Application.RunCommand (acCmdAppMaximize)
    18. End Sub
    VB Code:
    1. '3. Maximize Access main window and Maximize any child windows
    2. Option Explicit
    3. Option Compare Database
    4.  
    5. Private Sub MaximizeAll()
    6.     Application.RunCommand (acCmdAppMaximize)
    7.     Application.DoCmd.Maximize
    8. End Sub
    VB Code:
    1. '3. Resize Access main window to a certin size and Maximize any Child windows
    2. Option Explicit
    3. Option Compare Database
    4.  
    5. Private Declare Function SetWindowPos Lib "user32.dll" (ByVal hwnd As Long, ByVal hWndInsertAfter As Long, _
    6. ByVal x As Long, ByVal y As Long, ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long) As Long
    7.  
    8. Private Sub ResizeAppMaxChild()
    9.     'Resize main app window to 700 high x 1000 wide
    10.     'x and y are the orgin of the top/let corner
    11.     'cx and cy are the size of the window.
    12.     Application.RunCommand (acCmdAppRestore)
    13.     SetWindowPos Application.hWndAccessApp, 0, 0, 0, 700, 1000, 0
    14.     Application.DoCmd.Maximize
    15. End Sub
    Last edited by RobDog888; Apr 27th, 2006 at 02:57 PM.
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

Posting Permissions

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



Click Here to Expand Forum to Full Width