Hello all!
I have unusual problem with a database form.
I have a few forms with charts. I`ve created a module which changes me a
chart title. I send an object into the module function and then I try to
change a chart title and then the function return a chart object with
the change of chart title. I don`t know how to set the reference from
the object which is sent by function placed in module, into the chart
which is placed in a form. Is it possible to do so?
Thank you for your help
M.
Here is my form code which creates me a chart:
Me![Chart1].RowSource = "TRANSFORM Sum([SUMA]) AS [SumaSUMA] SELECT
[WK] FROM [qr_Report_Scrap_codes] GROUP BY [WK] PIVOT [ScrapCodes];"
Dim MyGraph As Object
'Set MyGraph = Me![Chart1].Object
Set MyGraph = function_titleChart(IIf("Scrap chart " &
Me![Other_options].Value = 1, "All scrap codes", "Vendor / Tochprilad"),
Me![Chart1].Object)
Me![Chart1].Object = MyGraph
Me![Chart1].Requery
Set MyGraph = Nothing
---------------------------------
here is my module function
Public Function function_titleChart(chtitle As String, chartobject As
Object) As Object
Dim MyGraph As Object
Set MyGraph = chartobject
With MyGraph
'Chart title
If .HasTitle Then
.ChartTitle.Text = chtitle
End If
End With
Set function_titleChart = MyGraph
Set MyGraph = Nothing
End Function
*** Sent via Developersdex http://www.developersdex.com ***