Can you change a Report Caption property?

K

KC Classic

I have a simple Access report captioned "ARK252 Balancing" that is currently
e-mailed manually on a daily basis. Under the current process, we would
export the report in .rtf format and rename manually using the most recent
date in the [SS DATE] field in one of the tables. For example, the report
Caption currently reads "ARK252 Balancing 06202007.rtf".

I have created a macro that uses the SendObject action to generate and
attach the report to the e-mail recipients in the .rtf format automatically
to eliminate
this manual process. Can the Caption of the report (which I have learned
flows through to the report title generated in Access) incorporate the most
recent date from the [SS DATE] field?

My end goal would be to have the report Caption in the e-mail read "ARK252
Balancing 06222007.rtf". Then tomorrow, the report Caption would read
"ARK252
Balancing 06232007.rtf" and so on each successive day. This caption would
show in the report attachment in the e-mail generated by the SendObject
macro. I am assuming that VBA coding may be involved and I am a beginner
with VBA.

Any suggestions?

Thanks in advance.

KC Classic
 
K

Klatuu

You can do this in the Open Event of the report.

Me.LabelSomething = "ARK252 Balancing " & Format(DMax("[SS DATE]",
"OneOfTheTablesName"), "yyyymmdd")
 
K

KC Classic

Dave,

Pardon my ignorance but this code will work for the "Caption" property of
the report. I do not have a label control per sey as you would on the actual
report. I understand the logic of the code you suggested and I believe it
will work in a label control. Can you do something like this only in the
Caption of the report?

Thanks for your response.

KC Classic

Klatuu said:
You can do this in the Open Event of the report.

Me.LabelSomething = "ARK252 Balancing " & Format(DMax("[SS DATE]",
"OneOfTheTablesName"), "yyyymmdd")

--
Dave Hargis, Microsoft Access MVP


KC Classic said:
I have a simple Access report captioned "ARK252 Balancing" that is currently
e-mailed manually on a daily basis. Under the current process, we would
export the report in .rtf format and rename manually using the most recent
date in the [SS DATE] field in one of the tables. For example, the report
Caption currently reads "ARK252 Balancing 06202007.rtf".

I have created a macro that uses the SendObject action to generate and
attach the report to the e-mail recipients in the .rtf format automatically
to eliminate
this manual process. Can the Caption of the report (which I have learned
flows through to the report title generated in Access) incorporate the most
recent date from the [SS DATE] field?

My end goal would be to have the report Caption in the e-mail read "ARK252
Balancing 06222007.rtf". Then tomorrow, the report Caption would read
"ARK252
Balancing 06232007.rtf" and so on each successive day. This caption would
show in the report attachment in the e-mail generated by the SendObject
macro. I am assuming that VBA coding may be involved and I am a beginner
with VBA.

Any suggestions?

Thanks in advance.

KC Classic
 
K

Klatuu

Sorry, had I been paying attention, I would have understood the question.
All you need to change is this:

Me.Caption = "ARK252 Balancing " & Format(DMax("[SS DATE]",
"OneOfTheTablesName"), "yyyymmdd")

Sorry, I was thinking of a label on the page header.
--
Dave Hargis, Microsoft Access MVP


KC Classic said:
Dave,

Pardon my ignorance but this code will work for the "Caption" property of
the report. I do not have a label control per sey as you would on the actual
report. I understand the logic of the code you suggested and I believe it
will work in a label control. Can you do something like this only in the
Caption of the report?

Thanks for your response.

KC Classic

Klatuu said:
You can do this in the Open Event of the report.

Me.LabelSomething = "ARK252 Balancing " & Format(DMax("[SS DATE]",
"OneOfTheTablesName"), "yyyymmdd")

--
Dave Hargis, Microsoft Access MVP


KC Classic said:
I have a simple Access report captioned "ARK252 Balancing" that is currently
e-mailed manually on a daily basis. Under the current process, we would
export the report in .rtf format and rename manually using the most recent
date in the [SS DATE] field in one of the tables. For example, the report
Caption currently reads "ARK252 Balancing 06202007.rtf".

I have created a macro that uses the SendObject action to generate and
attach the report to the e-mail recipients in the .rtf format automatically
to eliminate
this manual process. Can the Caption of the report (which I have learned
flows through to the report title generated in Access) incorporate the most
recent date from the [SS DATE] field?

My end goal would be to have the report Caption in the e-mail read "ARK252
Balancing 06222007.rtf". Then tomorrow, the report Caption would read
"ARK252
Balancing 06232007.rtf" and so on each successive day. This caption would
show in the report attachment in the e-mail generated by the SendObject
macro. I am assuming that VBA coding may be involved and I am a beginner
with VBA.

Any suggestions?

Thanks in advance.

KC Classic
 
K

KC Classic

Dave,

I enter the code in the On Open event for the report as follows:

Me.Caption = "ARK252 Balancing " & Format(DMax("[SS DATE]",
"Qry Combined shares with difference"), "yyyymmdd")

When I try to open the report, I receive the following error message:

"The macro (or its macro group) doesn't exist or the macro is new and hasn't
been saved. Note that when you enter the macrogroup.macroname syntax in an
argument you must specify the name the macro's macro group was last saved
under."

