hiding access environment

adaniele

Registered User.
Local time
Tomorrow, 02:46
Joined
Jul 18, 2005
Messages
176
Hi guys, i read about this before but it did not work.

i am trying to hide the access environment but i couldnt.
i read in this forum that if i have a bmp with then same name than the db, the picture would replace the access environment. I have done this but the only thing that i achieved was to see the picter before access env. comes and then it desapears and the access env. shows up.

any suggestion?
thx max
 
That's exactly how it's supposed to work. The bmp just replaces the Access splash screen when starting up. To hide the MDI (the Access environment) requires a bit more work. See the code here on Access Web for how to do it: http://www.mvps.org/access/api/api0019.htm

Larry
 
laurentech;
i created a module with the following code:
Code:
Private Declare Function apiShowWindow Lib "user32" _
    Alias "ShowWindow" (ByVal hwnd As Long, _
          ByVal nCmdShow As Long) As Long

Function fSetAccessWindow(nCmdShow As Long)
'Usage Examples
'Maximize window:
'       ?fSetAccessWindow(SW_SHOWMAXIMIZED)
'Minimize window:
'       ?fSetAccessWindow(SW_SHOWMINIMIZED)
'Hide window:
'       ?fSetAccessWindow(SW_HIDE)
'Normal window:
'       ?fSetAccessWindow(SW_SHOWNORMAL)
'
Dim loX  As Long
Dim loForm As Form
    On Error Resume Next
    Set loForm = Screen.ActiveForm
    If Err <> 0 Then 'no Activeform
      If nCmdShow = SW_HIDE Then
        MsgBox "Cannot hide Access unless " _
                    & "a form is on screen"
      Else
        loX = apiShowWindow(hWndAccessApp, nCmdShow)
        Err.Clear
      End If
    Else
        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
    End If
    fSetAccessWindow = (loX <> 0)
End Function

then i call this function from the login form (which is in the start-up) as follows:
fSetAccessWindow(0)

but a msg appears saying "can not hide access unless a form is on screen"

do u know why?
thx max.
 
laurentech;
now i can hide access environment. thx very much............however, when i finish to use it i can not close access , unless i kill the process manually.

Can i kill the access process from the application?
thx again, max.
 
Use Application.Quit to exit access. You could put this in the OnClick of a command button on your form.

Larry
 

Users who are viewing this thread

Back
Top Bottom