Help | Site Map
Connecting Tech Pros Worldwide
 
 
LinkBack Thread Tools
  #1  
Old January 20th, 2006, 11:45 AM
Marcin
Guest
 
Posts: n/a
Default interesting question - module - chart - form

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 ***
  #2  
Old January 25th, 2006, 06:05 PM
news.onet.pl
Guest
 
Posts: n/a
Default Re: interesting question - module - chart - form

> Set MyGraph = function_titleChart(IIf("Scrap chart " &[color=blue]
> Me![Other_options].Value = 1, "All scrap codes", "Vendor / Tochprilad"),
> Me![Chart1].Object)
> Me![Chart1].Object = MyGraph
> Me![Chart1].Requery
>
> Set MyGraph = Nothing[/color]

I have noticed where the error is. I should write the following code:

Set MyGraph = function_titleChart("Scrap chart " & IIf(
Me![Other_options].Value = 1, "All scrap codes", "Vendor / Tochprilad"),
Me![Chart1].Object)

This was if then erorr - such a small mistake but made me confused.

Thank you for comprehension
M.


 

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over network members.
Post your question now . . .
It's fast and it's free

Popular Articles