|
Private Sub 打印发货单_Click()
If IsNull(Me.List20) Or Me.List20 = "" Then '例行检查
MsgBox "请先选择订单!", vbOKOnly + vbInformation, SoftName
Exit Sub
End If
' 这段代码由“命令按钮向导”创建。
On Error GoTo Err_PrintInvoice_Click
Dim strDocName As String
strDocName = "制造单"
' 打印“发货单”报表,打印当前订单的发货单。
Dim Q$
Q$ = """"
DoCmd.OpenReport strDocName, acPreview, , Q$ + "订单ID" + Q$ + "=" + CStr(Me.List20.Column(1))
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
抄示例的!自己改了一下! |
|