Descriptive headings in report header derived from report's name

  • Thread starter hunarch via AccessMonster.com
  • Start date
H

hunarch via AccessMonster.com

I have numerous reports for which I want to create headings in the report
headers, derived from the (object) name for each report.

For efficient editing of report headings, I have created a query derived from
MSysObjects and added fields that, when concatenated, produce the desired
descriptive headings. I thought to have each of the report names link to
their corresponding names in the table so that the concatenated fields unique
to each report would be displayed in the report headers.

How do I get these headings from the table back into the report headers? My
efforts have so far been unsuccessful and I have been unable to find answers
in AccessMonster.

Your assistance would be greatly appreciated.
 
A

Allen Browne

You can display the name of the report in a text box by setting its Control
Source to:
=[Report].[Name]

Better still, you can set the report's Caption property to the text you want
to display, and use:
=[Report].[Caption]
 
H

hunarch via AccessMonster.com

Allen,

Thanks for your prompt response.

I will start experimenting with [Report].[Caption]. Could you provide an
example of the syntax in which it might be used?

I tried inserting a sub-report in the parent report header, with the sub-
report based on my table, using [Report].[Name] as the Link Parent field and
[ObjectName] as the Link Child field (where [ObjectName] is the field name in
my table that I have extracted from a query based on MSysObjects).

In layman's terms, what I want to achieve is something like: if the name of
the parent report is "X" find this name in the sub-report, and display the
other fields in the sub-report's table that are associated with ObjectName
"X" (i.e, that are on the same row in the table). If the parent report name
is "Y", display the fields on the same row as ObjectName "Y" etc..

Apologies for the naive explanation.

Rod Hunter, Melb.

Allen said:
You can display the name of the report in a text box by setting its Control
Source to:
=[Report].[Name]

Better still, you can set the report's Caption property to the text you want
to display, and use:
=[Report].[Caption]
I have numerous reports for which I want to create headings in the report
headers, derived from the (object) name for each report.
[quoted text clipped - 14 lines]
Your assistance would be greatly appreciated.
 
A

Allen Browne

Not sure I've really understood how you are attempting to link the main
report in and the subreport.

If you want to display the name of the parent report on the subreport, it
would be:
=[Report].[Parent].[Name]

If you want to limit the data in the subreport based on what the name of the
main report is, then set up the text box on the main report as shown
previously, and then use the name of that text box in the Link Master Fields
property of the subreport control.

--
Allen Browne - Microsoft MVP. Perth, Western Australia

Reply to group, rather than allenbrowne at mvps dot org.

hunarch via AccessMonster.com said:
Allen,

Thanks for your prompt response.

I will start experimenting with [Report].[Caption]. Could you provide an
example of the syntax in which it might be used?

I tried inserting a sub-report in the parent report header, with the sub-
report based on my table, using [Report].[Name] as the Link Parent field
and
[ObjectName] as the Link Child field (where [ObjectName] is the field name
in
my table that I have extracted from a query based on MSysObjects).

In layman's terms, what I want to achieve is something like: if the name
of
the parent report is "X" find this name in the sub-report, and display the
other fields in the sub-report's table that are associated with ObjectName
"X" (i.e, that are on the same row in the table). If the parent report
name
is "Y", display the fields on the same row as ObjectName "Y" etc..

Apologies for the naive explanation.

Rod Hunter, Melb.

Allen said:
You can display the name of the report in a text box by setting its
Control
Source to:
=[Report].[Name]

Better still, you can set the report's Caption property to the text you
want
to display, and use:
=[Report].[Caption]
I have numerous reports for which I want to create headings in the report
headers, derived from the (object) name for each report.
[quoted text clipped - 14 lines]
Your assistance would be greatly appreciated.
 
H

hunarch via AccessMonster.com

I can get your suggestions to work and they may be the most practical options
for me. Thank you.

As a last (naive) question, is there a way of editing, say, caption names in
one "location" (such as a table) instead of having to open each report to
create/edit the captions? Expressed differently, can report captions be
populated from a central source, such as a table?

Rod

Allen said:
Not sure I've really understood how you are attempting to link the main
report in and the subreport.

If you want to display the name of the parent report on the subreport, it
would be:
=[Report].[Parent].[Name]

If you want to limit the data in the subreport based on what the name of the
main report is, then set up the text box on the main report as shown
previously, and then use the name of that text box in the Link Master Fields
property of the subreport control.
[quoted text clipped - 37 lines]
 
H

hunarch via AccessMonster.com

I have previously been able to get the links to work as you suggested, but
only where the child field corresponds with the first field in the sub-report
list. This list is the query that has been dragged into the sub-report.

What I need is an expression such that, whichever cell in the sub-report
field has the same value as the value in the parent report, the sub-report
cells adjoining the cell with that value are displayed. E.g If (sub-report
name = report name, then sub-report field 1 and sub-report field 2, otherwise
error).

Rod

Allen said:
Not sure I've really understood how you are attempting to link the main
report in and the subreport.

If you want to display the name of the parent report on the subreport, it
would be:
=[Report].[Parent].[Name]

If you want to limit the data in the subreport based on what the name of the
main report is, then set up the text box on the main report as shown
previously, and then use the name of that text box in the Link Master Fields
property of the subreport control.
[quoted text clipped - 37 lines]
 
A

Allen Browne

If you wish to create a table to manage your reports and their captions, you
could do that. Then in the Open event of each report, you would need to
DLookup() to caption for this report in your table (presumably based on
Me.Name), and assign it to Me.Caption.
 
A

Allen Browne

Responses in-line.

--
Allen Browne - Microsoft MVP. Perth, Western Australia

Reply to group, rather than allenbrowne at mvps dot org.

hunarch via AccessMonster.com said:
I have previously been able to get the links to work as you suggested, but
only where the child field corresponds with the first field in the
sub-report
list. This list is the query that has been dragged into the sub-report.

If you open the main report in design view, right-click the edge of the
subreport control and choose Properties, you are looking at the properties
of the subreport control. (Title bar of Properties box shows this.) On the
Data tab, you can set the Link Master Fields to any control on the main
report, including a calcuated control if you wish.
What I need is an expression such that, whichever cell in the sub-report
field has the same value as the value in the parent report, the sub-report
cells adjoining the cell with that value are displayed. E.g If (sub-report
name = report name, then sub-report field 1 and sub-report field 2,
otherwise
error).

I don't follow:
Whichever cell in the subreport has the same value
as the value in the parent report.
You cannot alter the linking per record, based on whatever field happens to
match.

If there are multiple fields in the subreport's table where the value might
be found, it sounds suspiciously like you have repeating fields? If so,
changing to a relational design (many records instead of repeating fields)
might be the best solution.
 

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