View Full Version : Design changes on custom report


Jings00
08-18-2005, 12:25 PM
Hello all,

Recently, i have been moving into a new area of vba programming (for me).. reports and graphs. In a few custom reports I have made, I tie code such as this to a launch report button on a form:

Public Function LaunchPrintChart(ChartSource As String, ChartTitle As String, ChartValueAxisName As String) As String
Dim m_ObjChartR As Graph.Chart
DoCmd.OpenReport "FormGraph", acViewDesign, , , acHidden
Reports!FormGraph.GraphReport.RowSource = ChartSource
Set m_ObjChartR = Reports("FormGraph")("GraphReport").Object

With m_ObjChartR
.HasTitle = True
.ChartTitle.Caption = ChartTitle
With .Axes(xlValue)
.HasTitle = True
.AxisTitle.Caption = ChartValueAxisName
End With
End With

DoCmd.Close acReport, "FormGraph", acSaveYes
DoCmd.OpenReport "FormGraph", acViewPreview

As you can see, I want to dynamically change the chart on the form based on information fed from the form. This works just fine when I do it (exclusive access). But when other users launch the report, the custom changes to the chart do not happen. I am assuming this is a rights issue - user does not have access to save changes to the report, so this code will not work as intended.

I am unsure how to proceed, can I preview the changed report without saving it? or do I need to play with the user rights?

TIA