How to change the report title

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,
Is there a way to change the report control collection (i.e. report Title)
before opeing the report.
I have a form where users can select filter for the record source (from
radio button) when user click the open report I want the title of the report
refer to the selected radio button from the form.

TIA
Gabriel
 
Not sure if you want to set the Caption of the report:

Private Sub Report_Open(Cancel As Integer)
Select Case Forms!MyForm!MyOptionGroup.Value
Case 1
Me.Caption = "Filtered by option 1"
Case 2
Me.Caption = "Filtered by option 2"
Case Else
Debug.Print Me.Name & "'s Report_Open event didn't handle
option " & Forms!MyForm!MyOptionGroup.Value
End Select
End Sub

or assign a value to a text box on the report, which would need to be done
in the Format event of the (Report Header?) section.


If you are are using Access 2002 or 2003, there is an even easier approach.
Pass the string you wish to display via the OpenArgs of OpenReport, and just
put a text box on the report with a ControlSource of:
=[Report].[OpenArgs]
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top