Access - Ocultar ventana de access

 
Vista:
sin imagen de perfil

Ocultar ventana de access

Publicado por Érika (1 intervención) el 01/09/2014 17:20:26
Hola:

Me gustaría saber cómo ocultar la ventana de access al abrir la base de datos con access 2013 64 bits. Me sale este error:

error

Os cuento lo que he hecho. En el formulario de inicio, he puesto:

1
2
3
4
5
Private Sub Form_Open(Cancel As Integer)
 
    fAccessWindow "Hide", False, False
 
End Sub

Luego he creado un módulo, llamado Ocultar ventana access con el siguiente código:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
Option Compare Database
 
Private Declare PtrSafe Function WNetGetUser& Lib "Mpr" Alias "WNetGetUserA" _
   (lpName As Any, ByVal lpUserName$, lpnLength&)
 
    Dim dwReturn As Long
 
    Const SW_HIDE = 0
    Const SW_SHOWNORMAL = 1
    Const SW_SHOWMINIMIZED = 2
    Const SW_SHOWMAXIMIZED = 3
 
Private Declare PtrSafe Function ShowWindow Lib "Mpr" (ByVal hwnd As Long, _
ByVal nCmdShow As Long) As Long
Private Sub demofA()
 
    MsgBox fAccessWindow("Show", False, True)
 
End Sub
 
Public Function fAccessWindow(Optional Procedure As String, Optional SwitchStatus As Boolean, Optional StatusCheck As Boolean) As Boolean
 
If Procedure = "Hide" Then
    dwReturn = ShowWindow(Application.hWndAccessApp, SW_HIDE)
End If
If Procedure = "Show" Then
    dwReturn = ShowWindow(Application.hWndAccessApp, SW_SHOWMAXIMIZED)
End If
If Procedure = "Minimize" Then
    dwReturn = ShowWindow(Application.hWndAccessApp, SW_SHOWMINIMIZED)
End If
 
If SwitchStatus = True Then
    If IsWindowVisible(hWndAccessApp) = 1 Then
        dwReturn = ShowWindow(Application.hWndAccessApp, SW_HIDE)
    Else
        dwReturn = ShowWindow(Application.hWndAccessApp, SW_SHOWMAXIMIZED)
    End If
End If
 
If StatusCheck = True Then
    If IsWindowVisible(hWndAccessApp) = 0 Then
        fAccessWindow = False
    End If
    If IsWindowVisible(hWndAccessApp) = 1 Then
        fAccessWindow = True
    End If
End If
End Function

Espero que podáis ayudarme. Os estaré eternamente agradecida.
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder