chart still displays incorrect data

chookers

Board Regular
Joined
Mar 16, 2002
Messages
115
Hi Peter et al...ok I have just tried the suggestions in the Microsoft Knowledge base article but they don't seem to work. I pull up the student's report, and I will still get the graph referencing data from the previous student.

To clarify, I am using a database (at the school I work for) in Access 2002 (file format is Access 2000) and Windows XP. This is a problem I've only had since the school upgraded to XP Pro earlier this year - that sounds about right.

This is definitely a nightmare because the usual routine is to open a report, push print, and send the reports home with the student's attendance shown in the graph. I have to do each one individually right now, and reference them to a hard copy of the attandance for each student. Gawd!

The knowledge base article says the solutions may not work in every case...and it seems this is one of those cases.

My question is....is there any way I can make these graphs work?? Or am I stuck forever more printing them out one by one and referencing each one.

It seems like a HUGE glitch not to be able to use graphs in a report, I just want to make sure I'm not missing anything before I resing myself to this.

Thanks for any other sources of help - will jump on Microsoft again now to see if I've missed anything there.

Cheers,

Lauren
 

Excel Facts

What do {} around a formula in the formula bar mean?
{Formula} means the formula was entered using Ctrl+Shift+Enter signifying an old-style array formula.
did you try upping the doEvents to a big number to see if that woud do it? might slow things down but quicker than doing things by hand.

Peter
 
Upvote 0
Also it might be worth looking at you quey design and the underlying tables to try to optimise this as much as posible. make sure that any field that is being use to filter or sort data on is indexed.
Peter
 
Upvote 0
Hi Peter...thanks for that - sorry didn't respond sooner but just back at school now after long weekdn. I will check the indexing but I'm fairly sure that's right on.

I did not try the doEvents loop however. My knowledge of VBA is very basic and I'm not exactly sure once I'm in the VBA editor how to do it. I looked through help but it didn't clear it up enough for me. I think my prioblem is I don't exactly understand what it does?

So once I'm in VB editor I'm just not sure what exactly the suitable code would be for the doEvents Loop. If anyone can refer a good source for me to understand this better...GREAT!

I am going to go through now and check the indexing,

Thanks very much!

Lauren
 
Upvote 0
Hi - ok I did actually update the indexing on one field but unfortunately the same bloody thing is still happening.

Grrrrrrr....

Good suggestion though, am going to go through all my tables and double check this.

Cheers!
 
Upvote 0
Ok now I have looked into doEvents a bit more on the internet. I still do not totally understand how this code relates to the problem I'm having but I'll get my mind around it somehow.

The code in the knowledge base article is like this:

Function TestProc()
Dim i As Integer
For i = 1 to 5
DoEvents
Next i
End Function

ok so if I have, let's say 300 records, how does this code need to change to help with the graph problem?

If I have to make a new module is that just a case of Private sub / End sub with this?

Thank so much for helping me understand this!

Cheers,
Lauren
 
Upvote 0
I would not bother putting it in a seperate module unless you have a number of reports to doctor!
In the forms design view you can select the On Format event for the detail section and add your code there.
Code:
Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
Dim i As Integer
' Replace objMyGraph with the name of your graph.
Me!objMyGraph.Requery

For i = 1 To 50
   DoEvents
Next i
End Sub

if that does not work you could try upping the events even further and see what happens.

Peter
 
Upvote 0
Peter, that is great!! it works. Yay!

Absolutely fantastic, what a relief.

Can you just tell me what does the 1 to 50 pertain to so I understand? Does it have any relation to the number of records?

And what 'event' does the 'DoEvent' actually do in this instance?

You have made my day, thanks so much.

Take care,

Lauren
 
Upvote 0
Each time the report tries to print the graph the code forces it to requery again. The 1 to 50 cause's it run run the doEvents 50 times for each graph. The event is just telling Access to yeild control of the CPU and let it carry on with any other work it has giving MSGraph a chance to complete its work.

peter
 
Upvote 0

Forum statistics

Threads
1,221,780
Messages
6,161,888
Members
451,730
Latest member
BudgetGirl

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top