Hi, I have a program that prints several documents in pdf using a print button. Each report that gets printed, opens in and the close it. It take some time to do all the printing. Is there any way I can upgrade the code to make this faster and avoid opening the forms?
This is an example from one part of the documents printed. I did try to change acPreview to acNormal but it started printing all the records from the same report
MyFileName = Me.AssemblyPartCode & "-FittingsRecordSheet" & ".pdf"
DoCmd.OpenReport "FittingsRecordSheet", acPreview, , strWhere
DoCmd.OutputTo acOutputReport, "FittingsRecordSheet", acFormatPDF, MyPath & MyFileName, False
DoCmd.Close acReport, "FittingsRecordSheet"
MyFileName = Me.AssemblyPartCode & "-PickingList" & ".pdf"
DoCmd.OpenReport "PickingList", acPreview, , strWhere
DoCmd.OutputTo acOutputReport, "PickingList", acFormatPDF, MyPath & MyFileName, False
DoCmd.Close acReport, "PickingList"
MyFileName = Me.AssemblyPartCode & "-AssemblyTicket" & ".pdf"
DoCmd.OpenReport "AssemblyTicket", acPreview, , strWhere
DoCmd.OutputTo acOutputReport, "AssemblyTicket", acFormatPDF, MyPath & MyFileName, False
DoCmd.Close acReport, "AssemblyTicket"
Thanks in advance
This is an example from one part of the documents printed. I did try to change acPreview to acNormal but it started printing all the records from the same report
MyFileName = Me.AssemblyPartCode & "-FittingsRecordSheet" & ".pdf"
DoCmd.OpenReport "FittingsRecordSheet", acPreview, , strWhere
DoCmd.OutputTo acOutputReport, "FittingsRecordSheet", acFormatPDF, MyPath & MyFileName, False
DoCmd.Close acReport, "FittingsRecordSheet"
MyFileName = Me.AssemblyPartCode & "-PickingList" & ".pdf"
DoCmd.OpenReport "PickingList", acPreview, , strWhere
DoCmd.OutputTo acOutputReport, "PickingList", acFormatPDF, MyPath & MyFileName, False
DoCmd.Close acReport, "PickingList"
MyFileName = Me.AssemblyPartCode & "-AssemblyTicket" & ".pdf"
DoCmd.OpenReport "AssemblyTicket", acPreview, , strWhere
DoCmd.OutputTo acOutputReport, "AssemblyTicket", acFormatPDF, MyPath & MyFileName, False
DoCmd.Close acReport, "AssemblyTicket"
Thanks in advance