Hi
I have added 2 command buttons to a form where you enter the details of a purchase order, 1 to print the purchase order report and 1 to send it to file. These both work individually, but I want to know if I can combine the print & save events so the user only has to press one button.
Also, on the send to file button I would like to know what command is required to predefine the directory that the file is saved to. I have specified the filename and the file type, which both work as I'd expect. It would also be useful if the file was automatically saved so the user isn't required to click OK to confirm the save.
This is the code currently in use:
Private Sub PrintOrder_Click()
On Error GoTo Err_PrintOrder_Click
Dim stDocName As String
stDocName = "Purchase Order"
DoCmd.OpenReport stDocName, acNormal
Exit_PrintOrder_Click:
Exit Sub
Err_PrintOrder_Click:
MsgBox Err.Description
Resume Exit_PrintOrder_Click
End Sub
Private Sub SaveOrder_Click()
On Error GoTo Err_SaveOrder_Click
Dim stDocName As String
stDocName = "M" & [PurchaseOrderID]
DoCmd.OutputTo acReport, stDocName, acFormatRTF
Exit_SaveOrder_Click:
Exit Sub
Err_SaveOrder_Click:
MsgBox Err.Description
Resume Exit_SaveOrder_Click
End Sub
In summary, I'm hoping to create a button that will print the purchase order and automatically save a copy in a predetermined folder with only one click of a button. Any help will be greatly appreciated!
Thanks
Steve