Results 1 to 2 of 2
  1. #1
    kelkan is offline Novice
    Windows XP Access 2010 32bit
    Join Date
    Dec 2012
    Posts
    26

    Hide Database from View to see modal forms only

    I want to hide access so it is not seen in the background. I found some code online that works; however, when I attempt to navigate to a different form from the initial one, everything is hidden. Any help to make this work so I can see all of my forms and not just the initial one would be great....

    Option Compare Database
    Option Explicit
    Global Const SW_HIDE = 0
    Global Const SW_SHOWNORMAL = 1
    Global Const SW_SHOWMINIMIZED = 2
    Global Const SW_SHOWMAXIMIZED = 3
    Private Declare Function apiShowWindow Lib "user32" _
    Alias "ShowWindow" (ByVal hwnd As Long, _
    ByVal nCmdShow As Long) As Long
    Function fSetAccessWindow(nCmdShow As Long)
    Dim loX As Long
    Dim loForm As Form
    On Error Resume Next
    Set loForm = Screen.ActiveForm
    If Err <> 0 Then
    loX = apiShowWindow(hWndAccessApp, nCmdShow)
    Err.Clear
    End If
    If nCmdShow = SW_SHOWMINIMIZED And loForm.Modal = True Then
    MsgBox "Cannot minimize Access with " _
    & (loForm.Caption + " ") _
    & "form on screen"
    ElseIf nCmdShow = SW_HIDE And loForm.PopUp <> True Then
    MsgBox "Cannot hide Access with " _
    & (loForm.Caption + " ") _
    & "form on screen"
    Else
    loX = apiShowWindow(hWndAccessApp, nCmdShow)
    End If
    fSetAccessWindow = (loX <> 0)
    End Function



    On load function of initial form is this:

    Private Sub Form_Load()
    Call fSetAccessWindow(0)
    End Sub

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,930
    What do you mean by 'navigation'? Code opens a form, isn't it visible?
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 1
    Last Post: 03-20-2013, 07:04 AM
  2. Hide Records In Forms
    By data808 in forum Forms
    Replies: 4
    Last Post: 08-26-2012, 12:23 PM
  3. Replies: 1
    Last Post: 03-08-2012, 08:34 AM
  4. Hide records from Form View
    By Douglasrac in forum Forms
    Replies: 9
    Last Post: 05-13-2011, 11:55 AM
  5. Hide all but forms
    By Bird_FAT in forum Programming
    Replies: 1
    Last Post: 05-25-2010, 02:40 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums