fAccessWindow(“隐藏”,假,假)隐藏实际的访问窗函数给出编译错误编号7960fAccessWindow(“隐藏”,假,假)给出编译错误
我没有空间已经试过“fAccessWindow(”隐藏“,假,假)”但没有区别。我也有一个模块,下面的代码也可以找到here。我正在使用最低级别的宏安全性的Access 2010。另外我的操作系统是x64。
Private Declare Function IsWindowVisible Lib "user32" (ByVal hwnd As Long) As Long
Dim dwReturn As Long
Const SW_HIDE = 0
Const SW_SHOWNORMAL = 1
Const SW_SHOWMINIMIZED = 2
Const SW_SHOWMAXIMIZED = 3
Private Declare Function ShowWindow Lib "user32" (ByVal hwnd As Long, _
ByVal nCmdShow As Long) As Long
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
首先,你不表明你说的是导致编译错误代码(你”重新显示被调用的代码,但不是调用它的代码正在生成错误);其次,你没有显示你得到的实际错误信息。请提供这些详细信息以便人们能够帮助您。 – 2011-03-09 22:40:26
“编译此函数时出现错误”,则宏名称,操作名称“RunCode”,参数“fAccessWindow(”Hide“,False,False)”错误编号“7960” – 2011-03-09 22:43:33