|
两种方法,分别利用Form_Load和Form_Timer在另一窗体运行程序、执行命令:
窗体1代码:
Private Sub Command1_Click()
DoCmd.OpenForm "透视表", acNormal, "", "", , acNormal
Forms("透视表").TimerInterval = 10
End Sub
Private Sub 命令0_Click()
DoCmd.OpenForm "透视表", acNormal, "", "", , acNormal, "Edit"
End Sub
窗体2代码:
Private Sub btnEdit_Click()
On Error GoTo btnEdit_Err
Me!PivotTable.Verb = acOLEVerbOpen
Me!PivotTable.Action = acOLEActivate
btnEdit_Exit:
Exit Sub
btnEdit_Err:
MsgBox Err.Description
Resume btnEdit_Exit
End Sub
Private Sub Form_Load()
If Me.OpenArgs = "Edit" Then btnEdit_Click
End Sub
Private Sub Form_Timer()
btnEdit_Click
Me.TimerInterval = 0
End Sub
|
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有帐号?注册
x
|