Ok... listed below are my fields, table, query, and report, and form. I'm trying to create a form that is based off of a query. This form has the ability to open a report for an overal view of the fields associated with the ID. Within the Report there is a button that when clicked will Output the report into a PDF and save it to a specific folder on my computer desktop. Currently the report, query, and form work correctly. The only thing I cannot get to work is the saving of a unique save name So when I click the "btnPrintReports" button on the report there should be a new PDF file in my folder with the unique name addressed in the report.
Table Name: Users
Fields in Tbl: ID, UserID, FullName, Email, Org, SupName, SupEmail ** Which should be the specific save name**
Form Name: Users
Report Name: Users
Query Name: Users ** Criteria in ID Field: [Forms]![Users]![ID] ***
Code behind button on RptUsers is as follows....
---------------------------------------------------------------------------------
Option Compare Database
Private Sub btnPrintReports_Click()
Dim myPath As String
Dim strReportName As String
DoCmd.OpenReport "Users", acViewPreview, acWindowNormal
myPath = "C:\Users\TestFolder"
strReportName = Me.tb_SupEmail & ".pdf"
DoCmd.OutputTo acOutputReport, "", acFormatPDF, myPath + strReportName, True
DoCmd.Close acReport, "RptUsers"
End Sub
---------------------------------------------------------------------------------
Any suggestions would be greatly appreciated!
Regards,
95DSM