User-Defined Report Heading

  • Thread starter Thread starter Chai
  • Start date Start date
C

Chai

I want to able to open a report and type in the report heading on the fly;
how do I do this? Thank you.
 
I want to able to open a report and type in the report heading on the fly;
how do I do this? Thank you.

Add an unbound text control to the report header.
Set it's control source to:

=[Please enter your header text here]

When the report opens it will prompt for the text.
 
You could have a prompt in the query that feeds your report.
SELECT [YourTable].*, [Enter report heading]
FROM [YourTable];
 
If you actually mean the text in the header of the page or report, then use
fred's recommendation.

If you mean the caption at the top of the report, you can add some code to
the reports Open event.

Private Sub Report_Open(Cancel as integer)

me.Caption = inputbox("Enter report caption")

End Sub

Or, you could do this in the Immediate window of the VB Editor:

Reports(0).Caption = "Report Caption"

I have a custom Report menu that I use will all of my reports, and if I
select one of the Export options, the function that handles that askes what
the Report Caption should be, because that is what the name of the file will
be.
 
Thank you for the quick response and answer; I followed Fred's recommendation
and it worked. I used your recommendation, but, it did not work. Under the
report OPEN EVENT, I copied your code. When I opened the report it asked for
a user input, but, in the print preview I did not see what I type in.

Thank you again,
Chai
 
Back
Top