wailingrecluse
Registered User.
- Local time
- Today, 22:49
- Joined
- Feb 10, 2009
- Messages
- 50
Okay, so see - that was very good. It allowed me to spot the problem right away. There are a couple of problems:
1. This form that you have the code on is bound to the table.
2. You are using a timer to run the queries but a few things about that:
a. You have the timer interval set to 600 (which is 600 milliseconds) and you
b. Never turn off the timer - so every 600 milliseconds this code is continuing to fire.
3. You can't close the form in the code because the code is on the form you are telling it to close. It can't close itself until all code has been run.
I think you need to have the form code open the frmReload and then close itself and put the code to run the queries on the frmReload and then have it reopen the other form and then close itself.
For the reload form you can set the status between queries but you also need to include this in between each:
' code for query here then
Me.Repaint
DoEvents
' code for next query here then
Me.Repaint
DoEvents
that way you can have it update in between each query to really show the status.
Glad that helped

Yeah, the timer is set so low just for testing, rather than wait every 15 minutes or so, which is how it will eventually be.
That makes sense about the code, so I will move it partly to the other form and see if that works.
If it does, I owe you a pint

Will send you a message tomorrow with the outcome.
Thanks again for all your help