The example I quoted uses the code below. I have a report "Rpt1". In that there is a charts called "Graph11" and a text box called "Location".
Based on options selected in the calling form, I set strings for the record sources of the report and the chart, and also for the text box. Further, I set up a string for the link between the chart and the report.
The code then opens the report in design view,
sets the record source for the report,
sets the record source for the graph,
sets the chaild and master fields for the link between the report and chart,
sets the control source for the Location text box,
and finally saves the report.
I then open te report as usual for the ser to see it.
The echo false / true bits make these changes invisible to the user, althouhg it does take a little longer for the report to appear to them.
hopefully you are checking this today...first of all THANK YOU for posting your code....i have some questions too though:
1. i only need the sql for the chart...i have nothing else on the report...will this still work???
2. can you explain the purpose of location??? and what sort of information will be contained in this property?
You're absolutely welcome - that's what this forum is for!
1. Yes
2. Location is probably unimportant to you - it is just a field I need on the report - it is not a property. It may change depending on the users input and is part of my Master / Child link between chart and report. If you only have a chart and the link is not dynamic, you should not need to worry about it. It could be any field!!!! Apologies if this has confused you - my naming conventions for fields are not always what it should be!
well i got the pie chart working!!!! it's a little messy with all the colors but that is what they asked for...i am guessing i will have to change the chart type...which is fine...
are you up for another challenge??? i haven't used access in quite some time and have been spoiled by the world of sql server so writing some of these queries and reports has been a headache!
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.