I'm trying to add a button to a form that will print a report (called PRINTINVOICE), then duplicate the record into a new one, ideally the print dialogs should be hidden.
The code i'm using to print the report is
Code:
DoCmd.OpenReport "PRINTINVOICE", acViewPreview,,,,acHiden
Docmd.SelectObject acReport, "PRINTINVOICE"
DoCmd.RunCommand acCmdPrint
The code to duplicate is
Code:
DoCmd.RunCommand acCmdSelectRecord
DoCmd.RunCommand acCmdCopy DoCmd.RunCommand acCmdRecordsGoToNew
DoCmd.RunCommand acCmdSelectRecord
DoCmd.RunCommand acCmdPaste
Me.fieldtoblank = ""
Is there a way to merge these 2 functions together, so i can run them from one button?