View Full Version : How to Print the Report Name in the Report?


Gordon
05-07-2008, 06:22 PM
Hello,

I would like to create a text box which automatically prints the name of the report in the report. This is the report name as shown in Access, in the reports area (example rpt_monthly_sales).

I don't just want to type the name in, since I may change the report name at a later date, and also if I do this once then I can copy the text box for use in other reports and have it automatically be correct.

Any help would be most appreciated.

Gordon

RuralGuy
05-07-2008, 08:04 PM
I would think that Me.Name would give you that value.

Gordon
05-08-2008, 01:04 PM
I would think that Me.Name would give you that value.

Thanks for the suggestion. I put "=me.name" into a text box, which Access changed to "=[Me].[Name]"

When I ran the report it didn't work. Am I missing something?

Thanks for any help.....

Gordon

RuralGuy
05-08-2008, 02:42 PM
What version of Access? I just tried =Name in a textbox on a report and it worked in ac2k2.

boblarson
05-08-2008, 02:59 PM
Thanks for the suggestion. I put "=me.name" into a text box, which Access changed to "=[Me].[Name]"

When I ran the report it didn't work. Am I missing something?

Thanks for any help.....

Gordon
Just an FYI for you - You can't use ME within controlsources. It is good only in VBA.

You can do as RG has mentioned = set the controlsource to

=[Name]

and that should do it for you (as long as you didn't make the mistake of naming one of your fields that reserved word).

Gordon
05-08-2008, 03:48 PM
Just an FYI for you - You can't use ME within controlsources. It is good only in VBA.

You can do as RG has mentioned = set the controlsource to

=[Name]

and that should do it for you (as long as you didn't make the mistake of naming one of your fields that reserved word).

Boblarson,

Thanks so much!! That worked fine.... exactly what I needed. :o


Gordon