|
本帖最后由 JosephTan 于 2012-2-15 14:18 编辑
有宏可以用,为什么不用?
这个是我用宏转换成vba代码:
'------------------------------------------------------------
' PrintInvoice
'
'------------------------------------------------------------
Function PrintInvoice()
On Error GoTo PrintInvoice_Err
With CodeContextObject
DoCmd.SetParameter "单号", .单号
DoCmd.OpenReport "Invoice", acViewReport, "", "", acNormal
DoCmd.PrintOut acPrintAll, , , acHigh, 2, True
DoCmd.Close acReport, "Invoice"
End With
PrintInvoice_Exit:
Exit Function
PrintInvoice_Err:
MsgBox Error$
Resume PrintInvoice_Exit
End Function
|
|