On Tue, 24 Feb 2004 20:44:53 +0200, "Jim" <ji***@levenrute.com> wrote:
I have this chart on a form. I'm trying to get this chart to render only if
the user chooses to do so. This because of that the chart is quite complex
and takes some time to render.
I know that I probably should put it on a report and call that report from
the form but for various reasons I need the chart on this form.
In a table bound to this form I have a Yes/No field and then from a checkbox
the user should get to choose if the form is rendered or not, for example if
the user has an old computer then he/she would want to turn off the chart
thus getting the form to load faster.
How do I make this happen? If I only set the chart visible or not then it
gets rendered anyway not speeding up the form even if it's chosen not to
show. Is there a way preventing the chart from loading/rendering in some
way? I tried messing with the charts recordsource with IIf and more but
without getting anywhere.
Create a form that has only the chart on it. Remove the chart from your current form and add a subform control in the size / position where you want
the chart displayed. Leave the SourceObject property of the subform control blank initially. When the form is opened the subform will be blank. Adjust
backcolors, borders etc to get the look you want.
When you want to display the chart set the SorceObject property of the subform control to the name of the form containing the chart -
Me.MySubform.SourceObject = "frmMyChartSubform"
This will load the subform with the chart form and you will get the performance hit here.
To clear the subform control use -
Me.MySubform.SourceObject = ""
You will need to use the LinkMaster and LinkChild properties of the subform control, or a criteria in the underlying query of the chart, to ensure
that when the chart is displayed it shows the correct data for the current record on the main form.
Wayne Gillespie
Gosford NSW Australia