Sorry for the confusing title. I've got a button on a report for the user to press and it prints out the report. See below:
Is it possible to not have to cite the actual report name in the code? But rather have it refer to the currently open report maybe?Code:Private Sub btnPrintReport_Click()On Error GoTo btnPrintReport_Click_Err DoCmd.OpenReport "rptComplaintNumber", acViewNormal, "", acNormal btnPrintReport_Click_Exit: Exit Sub btnPrintReport_Click_Err: MsgBox Error$ Resume btnPrintReport_Click_Exit End Sub
I ask so that if I or others reuse this code for a different report, they don't need to remember to go into the VBA and change the report name.
Thanks!