Results 1 to 5 of 5
  1. #1
    Join Date
    Mar 2004
    Location
    Dallas, TX
    Posts
    15

    Question Unanswered: MS Access Window (2003)

    I have developed a data entry / tracking program for the company that I work for. The only problem is that I want a way to make the Access Program to run with out seeing the MS Access Program Window, is this possible and how. I will need it detailed as I am not an expert at VBA, just now getting into it.

    Thanks,
    James

  2. #2
    Join Date
    Dec 2002
    Location
    Préverenges, Switzerland
    Posts
    3,740
    see hide A container window

    it's a long way from perfect!

    izy
    currently using SS 2008R2

  3. #3
    Join Date
    Nov 2003
    Posts
    1,487
    You could use the ShowWindow API function that is housed in the User32.Dll, but...it to is a long way from perfect:

    Place the following into a database code module:

    Code:
    'This Function is used to either Maximize, Minimize, Show
    'as Normal, or to Hide Access altogether.
    
    'This API function can  be used to completely hide
    'Access window and just show your form on the desktop.
    'Make the form popup and from it's Open Event, call the
    'HideAccess function with SW_HIDE as the argument.
    'Warning: If you're hiding the main Access window, make
    'sure your error handlers are good. Because with the
    'window hidden, if an error is raised, pressing "End"
    'on the Error window will NOT make Access window visible
    'and you will be left with just the form open. A
    'recommended method is to make a call to fSetAccessWindow
    'with SW_SHOWNORMAL from your error handlers.
    
    
    '************ Code Start **********
    
    Global Const SW_HIDE = 0
    Global Const SW_SHOWNORMAL = 1
    Global Const SW_SHOWMINIMIZED = 2
    Global Const SW_SHOWMAXIMIZED = 3
    
    Public Declare Function ShowWindow Lib "user32.dll" (ByVal hwnd As Long, ByVal nCmdShow As Long) As Long
    
    
    Public Sub HideAccess()
        Call ShowWindow(Access.hWndAccessApp, SW_HIDE)
    End Sub
    
    Public Sub ShowAccess()
        Call ShowWindow(Access.hWndAccessApp, SW_SHOWNORMAL)
    End Sub
    
    Public Sub ShowMaximized()
        Call ShowWindow(Access.hWndAccessApp, SW_SHOWMAXIMIZED)
    End Sub
    
    Public Sub ShowMinimized()
        Call ShowWindow(Access.hWndAccessApp, SW_SHOWMINIMIZED)
    End Sub
    
    Public Sub ShowNormal()
        Call ShowWindow(Access.hWndAccessApp, SW_SHOWNORMAL)
    End Sub
    Usage:
    Code:
    Private Sub Form_Open(Cancel As Integer)
       Call HideAccess
    End Sub
    OR
    Code:
    Private Sub Form_UnLoad(Cancel As Integer)
       Call ShowAccess
    End Sub
    Last edited by CyberLynx; 03-28-04 at 16:12.

  4. #4
    Join Date
    Mar 2004
    Location
    Dallas, TX
    Posts
    15
    Thank you very much, I will test this tomorrow to see what happens. As I said before I am getting back into this, so I may have some very stupid questions.

    Can someone explain to me what the User32.dll does? Thanks, James

  5. #5
    Join Date
    Nov 2003
    Posts
    1,487
    The USER32.DLL is a Dynamic Link Library file that contains serveral functions which can be used by most programming languages (including VB or VBA) to carry out specific tasks. Even Windows itself uses the routines contained within the USER32.DLL file. This DLL file comes with the Windows instalation. Functions can be used from almost any DLL file if you have to proper information to Call them.


Posting Permissions

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