|
Option Compare Database
Option ExplicitPrivate Declare Function LockWindowUpdate Lib "user32" (ByVal hwndLock As Long) As Long
Private Declare Function GetDesktopWindow Lib "user32" () As Long
Private Declare Function SetParent Lib "user32" (ByVal hWndChild As Long, ByVal hWndNewParent As Long) As LongPrivate Declare Function ShellExecute Lib "shell32.dll" _
Alias "ShellExecuteA" _
(ByVal hwnd As Long, _
ByVal lpOperation As String, _
ByVal lpFile As String, _
ByVal lpParameters As String, _
ByVal lpDirectory As String, _
ByVal nShowCmd As Long) As LongPrivate Const SW_SHOWNORMAL = 1Private Sub cmdCloseRPT_Click()
DoCmd.Close acReport, "rpt1"
End SubPrivate Sub cmdLoadRpt_Click()
Dim mWnd As Long
LockWindowUpdate GetDesktopWindow
DoCmd.OpenReport "rpt1", acViewPreview, , , acWindowNormal
mWnd = Reports("rpt1").hwnd
' 设置报表的父窗口为子窗体
SetParent mWnd, Me.subRPT.Form.hwnd
LockWindowUpdate False
DoCmd.SelectObject acReport, "rpt1"
DoCmd.Maximize
End SubPrivate Sub Command0_Click()
Dim strFile As String
strFile = "http://bcd.accxp.com/"
Call ShellExecute(Me.hwnd, "open", strFile, vbNullString, vbNullString, SW_SHOWNORMAL)
End Sub
Private Sub Form_Unload(Cancel As Integer)
DoCmd.Close acReport, "rpt1"
End Sub
|
|