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