+ Post New Thread
Results 1 to 7 of 7
Office Software Thread, Hiding Access 2007 interface in VBA in Technical; Hi I'm wondering how to hide the entire database window in Access 2007, I am writing an app for monitoring ...
  1. #1
    tinmanjo's Avatar
    Join Date
    Mar 2010
    Posts
    16
    Thank Post
    0
    Thanked 0 Times in 0 Posts
    Rep Power
    0

    Hiding Access 2007 interface in VBA

    Hi I'm wondering how to hide the entire database window in Access 2007, I am writing an app for monitoring jobs and task I do at work but I want the main form to be shown only. I've discovered a ludicrous way of hiding the ribbon bar though (Microsoft say you have to create a table to create a custom ribbon in order to hide the main ribbon bar) http://msdn.microsoft.com/en-us/library/bb258192.aspx, but this still shows the main window still, I wish to hide the lot if possible, Ive tried to insert the API routine for hiding windows which worked ok in 2003 but not in this version.

    Does anyone know a workaround?

    Dave.
    Last edited by tinmanjo; 18th March 2010 at 02:21 PM.

  2. #2

    LosOjos's Avatar
    Join Date
    Dec 2009
    Location
    West Midlands
    Posts
    5,565
    Thank Post
    1,470
    Thanked 1,223 Times in 832 Posts
    Rep Power
    752
    Add this in to a module:

    Code:
    Private Declare Function ShowWindowAsync Lib "user32" ( _
        ByVal hwnd As Long, _
        ByVal nCmdShow As Long) _
        As Boolean
    
    Private Const SW_HIDE = 0
    Private Const SW_SHOW = 5
    then when you want to hide Access, use this line:
    Code:
    ShowWindowAsync Application.hWndAccessApp(), SW_HIDE
    to show Access again it's:
    Code:
    ShowWindowAsync Application.hWndAccessApp(), SW_SHOW
    I think you have to have your form set to modal for this to work but I could be wrong (it's not unusual)

  3. #3
    tinmanjo's Avatar
    Join Date
    Mar 2010
    Posts
    16
    Thank Post
    0
    Thanked 0 Times in 0 Posts
    Rep Power
    0
    Cheers for that, works brilliantly!

  4. #4

    Join Date
    Mar 2010
    Location
    Michigan
    Posts
    2
    Thank Post
    0
    Thanked 0 Times in 0 Posts
    Rep Power
    0
    Sorry I am a bit of a novice and I am having a little trouble following your instructions. When you say use this line of code "ShowWindowAsync Application.hWndAccessApp(), SW_HIDE" how exactly is that done?

  5. #5

    LosOjos's Avatar
    Join Date
    Dec 2009
    Location
    West Midlands
    Posts
    5,565
    Thank Post
    1,470
    Thanked 1,223 Times in 832 Posts
    Rep Power
    752
    Always happy to help

    The code is VBA, you need to open the Visual Basic Editor and insert the code in there to run it. If you're not familiar with VBA, I'd recommend googling a few lessons on it, it really opens up Office to a a hell of a lot more functionality

  6. #6

    Join Date
    Mar 2010
    Location
    Michigan
    Posts
    2
    Thank Post
    0
    Thanked 0 Times in 0 Posts
    Rep Power
    0

    Smile

    Got it, thanks for the help!!

  7. #7

    Join Date
    May 2013
    Location
    Israel
    Posts
    1
    Thank Post
    0
    Thanked 0 Times in 0 Posts
    Rep Power
    0
    Hi there,

    I'd like to read more about these commands.
    I found hardly any reference to them, and none on MSDN.

    Thanks.

SHARE:
+ Post New Thread

Similar Threads

  1. Deploy Access 2007 Runtime.
    By ICTNUT in forum How do you do....it?
    Replies: 1
    Last Post: 22nd January 2010, 11:03 AM
  2. Exchange 2007 Direct File Access
    By DrPerceptron in forum Windows Server 2008
    Replies: 3
    Last Post: 2nd June 2009, 09:35 PM
  3. External Access for Moss 2007
    By banjoman in forum Windows
    Replies: 5
    Last Post: 26th February 2009, 11:27 PM
  4. Access 2007 and user.man
    By spik376 in forum Windows
    Replies: 0
    Last Post: 3rd April 2008, 04:04 PM
  5. Teaching with access 2007
    By Logan in forum Office Software
    Replies: 2
    Last Post: 16th January 2008, 08:02 PM

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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