Avatar of suvmitra
suvmitra
Flag 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
Microsoft Access

Avatar of undefined
Last Comment
suvmitra

8/22/2022 - Mon
suvmitra

ASKER
Please provide me a demo code.
Rey Obrero (Capricorn1)

private sub form_load()

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



end sub
Rey Obrero (Capricorn1)

for the Legend, you have to do that in the SQL statement of the rowsource of your graph.
Your help has saved me hundreds of hours of internet surfing.
fblack61
suvmitra

ASKER
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?
Rey Obrero (Capricorn1)


graphName - you have to change this with the actual name of your graph.
suvmitra

ASKER
I have OLE Class as Microsoft Graph Chart
Name as OLEUnbound0
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
suvmitra

ASKER
I am trying the below query but it is not working, can you suggest?
SELECT [Index],Sum([P1]) AS [forms]![Form_frmMain]![txtD7]
Rey Obrero (Capricorn1)

where is your graph located? in form frmMain?
suvmitra

ASKER
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,
Experts Exchange has (a) saved my job multiple times, (b) saved me hours, days, and even weeks of work, and often (c) makes me look like a superhero! This place is MAGIC!
Walt Forbes
Rey Obrero (Capricorn1)

post the rowsource SQL of the graph.
suvmitra

ASKER
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];
Rey Obrero (Capricorn1)

what is the name of the second textbox, the first one is txtD7. is this correct?
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
ASKER CERTIFIED SOLUTION
Rey Obrero (Capricorn1)

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
suvmitra

ASKER
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!
suvmitra

ASKER
Thank you.