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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Show charts on form without clicking the mouse 1

Status
Not open for further replies.

SeadnaS

Programmer
May 30, 2011
214
Hi i have a pie chart on a form. It won't show up unless I click on it. Tried a requery in form on open event but no luck also tried the on load event but still nothing. Is there no way to have the chart visible when the form opens?
 
Have you tried a Recalc ?

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Yeah, it doesn't work either. I found a forum post on google where someone said it was an issue with access 2003 on windows 7 which is exactly what i'm using. He/she said that in Windows XP the charts show up instantly but not on Windows 7 if using access 2003. There was no solution provided on the thread.
 
I had the same issue... tried everything I could imagine without success. People did not like it, and it finally killed the application.

georgesOne
 
I still can't find a solution to this. It is extremely annoying.
 
How are ya SeadnaS . . .

I can't find the db where I did this (same or similar problem), but I believe if you [purple]set focus to the chart and then somewhere else of your choosing[/purple] it will work.

[blue]Your Thoughts? . . .[/blue]

See Ya! . . . . . .

Be sure to see faq219-2884 [blue]Worthy Reading![/blue] [thumbsup2]
Also faq181-2886 [blue]Worthy Reading![/blue] [thumbsup2]
 
SeadnaS . . .

I found the db. In the [blue]On Updated[/blue] event of the chart, copy/paste the following ([blue]you![/blue] substitute proper names in [purple]purple[/purple]):
Code:
[blue]  Dim curName As String

   curName = Screen.ActiveControl.Name

   If Screen.ActiveControl.Name <> "[purple][B][I]YourChartName[/I][/B][/purple]" Then Me!Graph3.SetFocus
   Me(curName).SetFocus[/blue]
[blue]Your Thoughts? . . .[/blue]

See Ya! . . . . . .

Be sure to see faq219-2884 [blue]Worthy Reading![/blue] [thumbsup2]
Also faq181-2886 [blue]Worthy Reading![/blue] [thumbsup2]
 
SeadnaS . . .

Code:
[blue]Me!Graph3.SetFocus
[green]'should read[/green]
Me![purple][B][I]YourChartName[/I][/B][/purple].SetFocus[/blue]

Sorry about the mess ...

See Ya! . . . . . .

Be sure to see faq219-2884 [blue]Worthy Reading![/blue] [thumbsup2]
Also faq181-2886 [blue]Worthy Reading![/blue] [thumbsup2]
 
That works, thanks!

But when I close the form i get error 2474:
"The expression you entered requires the control to be in the active window.
 
SeadnaS . . .

Does the debugger stop on a line?

See Ya! . . . . . .

Be sure to see faq219-2884 [blue]Worthy Reading![/blue] [thumbsup2]
Also faq181-2886 [blue]Worthy Reading![/blue] [thumbsup2]
 
Yup:

curName = Screen.ActiveControl.Name
 
Any ideas? I'm really stuck here. I've gotta make this live today. I think i'm gonna have to take the pie chart off the main form if i can't get it working ok.
 
SeadnaS . . .

I believe this may be a bug and am currently researching the problem.

Are you using Vista or Windows7 ?

See Ya! . . . . . .

Be sure to see faq219-2884 [blue]Worthy Reading![/blue] [thumbsup2]
Also faq181-2886 [blue]Worthy Reading![/blue] [thumbsup2]
 
I'm using Windows 7 but we are deploying to mostly Windows XP machines. I had a meeting today and had to use an XP machine to demonstrate how the database works. None of the dates worked! I had no time to see if the database worked on that PC, how embarrassing. I have five txt boxes with dates in them using =Date() and they all showed up #Name?. Could that be an active x issue?
 
Oh! The chart shows up correctly on Windows XP it seems! I won't need that code if all the machines in the office upstairs are XP! It definitely doesn't show up straight away on our Win 7's tho (without your code).
 
Ignore my question about the dates. Too much tea. I fixed that there was a missing active x reference.
 
SeadnaS . . .

Since this all depends on [blue]focus manipulation[/blue] ... the solution is really easy.
[ol][li]Delete the code in your Charts [blue]On Updated[/blue] event.[/li]
[li]Save & close the form.[/li]
[li]Open the form and note the control [blue]where the focus is[/blue]. This is where the focus rests when the form is open. Write this name down! ... we'll call this the [purple]InitialFocusControlName[/purple].[/li]
[li]Finally ... in the charts [blue]On Updated[/blue] event, copy/paste the following ([blue]you![/blue] substitute proper names in [purple]purple[/purple]):
Code:
[blue]   Me!("[purple][B][I]YourChartName[/I][/B][/purple]").SetFocus
   Me("[purple][B][I]InitialFocusControlName[/I][/B][/purple]").SetFocus[/blue]
[/li]
[li]Thats it! ... perform your testing![/li][/ol]
All should be well across platforms! [blue]I'm so sorry you didn't receive resolution in time![/blue] You should've made this known earlier.

[blue]Your Thoughts? . . .[/blue]



See Ya! . . . . . .

Be sure to see faq219-2884 [blue]Worthy Reading![/blue] [thumbsup2]
Also faq181-2886 [blue]Worthy Reading![/blue] [thumbsup2]
 
SeadnaS . . .

I intend to make this an [blue]FAQ[/blue] since I see this has been a problem across the new platforms (Vista/Win7) thru the internet. I await your results before I post ...

[blue]Your Thoughts? . . .[/blue]

See Ya! . . . . . .

Be sure to see faq219-2884 [blue]Worthy Reading![/blue] [thumbsup2]
Also faq181-2886 [blue]Worthy Reading![/blue] [thumbsup2]
 
It appears to work ok on windows 7 i havn't had a chance to try the xp box yet.
 
Hi Ace-Man
I tried it on Windows 7 without success.
Actually, the OnUpdated event does not fire.
Any suggestions?
Regards, georgwesOne
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top