Referencing Object in Section on Report (1 Viewer)

TimW

Registered User.
Local time
Today, 22:45
Joined
Feb 6, 2007
Messages
90
Hi All,
I have been looking at this problem for a couple of days and I have run out of hair to pull out!

I have created a report that has two groups Customer and Product

i.e. The group header 1 is for customer and group header 2 is for product type
The detail looks at the QA problem with each Customer/product.

The report record source has a SQL query sent to it via VBA. No problems yet. The report shows all the data. The problem is I need to summarise the data in a graph. One graph for each occurance of Customer/Product.
I have put a graph in the section header of the Product. And for the live of me I cannot reference it.

If use
Code:
Reports!rptFaultByClassification_Detail!g_fault.RowSource = strSQLgraph
This does not work.I get an invalid reference error. BUT, If I move the graph g_fault to the Section above this level, then it will work. If I use
Code:
Reports!rptFaultByClassification_Detail.Section("group_MeterType")!g_fault.RowSource = strSQLgraph
Again I get an error. :(I have tried using different numbers for section i.e. .Section(7) acGroupLevel2Header but this has not worked either

Question: how do I reference the graph so I can change its row source?
(And if I do, will I be able to change the graph for every occurance of this section in the report?) (I thought about refreshing the data using the on Print method)

I need to produce a graph for a summary of each detail section.

Any suggestions? :eek: Please...

Thanks in advance

TimW
 

JamesMcS

Keyboard-Chair Interface
Local time
Today, 22:45
Joined
Sep 7, 2009
Messages
1,819
This might be useful
 

Attachments

  • Access refer to objects.doc
    54.5 KB · Views: 119

TimW

Registered User.
Local time
Today, 22:45
Joined
Feb 6, 2007
Messages
90
Two minutes later!:)
Thanks James. I do have that reference table on my desk! I have come up with:
Code:
Reports("rptFaultByClassification_Detail")!Grp_MeterType!g_fault.RowSource = strSQLgraph
This seems to be working. (i.e. no errors) :eek:
oops no it doesnt
I still need to work out how to update the graph...:rolleyes:

T
 
Last edited:

JamesMcS

Keyboard-Chair Interface
Local time
Today, 22:45
Joined
Sep 7, 2009
Messages
1,819
Reports aren't my strong point but is it a case of putting it in the right group header/footer? So would a customer group work here?

Good luck!
 

TimW

Registered User.
Local time
Today, 22:45
Joined
Feb 6, 2007
Messages
90
Further to last posts
I have given up on referencing the graph.:(
I changed tack. I created another report that was bound to a query. ( I created the query on the fly!)
I created a graph linked to the same query.
I linked the graph (master/child) to the two Groups or sections that i needed.
I then added code to the On Print event in the section containing the graph. This updates the graph when printed. Code from here: http://www.groupacg.com/ARptTip.htm#GRAPHGEN
I had to open the report in report view to add a label appropiate to the report i had just generated and then the Report to open 'Print Priview' (does not work in Report View) to see the correct graphs.


The disadvantages of doing this way are:
  1. I now have an extra query in the naviagation pane (before it was all driven from a form and SQL generated by the form)
  2. The users will have to view the report in 'Print preview' to see the correct graphs
More than one way to ....:)

Cheers
 

Users who are viewing this thread

Top Bottom