I was playing with the code and timing results with a stop watch. If I REM out the code to update the caption of the button, the little file I was running went from 5:45 seconds with the code to 2:91 without it. So I'm thinking maybe setting it so it doesn't update as often might help some.
Screen writes are always the slowest thing. That's why when I have a counter variable, I'll do something like...
For X = 1 to 1000000
If X MOD 100 = 0 then UpdateScreen
'Do Stuff
Next
This way it only updates the screen every 100 records (or 1000 or whatever you like). You want to let the user know something's happening and the system isn't locked, but you don't want to slow things down too much.
Sorry, only students may add comments.
Click here for more
information on how you can set up an account.
If you are a Visitor, go ahead and post your reply as a
new comment, and we'll move it here for you
once it's approved. Be sure to use the same name and email address.
This thread is now CLOSED. If you wish to comment, start a NEW discussion in
Access Developer 39.