Progress Bar

  • Thread starter Thread starter Sergey Bogdanov
  • Start date Start date
S

Sergey Bogdanov

Hello,

I'm trying to implement progress bar for calculations. I opened dialog
(none-modal) with ProgressBar and set Max value for ProgressBar with
nrecords. In the loop I increase progress value by 1.

Forms("Progress")![Progress].Max = nrecords
Forms("Progress")![Progress].Value = 0
Do While Not rst.EOF
rst.Edit
rst![ANSumma] = rst![NLitri] * rst![rate]
rst.Update

Forms("Progress")![Progress].Value =
Forms("Progress")![Progress].Value + 1

rst.MoveNext
Loop
rst.Close

I've noticed that Access has been hanging in this loop. The Access stops
redrawing itself. Is there any universal solution for large amount of
calculations? What about timer?

Thnx,
Sergey
 
Thnx, it works!

Dan Artuso said:
Hi,
Try adding DoEvents within yout loop.

--
HTH
Dan Artuso, Access MVP


Hello,

I'm trying to implement progress bar for calculations. I opened dialog
(none-modal) with ProgressBar and set Max value for ProgressBar with
nrecords. In the loop I increase progress value by 1.

Forms("Progress")![Progress].Max = nrecords
Forms("Progress")![Progress].Value = 0
Do While Not rst.EOF
rst.Edit
rst![ANSumma] = rst![NLitri] * rst![rate]
rst.Update

Forms("Progress")![Progress].Value =
Forms("Progress")![Progress].Value + 1

rst.MoveNext
Loop
rst.Close

I've noticed that Access has been hanging in this loop. The Access stops
redrawing itself. Is there any universal solution for large amount of
calculations? What about timer?

Thnx,
Sergey
 
Back
Top