Link to home
Start Free TrialLog in
Avatar of suvmitra
suvmitraFlag for India

asked on

MS Access 2003 Chart VBA

Hi,
I want the VBA procedures to edit this chart Object in MS Access 2003.

I need to modify the Chart Title, Legend Name etc on the Form Load event.
1.JPG
Avatar of suvmitra
suvmitra
Flag of India image

ASKER

Please provide me a demo code.
Avatar of Rey Obrero (Capricorn1)
private sub form_load()

if me.graphName.hastitle then
   me.graphName.charttitle.text = "My Title"
end if



end sub
for the Legend, you have to do that in the SQL statement of the rowsource of your graph.
I am not able to find any graphName object. But If I can edit in runtime the Form - datasheet .. then my objective fullfills..is that possible to change values of the datasheet in runtime? How?

graphName - you have to change this with the actual name of your graph.
I have OLE Class as Microsoft Graph Chart
Name as OLEUnbound0
I am trying the below query but it is not working, can you suggest?
SELECT [Index],Sum([P1]) AS [forms]![Form_frmMain]![txtD7]
where is your graph located? in form frmMain?
No my graph is located on Form1 ; but I am opening frmMain, from frmMain I am opening frmReports, from frmReports I am opening frmCharts and from frmCharts I am opening Form1,
post the rowsource SQL of the graph.
the below is the default SQl, but I need to modify the [SumOfP1] with some text box data I have stored in the frmMain.
SELECT [Index],Sum([P1]) AS [SumOfP1],Sum([P2]) AS [SumOfP2] FROM [tblSlide6A5]   GROUP BY [Index];
what is the name of the second textbox, the first one is txtD7. is this correct?
ASKER CERTIFIED SOLUTION
Avatar of Rey Obrero (Capricorn1)
Rey Obrero (Capricorn1)
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Hi,
Every thing is fine now..but I need one more thing to know. In the X Axis (look at the picture) there are values like 13, 14, 15 which I want to replace as 13= jan, 14 = Feb like ways .. can you please further guide me to accomplish that? Many thanks!
Thank you.