473,403 Members | 2,323 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,403 software developers and data experts.

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 ***
Jan 20 '06 #1
1 1762
> 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


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.
Jan 25 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Jim | last post by:
I have this chart on a form. I'm trying to get this chart to render only if the user chooses to do so. This because of that the chart is quite complex and takes some time to render. I know that I...
1
by: Paul | last post by:
Let say, I have a table called USERS with the following fields: UserID, Date, Name, ComType. ComType gets it's info from another table called TYPE with fields: TypeID, TypeOfCom, with options:...
22
by: PeteCresswell | last post by:
I've been to http://msdn.microsoft.com/library/default.asp?url=/library/en-us/mschrt/html/vbobjtitleobject.asp, but still don't have a clue. For example, I've got a chart object namde...
3
by: StBond | last post by:
Hi everyone, I am new to Access and Visual Basic so things my be getting across a bit cloudy. I only started using VB for one week. I am having a little problem with the database that I am...
0
by: spm_no | last post by:
Hi, I am using Access 2002 and am creating a scatter-chart on a form in which the X-axis is a date. I can format and display the x-axis properly as a date. However, when I close and reopen...
9
by: Patrick.O.Ige | last post by:
I have a code below and its a PIE & BAR CHART. The values now are all static but I want to be able to pull the values from a database. Can you guys give me some ideas to do this? Thanks ...
1
by: ppabs | last post by:
Hello all, Originally, my goal was only to select all records in the "forecast_info" table where the table field "f_model" was equal to the content of a form field "v_model". I was able to...
14
by: Wayne | last post by:
I posted about this problem over 12 months ago and even after Vista SP1 the problem still exists when running an Access database (A2003 and A2007 tested) under Vista. A workaround was suggested by...
0
by: asifu9 | last post by:
Hello all, I am new to MS Access VBA 2007, i need help on how to open a chart form in switchboard. SwitchBoard having options to open a form in Add mode and edit mode, in both of...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.