form printing automation

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,
I am trying to fiqure out if there is way ( perhaps by script or macro)
that I can automate the process of selecting a form making a graph with
specific parameters, then printing it out. Then changing the parameters &
priniting that one out so that each action does not have to be performed
manually.

consider the following example :

|
|
Quantity |_____________________

months

In my data, I have Apples, Pears, Oranges. The chart showing the
quantity of each fruit for each month.

I want a script or macro to select the parameters print a seperate chart for
each item of fruit.

Is there something like this available?
 
There is a way to do this. What you need to do is to duplicate your chart in
a report and then write code that will go into the design view of that
report, modify the chart and then print it. You'll want to make the report
invisible so that your user doesn't see this happening.

The code is fairly simple....

Dim stDocName As String
stDocName = "rptCheckChart"

'First open the report as invisible in design view and set the row
source for the chart
'to the same as the one in the form
DoCmd.OpenReport stDocName, acViewDesign
Reports!rptCheckChart.Visible = False
Reports!rptCheckChart!CheckChart.RowSource = Me.CheckGraph.RowSource
'Close the report saving the changes
DoCmd.Close acReport, stDocName, acSaveYes
'Open the report again this time making it visible in Preview mode
DoCmd.OpenReport stDocName, acPreview

I hope this helps.
 
Assuming you have a table with a record for each fruit, you can use the Link
Master/Child properties of the chart control to use one chart in the detail
section to print a chart for each fruit.
 
Back
Top