I created a database on my personal laptop that has Access 2010. There are several reports that are generated via a parameter query and with the use of macros, they are then emailed in PDF format when I click a button on the main form I use. However, the version of Access I have at work is 2003 so these buttons no longer work. I created new buttons to preview the report so that I can save as a PDF and email to those who require them. There are a lot more steps doing it this way and I know there has to be a better way.
Below is the VBA code generated by Access.
This is a shipping report and when I click the button, I enter the date in as "1/27" and the report shows the shipping for that day. Now I need to right click and print to a PDF format and the name always default to the name of the report in Access. What I would like it to do is always save in the same folder on my hard drive and rename it to "CS - Shipping Report 2012.01.27.pdf" whereas the date would change to the one entered in the parameter.
Is this something that would be easy to code? Or can anyone suggest other options?
Hopefully I explained this well enough.
Below is the VBA code generated by Access.
Code:
Private Sub ReportCS_Click()
On Error GoTo Err_ReportCS_Click
Dim stDocName As String
stDocName = "rpt_LTL Shipments for CS"
DoCmd.OpenReport stDocName, acPreview
Exit_ReportCS_Click:
Exit Sub
Err_ReportCS_Click:
MsgBox Err.Description
Resume Exit_ReportCS_Click
End Sub
Is this something that would be easy to code? Or can anyone suggest other options?
Hopefully I explained this well enough.