|
6#
楼主 |
发表于 2010-8-14 09:18:52
|
只看该作者
本帖最后由 hljthzbc 于 2010-8-14 09:45 编辑
用两个按钮可实现打印,我想谁能帮我改成一个按钮
打印按钮无意碰到确会打印了多表.怎样解决在没有筛选的情况下不能打印.
Private Sub Command14_Click()
'DoCmd.OpenReport "生产", , , "组合38=" & Me.组合38.Value
' 这段代码由“命令按钮向导”创建。
On Error GoTo Err_PrintInvoice_Click
Dim strDocName As String
strDocName = "生产"
DoCmd.OpenReport strDocName, acViewNormal, "组合39"
Exit_PrintInvoice_Click:
Exit Sub
Err_PrintInvoice_Click:
' 如果用户取消操作,不显示错误消息。
Const conErrDoCmdCancelled = 2501
If (Err = conErrDoCmdCancelled) Then
Resume Exit_PrintInvoice_Click
Else
MsgBox Err.Description
Resume Exit_PrintInvoice_Click
End If
End Sub
Private Sub Command15_Click()
'DoCmd.OpenReport "生产", , , "组合38=" & Me.组合38.Value
' 这段代码由“命令按钮向导”创建。
On Error GoTo Err_PrintInvoice_Click
Dim strDocName As String
strDocName = "销售"
DoCmd.OpenReport strDocName, acViewNormal, "组合38"
Exit_PrintInvoice_Click:
Exit Sub
Err_PrintInvoice_Click:
' 如果用户取消操作,不显示错误消息。
Const conErrDoCmdCancelled = 2501
If (Err = conErrDoCmdCancelled) Then
Resume Exit_PrintInvoice_Click
Else
MsgBox Err.Description
Resume Exit_PrintInvoice_Click
End If
End Sub
|
|