MSFlexGrid slow 2nd time around

JZUPKUS
JZUPKUS used Ask the Experts™
on
The problem I'm having is when I try to fill the grid with a different resultset.  The first time it loads it's lightning fast.  The second time I try to load data its very slow.  The order by clause in both statements is indexed.  I'm lost.  It would seem like there is something I'm not doing with the grid

Jim
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Commented:
Try clearing the resultset & grid completely before reloading it.  I found this solved my identical problem.

I can't explain why it worked because it was mainly a trial & error solution but maybe it'll work for you too ;)

Commented:
Please post the code.

Author

Commented:
I already use Grid.Clear and closed the resultset.  But, talking/typing this out made me think of something.  The first time the grid is loaded the form is not visible.  So when I went to reload the grid with a different resultset with the form VISIBLE it took a long time.  I added Me.Hide before the load and Me.Show after the grid was populated and it was back to very fast!

This problem has bothered me for a long time and talking it out helped so I'll give you the points Frodoman.  Good thing to remember.  Dec 17th approaches - Return of the King.  

Thanks,
Jim

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial