Change Caption in Report

N

neesie214

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.
 
M

Marshall Barton

neesie214 said:
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
 
N

neesie214

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

Marshall Barton

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.
 
N

neesie214

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 said:
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]

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

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

Top