473,549 Members | 4,476 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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_titleC hart(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_titleC hart(chtitle As String, chartobject As
Object) As Object
Dim MyGraph As Object
Set MyGraph = chartobject

With MyGraph

'Chart title
If .HasTitle Then
.ChartTitle.Tex t = chtitle
End If

End With

Set function_titleC hart = MyGraph

Set MyGraph = Nothing

End Function

*** Sent via Developersdex http://www.developersdex.com ***
Jan 20 '06 #1
1 1771
> Set MyGraph = function_titleC hart(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_titleC hart("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
2186
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 probably should put it on a report and call that report from the form but for various reasons I need the chart on this form. In a table bound to...
1
1667
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: Email, Phone, Message Table Samples: UserID Date Name ComType -------------------------------------------
22
6746
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 'grphStats' in a form named frmChart. ?Forms!frmChart!grphStats.Name returns "grphStats" as expected, but I can't get any further.
3
3408
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 working on. I am working with MS Access 2002. And I am having a problem with one of my charts. I will explain how everything is laid out then go...
0
2073
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 Access, the data are incorrectly plotted with an x-axis that begins with a date of 1900. Only by toggling from the option "chart by column" to "chart by...
9
3061
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 Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load 'Declare your object variables
1
1446
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 achieve this with the following query. PARAMETERS !! Text ( 255 ); SELECT forecast_info.f_model, forecast_info.f_year, forecast_info.f_production,...
14
4567
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 another group member at that time, but it's hardly ideal. MS should really look at this and fix it. When a form containing a chart is opened...
0
1694
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 them chart is not displaying. instead its showing text box to enter data on the form. I had attached a image file, please have a look at that. image...
0
7526
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7723
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
1
7480
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
6050
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5373
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5092
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3486
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1949
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1063
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.