Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Update MSChart in Access 2000 Report

Status
Not open for further replies.

bJohnnyv

IS-IT--Management
Dec 5, 2000
10
0
0
US
I need to be able to change the .MaximumScale & .MimumScale of a chart in a report. I copied and pasted the mschart from a form and the code. It works in the form but in the report i get a runtime error 2771 -> the bound or unbound object frame you tried to edit doesn't contain an ole object.
errors on this line
Dim OLE1 As Object
-> Set OLE1 = Me![PGraph1].Object.Application.Chart

Any ideas ?????????????????????????????
 
did you find out what this problem was? im getting the same error with a calender control
 
No, I have not received any replys other then yours. I am just living with the reports as it stands today
 
Any further joy on this one - I have trawled everywhere - it seems you can manipulate chart object on a form quite easily - but on a report - no can do?

:(

Andy
 
I have found the answer to this issue problem
you have to open the report in design mode and then make the changes to the report using code. Save it and then print it. I used the following

stdocname = the report being printed

## open the report in design mode
DoCmd.OpenReport stDocName, acViewDesign

## i changed the min and max scale of the chart (pgraph1)
Reports(stDocName)!PGraph1.Object.Application.chart.axes(2).minimumscale = 10
Reports(stDocName)!PGraph1.Object.Application.chart.axes(2).maximumscale = 25

## close the report and save it
DoCmd.Close ObjectType:=acReport, ObjectName:=stDocName, Save:=acSaveYes

##open the report
DoCmd.OpenReport stDocName, acPreview, , stwherecategory

## i allow the print to be selected (another section)
Set prt = Reports(stDocName).Printer

##print the report
DoCmd.PrintOut PrintRange:=acPages,PageFrom:=1,PageTo:=32767

That was it, and it worked
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top