Custom Report Titles

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

Guest

I'm sure that has been covered before, but I can't find it on this NG. I've got a form from which users select certain criteris (i.e., quarter, employee name, etc.). I then use the OpenReport method to open the report with the user's criteria.

What I'd like to do is change the title of the report a bit so that it is more informative, using some of the criteria entered on the form. Even if it's something as simple as appending which quarter the results are for.

Waaay back when I first learned Access in school, I think I had a project that did that, but I'm drawing a blank here

I'm using Access 2000. Any thoughts?
 
MDW, each report has a caption property. You can set this caption property
in the On Activate or On open event of the report (normally On Activate) or
by calling a custom property that you create with the report.

Open the report's Module and simply add this code:

Public Property Let SetCaption(ByVal strCaption as String)
Me.Caption = strCaption
End Property

Then when you preview the report (this won't work with printing but
normally that's not a problem), do something like this:

Docmd.OpenReport "MyReport"
Reports("MyReport").SetCaption "Some Caption Text Here"

Simple enough
--
Steve Arbaugh
ACG Soft
http://ourworld.compuserve.com/homepages/attac-cg

MDW said:
I'm sure that has been covered before, but I can't find it on this NG.
I've got a form from which users select certain criteris (i.e., quarter,
employee name, etc.). I then use the OpenReport method to open the report
with the user's criteria.
What I'd like to do is change the title of the report a bit so that it is
more informative, using some of the criteria entered on the form. Even if
it's something as simple as appending which quarter the results are for.
Waaay back when I first learned Access in school, I think I had a project
that did that, but I'm drawing a blank here.
 

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