O
OPMCoordinator
Guest
i have noticed others with similar problems to my own and wonder if someone out there can help.
i have a form is use to generate a graph. there are multiple options the user can choose to construct the graph. depending on the options chosen, the rowsource sql changes as well as the style of graph. i then use a button to print out the form with the graph and criteria selections as per the screen (i know that is bad practice but it has caused no real problems in itself thus far).
there is also a little button that saves the criteria (choices) to a table for automatic report runs.
i have a module that then opens the table and the form, applies the stored choices to the form one at a time and tells the graph to update and print.
problem: it takes a while to update the graph on some sets of criteria and the code runs away on itself giving totally bogus information on the graphs.
Solution 1: a timer. i have managed to get a timer working (needs a pause of 45 secs on the larger data sets, 5-10 on the smaller sets) but that leaves the 'puter sitting idle at times doing nothing but ticking off the counter seconds. with up to 100 graphs at a shot, we are talking lots of time doing nothing!
Solution 2: Doevents. i put this in after the .graph.requery bit but it does not seem to work. using the timer solution, the hourglass comes up (form is visible so i can see that all is ok) while the graph is updating, inferring that their is something going on to yeild the processor to as doevents is suppoed to do. when using doevents, the graph appears to be updating independantly of what else is going on in the form ie iterating through the table, updating the controls and printing.
it gives appearance that every second graph is printed twice, but is more likely a timing issue between when it finishes updating and which record of the table happens to be printing at that point in time.
any suggestions?
Mike C
i have a form is use to generate a graph. there are multiple options the user can choose to construct the graph. depending on the options chosen, the rowsource sql changes as well as the style of graph. i then use a button to print out the form with the graph and criteria selections as per the screen (i know that is bad practice but it has caused no real problems in itself thus far).
there is also a little button that saves the criteria (choices) to a table for automatic report runs.
i have a module that then opens the table and the form, applies the stored choices to the form one at a time and tells the graph to update and print.
problem: it takes a while to update the graph on some sets of criteria and the code runs away on itself giving totally bogus information on the graphs.
Solution 1: a timer. i have managed to get a timer working (needs a pause of 45 secs on the larger data sets, 5-10 on the smaller sets) but that leaves the 'puter sitting idle at times doing nothing but ticking off the counter seconds. with up to 100 graphs at a shot, we are talking lots of time doing nothing!
Solution 2: Doevents. i put this in after the .graph.requery bit but it does not seem to work. using the timer solution, the hourglass comes up (form is visible so i can see that all is ok) while the graph is updating, inferring that their is something going on to yeild the processor to as doevents is suppoed to do. when using doevents, the graph appears to be updating independantly of what else is going on in the form ie iterating through the table, updating the controls and printing.
it gives appearance that every second graph is printed twice, but is more likely a timing issue between when it finishes updating and which record of the table happens to be printing at that point in time.
any suggestions?
Mike C