OK so I've always been very disappointed with the limited capabilities of Charting in Access, so major review time for my database why not try and build a common function to build a customised chart (graph) for my report.
There's a very strong chance i've done a lot of this wrong, so very willing to take advice.
My current issue is this: I've actually got this working quite nicely when using the report or form as a standalone report or a standalone form. (see attached).
So i kinda cheated, not knowing how, or finding a guide to assist me in "Creating" the shape,line,label elements, i pre-loaded enough of each element to be sure to cover what i need, named them all with increasing integer; eg (lnMin0, lnMin1.....lnMin100) represents 101 minor gridlines just as (lnMaj0, lnMaj1.....lnMaj20) represents 21 major gridlines.
Once the chart parameters are fed to the function from the Call() procedure relevant scales and ratings parameters are retrieved from several tables, which are then used to alter the .pos .height .width .visible .caption parameters of each shape through a series of loops.
One image shows the report open in design mode with all the pre-loaded shape elements in no particular arrangement, the second shows the loaded form successfully displayed (except some of mu debugging ctrl's).
So to my current problem:
This is the method used in the function to set the caption parameter for the shape lblRSunits (which is a label) (outName = string referring to the report name "rptSub_RHR".
This piece of code works great for the report as a standalone, but when i add the report as a subreport to another main report i get the following error:
"The report name 'rptSub_RHR' you enterd is misspelled or refers to a report that isn't open or doesn't exist."
I'm assuming the Report() is now referring to the Main Report "rptBHA_2015" and not the oeiginal report which is now the SubReport.
I'm hurting now because the following code works to send a value to a control, now using both a reference to the report name (outName) and to the subreport (outSubName).
But a similarly structured line to alter the caption of a label doesn't work.
Very sorry for the long winded explanation/question, any assistance very welcome.
Cheers
Nathan
There's a very strong chance i've done a lot of this wrong, so very willing to take advice.
My current issue is this: I've actually got this working quite nicely when using the report or form as a standalone report or a standalone form. (see attached).
So i kinda cheated, not knowing how, or finding a guide to assist me in "Creating" the shape,line,label elements, i pre-loaded enough of each element to be sure to cover what i need, named them all with increasing integer; eg (lnMin0, lnMin1.....lnMin100) represents 101 minor gridlines just as (lnMaj0, lnMaj1.....lnMaj20) represents 21 major gridlines.
Once the chart parameters are fed to the function from the Call() procedure relevant scales and ratings parameters are retrieved from several tables, which are then used to alter the .pos .height .width .visible .caption parameters of each shape through a series of loops.
One image shows the report open in design mode with all the pre-loaded shape elements in no particular arrangement, the second shows the loaded form successfully displayed (except some of mu debugging ctrl's).
So to my current problem:
Code:
Reports(outName).lblRSunits.Caption = RSunitsThis is the method used in the function to set the caption parameter for the shape lblRSunits (which is a label) (outName = string referring to the report name "rptSub_RHR".
This piece of code works great for the report as a standalone, but when i add the report as a subreport to another main report i get the following error:
"The report name 'rptSub_RHR' you enterd is misspelled or refers to a report that isn't open or doesn't exist."
I'm assuming the Report() is now referring to the Main Report "rptBHA_2015" and not the oeiginal report which is now the SubReport.
I'm hurting now because the following code works to send a value to a control, now using both a reference to the report name (outName) and to the subreport (outSubName).
Code:
Reports(outName)(outSubName)(txtCtrl8).value = outNameBut a similarly structured line to alter the caption of a label doesn't work.
Code:
Reports(outName)(outSubName).lblRSunits.Caption = RSunitsVery sorry for the long winded explanation/question, any assistance very welcome.
Cheers
Nathan
Customised chart built by Function: Report vs SubReport Problem