BASIC/Visual Basic >> Processing while allowing user to pause/stop...
Posted by Jasim on 01:14:00 06-08-2003
I'd tried some time to do some time-taking database operation with a progress bar.

But in the normal course where we do all the processing in a normal SUB or EVENT, say we are going through a table having 100,000 records. It would take real time and the user wont be able to click on any commandbutton or anything like that so as to stop/pause.

The only solution I've found is to put the process in an incrementing fashion using a timer. So the user can do whatever he please in the timer interval.

IF you want to see the code, please tell me.

IF YOU HAVE A BETTER IDEA, then PLEASE PLEASE PLEASE tell me...

Regards,
Jasim
Posted by dxprog on 04:33:00 06-08-2003
Run it through a loop with the DoEvents method right up front. This keeps other processes going. Example:

Do
  DoEvents
  If bProcess = True Then
    ' Process DB Stuff here
  End If
Loop

You can make a command button to set the value of bProcess to do Pause\Resume. [addsig]
Posted by Jasim on 23:19:00 06-08-2003
Thanx DX..,

Let me try it out...

The timer thing is quite tedious...!