Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Chart Display Problem

Status
Not open for further replies.

Netherby

Programmer
Nov 9, 2001
32
GB
Hi,

I have a form that has a chart control on it

When I open the form the chart appears blank with no data being displayed. If I single click on the chart then click on another control on the form, the data is displayed.

I open the form using VBA then set the chart RowSource but I can't get the VBA to click on and off the chart. Requery, Repaint, Refresh has no effect.

How can I use VBA to display the chart data without me having to click?

Cheers
 
Have you tried the setfocus method for controls? I'm not sure how that would play with an ActiveX control but it is the most intuitive way I know to try and replicate whay you are doing.
 
lameid,

Yes, I tried setfocus but no success. Setting the chart focus didn't work and I them moved the focus to another control and that didn't work.

Cheers
 
Hi,

I've attached a copy of my database.

There's a chart in the form called frm_position_chart but when I open the form the chart contents are not displayed. I have to click on the chart then click off it to get it to display.

I've tried some VBA to requery the form and the chart but I still have to click on and off the chart. I also tried using VBA to set the focus to the chart then move the focus to the close button on the form in the hope of simulating a click on and a click off. The code worked ok but, again, I couldn't see the chart contents and had to click on and off again using my mouse.

What I'm really looking for is a means to see the chart contents when the form is opened without having to do any clicking.

Thanks for your help
 
 http://www.mediafire.com/?5kp8a7b463it6
It's interesting the chart appeared immediatly on Access 2010. I'm running 2003.

I tried a requery as suggested but no success.
 
It opened right up for me on Access 2003 SP3.... Then again I also have Office 2007 Standard installed in addition to Access 2003.

You might try repairing or reinstalling office. (Particularly uninstalling the office chart compononent and reinstalling it). I haven't had to install office in over a year so I don't remember where it is at... I think there is a sperate office components group (as opposed to under any given application).


 
Nothing is easy with Mircosoft!

I'm due to upgrade to Office 2010 in a few weeks so I think I'll live with things until then.....I remember what happened when one of my colleagues went for a reinstall!

Many thanks for everyones comments.
 
At home I have and Office 2003 only computer... same behavior as you describe...

The only difference I can seem to make is adding a single line of code to the On load event....

Code:
Me!PosGraph.Action = acOLEActivate

This opens the chart in MS Chart. Closing it through the UI populates the chart in the form.... Closing it with sendkeys (sending keystrokes to close the application) does succeed in closing the MS Chart App but does not update the control in the form (both Alt+f4 and ALTF, x).

I yield...

If someone was really stuck for an extended period using office 2003... CreateObject("Excel.Application")? <--It pains me to suggest it with all the data problems I have dealt with because of Excel.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top