I have a generic report that prints from a form. On the form I have multiple command buttons that print the report based on a criteria. I want to add a report name in the header based on which button is clicked. Can I add it somewhere in the command line. In the example below if vevent23=-1 then I would like the header in the report rptVolunteersByCatagory to be "Great American Fundraisers"
Private Sub Command20_Click()
Dim stdocname As String
stdocname = "rptVolunteersByCatagory"
DoCmd.OpenReport stdocname, acViewPreview, , "vevent23=-1"
End Sub
Private Sub Command21_Click()
Dim stdocname As String
stdocname = "rptVolunteersByCatagory"
DoCmd.OpenReport stdocname, acViewPreview, , "vevent3=-1"
End Sub
Private Sub Command20_Click()
Dim stdocname As String
stdocname = "rptVolunteersByCatagory"
DoCmd.OpenReport stdocname, acViewPreview, , "vevent23=-1"
End Sub
Private Sub Command21_Click()
Dim stdocname As String
stdocname = "rptVolunteersByCatagory"
DoCmd.OpenReport stdocname, acViewPreview, , "vevent3=-1"
End Sub