The macro overall name of the macro is mcrSend. The Macro Name in design
view is Caption. This has all been saved and does exist. Do I place the code
in the macro? Or rather, do I just not have the code provided in the On Open
report event correct?

Sorry to be so thick on this one!

Thanks again,

KC Classic

Klatuu said:
Sorry, had I been paying attention, I would have understood the question.
All you need to change is this:

Me.Caption = "ARK252 Balancing " & Format(DMax("[SS DATE]",
"OneOfTheTablesName"), "yyyymmdd")

Sorry, I was thinking of a label on the page header.
--
Dave Hargis, Microsoft Access MVP


KC Classic said:
Dave,

Pardon my ignorance but this code will work for the "Caption" property of
the report. I do not have a label control per sey as you would on the actual
report. I understand the logic of the code you suggested and I believe it
will work in a label control. Can you do something like this only in the
Caption of the report?

Thanks for your response.

KC Classic

Klatuu said:
You can do this in the Open Event of the report.

Me.LabelSomething = "ARK252 Balancing " & Format(DMax("[SS DATE]",
"OneOfTheTablesName"), "yyyymmdd")

--
Dave Hargis, Microsoft Access MVP


:

I have a simple Access report captioned "ARK252 Balancing" that is currently
e-mailed manually on a daily basis. Under the current process, we would
export the report in .rtf format and rename manually using the most recent
date in the [SS DATE] field in one of the tables. For example, the report
Caption currently reads "ARK252 Balancing 06202007.rtf".

I have created a macro that uses the SendObject action to generate and
attach the report to the e-mail recipients in the .rtf format automatically
to eliminate
this manual process. Can the Caption of the report (which I have learned
flows through to the report title generated in Access) incorporate the most
recent date from the [SS DATE] field?

My end goal would be to have the report Caption in the e-mail read "ARK252
Balancing 06222007.rtf". Then tomorrow, the report Caption would read
"ARK252
Balancing 06232007.rtf" and so on each successive day. This caption would
show in the report attachment in the e-mail generated by the SendObject
macro. I am assuming that VBA coding may be involved and I am a beginner
with VBA.

Any suggestions?

Thanks in advance.

KC Classic
 
K

Klatuu

This has nothing to do with Macros. It takes care of itself.
Where you have "Qry Combined shares with difference" should be the name of
the query or table that has the field [SS DATE] in it.

If "Qry Combined shares with difference" is reall a query name, then there
is another problem. I tested this before I sent the code.
BTW, spaces in names are not good. The can cause problems.
--
Dave Hargis, Microsoft Access MVP


KC Classic said:
Dave,

I enter the code in the On Open event for the report as follows:

Me.Caption = "ARK252 Balancing " & Format(DMax("[SS DATE]",
"Qry Combined shares with difference"), "yyyymmdd")

When I try to open the report, I receive the following error message:

"The macro (or its macro group) doesn't exist or the macro is new and hasn't
been saved. Note that when you enter the macrogroup.macroname syntax in an
argument you must specify the name the macro's macro group was last saved
under."

The macro overall name of the macro is mcrSend. The Macro Name in design
view is Caption. This has all been saved and does exist. Do I place the code
in the macro? Or rather, do I just not have the code provided in the On Open
report event correct?

Sorry to be so thick on this one!

Thanks again,

KC Classic

Klatuu said:
Sorry, had I been paying attention, I would have understood the question.
All you need to change is this:

Me.Caption = "ARK252 Balancing " & Format(DMax("[SS DATE]",
"OneOfTheTablesName"), "yyyymmdd")

Sorry, I was thinking of a label on the page header.
--
Dave Hargis, Microsoft Access MVP


KC Classic said:
Dave,

Pardon my ignorance but this code will work for the "Caption" property of
the report. I do not have a label control per sey as you would on the actual
report. I understand the logic of the code you suggested and I believe it
will work in a label control. Can you do something like this only in the
Caption of the report?

Thanks for your response.

KC Classic

:

You can do this in the Open Event of the report.

Me.LabelSomething = "ARK252 Balancing " & Format(DMax("[SS DATE]",
"OneOfTheTablesName"), "yyyymmdd")

--
Dave Hargis, Microsoft Access MVP


:

I have a simple Access report captioned "ARK252 Balancing" that is currently
e-mailed manually on a daily basis. Under the current process, we would
export the report in .rtf format and rename manually using the most recent
date in the [SS DATE] field in one of the tables. For example, the report
Caption currently reads "ARK252 Balancing 06202007.rtf".

I have created a macro that uses the SendObject action to generate and
attach the report to the e-mail recipients in the .rtf format automatically
to eliminate
this manual process. Can the Caption of the report (which I have learned
flows through to the report title generated in Access) incorporate the most
recent date from the [SS DATE] field?

My end goal would be to have the report Caption in the e-mail read "ARK252
Balancing 06222007.rtf". Then tomorrow, the report Caption would read
"ARK252
Balancing 06232007.rtf" and so on each successive day. This caption would
show in the report attachment in the e-mail generated by the SendObject
macro. I am assuming that VBA coding may be involved and I am a beginner
with VBA.

Any suggestions?

Thanks in advance.

KC Classic
 

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