I have a database that I use to schedule musical performances. I go through and select a list of songs and then output a report to send to the band members.
Inside the report, in the Report Header, I have a text box with large text that has the date of the performance. I have to manually go in and change that date whenever I print the report.
I've currently devised a way to print the report to PDF in a directory so I can just one-click my way to the report:
Is there a way I could use VBA to take the date I enter in the InputBox and change the Report Header text accordingly?
Thanks!!
Matt
Inside the report, in the Report Header, I have a text box with large text that has the date of the performance. I have to manually go in and change that date whenever I print the report.
I've currently devised a way to print the report to PDF in a directory so I can just one-click my way to the report:
Code:
Private Sub cmdPrintSongSet_Click()
On Error GoTo Err_cmdPrintSongSet_Click
Dim stReportName As String
Dim stDocName As String
Dim stDate As String
stReportName = "Song Set"
stDate = InputBox("Please enter the date of the performance...", "Date of Performance", "2021-01-01")
stDocName = "C:\OneDrive\Documents\Band Song Sets\" & stDate & " Song Order.pdf"
DoCmd.OutputTo acOutputReport, stReportName, acFormatPDF, stDocName
Exit_cmdPrintSongSet_Click:
Exit Sub
Err_cmdPrintSongSet_Click:
MsgBox Err.Description
Resume Exit_cmdPrintSongSet_Click
End Sub
Is there a way I could use VBA to take the date I enter in the InputBox and change the Report Header text accordingly?
Thanks!!
Matt