Change Caption in Report

  • Follow


Hi all,

I am trying to set up macros based on a huge amount of reports to 
automatically print the reports all at once. However, I would like to change 
the caption setting so that I don't have to keep changing the file name each 
time. Is there a way to do this? I am new to Access so I'm not sure how to 
set this up.

For example, one report is called "rptCountrybySalesParent" and I would like 
each file to print out like "FrabySalesParent," "ItabySalesParent, 
"ChnbySalesParent," etc. I have the where conditions figured out, but the 
captions are puzzling me.

Thanks! Any help you can give would be greatly appreciated.
0
Reply Utf 4/22/2010 12:25:01 AM

neesie214 wrote:
>I am trying to set up macros based on a huge amount of reports to 
>automatically print the reports all at once. However, I would like to change 
>the caption setting so that I don't have to keep changing the file name each 
>time. Is there a way to do this? I am new to Access so I'm not sure how to 
>set this up.
>
>For example, one report is called "rptCountrybySalesParent" and I would like 
>each file to print out like "FrabySalesParent," "ItabySalesParent, 
>"ChnbySalesParent," etc. I have the where conditions figured out, but the 
>captions are puzzling me.
>


The report's caption should be changed by the report itself.
This is not very complicated because you can use the
OpenReport method's OpenArgs argument to pass the caption
text to the report when it is opened:

DoCmd.OpenReport "report name", view, _
			WhereCondition:= "filter conditions string", _
			OpenArgs:= "the desired caption"

Then the report's Open event can set the Caption:
	Me.Caption = Me.OpenArgs

-- 
Marsh
MVP [MS Access]
0
Reply Marshall 4/22/2010 8:10:59 PM

Thanks for the help, but I'm still lost. Any change you could walk me through 
all that step by step?

"Marshall Barton" wrote:

> neesie214 wrote:
> >I am trying to set up macros based on a huge amount of reports to 
> >automatically print the reports all at once. However, I would like to change 
> >the caption setting so that I don't have to keep changing the file name each 
> >time. Is there a way to do this? I am new to Access so I'm not sure how to 
> >set this up.
> >
> >For example, one report is called "rptCountrybySalesParent" and I would like 
> >each file to print out like "FrabySalesParent," "ItabySalesParent, 
> >"ChnbySalesParent," etc. I have the where conditions figured out, but the 
> >captions are puzzling me.
> >
> 
> 
> The report's caption should be changed by the report itself.
> This is not very complicated because you can use the
> OpenReport method's OpenArgs argument to pass the caption
> text to the report when it is opened:
> 
> DoCmd.OpenReport "report name", view, _
> 			WhereCondition:= "filter conditions string", _
> 			OpenArgs:= "the desired caption"
> 
> Then the report's Open event can set the Caption:
> 	Me.Caption = Me.OpenArgs
> 
> -- 
> Marsh
> MVP [MS Access]
> .
> 
0
Reply Utf 4/22/2010 9:36:02 PM

I don't use macros so I was leaving it to you to adjust the
form macro that opens the report.  Just use the OpenReport
action's OpenArgs argument to pass whatever caption string
you want to the report.

Then create and use a macro for the report's Open event to
set the caption.

I find it very difficult to describe a macro in a text
message, especially since I have not written a macro in more
than 10 years.  I use VBA code to communicate because it is
pretty unambiguous and, except for specific names and values
you are using, can mostly be Copy/Pasted for you to use.

If you were using VBA code to do whatever it is you are
tring to do, then you could Copy/Paste what you have so I
could try to pick up on some of the details you left out of
your text message.
-- 
Marsh
MVP [MS Access]


neesie214 wrote:
>Thanks for the help, but I'm still lost. Any change you could walk me through 
>all that step by step?
>
>"Marshall Barton" wrote:
>> neesie214 wrote:
>> >I am trying to set up macros based on a huge amount of reports to 
>> >automatically print the reports all at once. However, I would like to change 
>> >the caption setting so that I don't have to keep changing the file name each 
>> >time. Is there a way to do this? I am new to Access so I'm not sure how to 
>> >set this up.
>> >
>> >For example, one report is called "rptCountrybySalesParent" and I would like 
>> >each file to print out like "FrabySalesParent," "ItabySalesParent, 
>> >"ChnbySalesParent," etc. I have the where conditions figured out, but the 
>> >captions are puzzling me.
>> >
>> 
>> The report's caption should be changed by the report itself.
>> This is not very complicated because you can use the
>> OpenReport method's OpenArgs argument to pass the caption
>> text to the report when it is opened:
>> 
>> DoCmd.OpenReport "report name", view, _
>> 			WhereCondition:= "filter conditions string", _
>> 			OpenArgs:= "the desired caption"
>> 
>> Then the report's Open event can set the Caption:
>> 	Me.Caption = Me.OpenArgs
0
Reply Marshall 4/23/2010 3:09:56 PM

Thank you for the help - after some further testing, I figured out how to 
change the caption as part of the macros I am working on. Thanks!

"Marshall Barton" wrote:

> I don't use macros so I was leaving it to you to adjust the
> form macro that opens the report.  Just use the OpenReport
> action's OpenArgs argument to pass whatever caption string
> you want to the report.
> 
> Then create and use a macro for the report's Open event to
> set the caption.
> 
> I find it very difficult to describe a macro in a text
> message, especially since I have not written a macro in more
> than 10 years.  I use VBA code to communicate because it is
> pretty unambiguous and, except for specific names and values
> you are using, can mostly be Copy/Pasted for you to use.
> 
> If you were using VBA code to do whatever it is you are
> tring to do, then you could Copy/Paste what you have so I
> could try to pick up on some of the details you left out of
> your text message.
> -- 
> Marsh
> MVP [MS Access]
> 
> 
> neesie214 wrote:
> >Thanks for the help, but I'm still lost. Any change you could walk me through 
> >all that step by step?
> >
> >"Marshall Barton" wrote:
> >> neesie214 wrote:
> >> >I am trying to set up macros based on a huge amount of reports to 
> >> >automatically print the reports all at once. However, I would like to change 
> >> >the caption setting so that I don't have to keep changing the file name each 
> >> >time. Is there a way to do this? I am new to Access so I'm not sure how to 
> >> >set this up.
> >> >
> >> >For example, one report is called "rptCountrybySalesParent" and I would like 
> >> >each file to print out like "FrabySalesParent," "ItabySalesParent, 
> >> >"ChnbySalesParent," etc. I have the where conditions figured out, but the 
> >> >captions are puzzling me.
> >> >
> >> 
> >> The report's caption should be changed by the report itself.
> >> This is not very complicated because you can use the
> >> OpenReport method's OpenArgs argument to pass the caption
> >> text to the report when it is opened:
> >> 
> >> DoCmd.OpenReport "report name", view, _
> >> 			WhereCondition:= "filter conditions string", _
> >> 			OpenArgs:= "the desired caption"
> >> 
> >> Then the report's Open event can set the Caption:
> >> 	Me.Caption = Me.OpenArgs
> .
> 
0
Reply Utf 4/23/2010 9:04:01 PM

4 Replies
1913 Views

(page loaded in 0.079 seconds)


Reply: