|
|
Creating a Graph/Chart on a Report in VBAQuestionI just want to create a graph on a report within a module (using VBA) at run-time. Any suggestions on how to carry out this task or if anyone knows where I can get my hands on some good source code relating to this then that would be great. Answer
Dim rpt As Access.Report
Dim ctlObjFrame As Access.ObjectFrame
Dim cw_rsTemplates As DAO.Recordset
Set rpt = CreateReport
Set ctlObjFrame = CreateReportControl(rpt.Name, _
acObjectFrame, , "", "", 100, 100)
Set cw_rsTemplates = CodeDb().OpenRecordset( _
"cw_tblChartTemplates", dbOpenDynaset)
cw_rsTemplates.MoveFirst
' Set OleData property to template graph from OLE field
ctlObjFrame.OleData = cw_rsTemplates!ChartObject
DoCmd.Restore
Get wztool80 sources and dig into them... Copyright © 1999-2008 by Shamil Salakhetdinov. Original version is published here All rights reserved. |