Hi,
I've got a splash screen that I'm wanting up when the database starts that will display a 'fake' progress bar while it does some checks in the background.
I've got the code written to fake a progress bar, and it works fine, as long as it works from a command button click. It doesn't however work in the OnOpen, OnCurrent, OnActivate etc. events for the form itself.
As I said, works fine from a command button, but in any of the form events, the thing just opens showing the progress bar at 100%.
Any ideas?
I tried inserting a 2 second pause using:
immediately before the 'For' loop that runs the progress bar, but that failed to work as it just delayed the opening of the form by 2 seconds.
I've got a splash screen that I'm wanting up when the database starts that will display a 'fake' progress bar while it does some checks in the background.
I've got the code written to fake a progress bar, and it works fine, as long as it works from a command button click. It doesn't however work in the OnOpen, OnCurrent, OnActivate etc. events for the form itself.
Code:
Dim intCurrentProgress As Integer
Dim intWidth As Integer
' This is the number of objects you expect to count which take some
' time to process. It likely won't be a constant in your environment.
Dim intTotalWidth As Integer
Const intProgressBarMax As Integer = 20000
intTotalWidth = Me.rectProgressBar.Width
For intCurrentProgress = 1 To intProgressBarMax
intWidth = (intTotalWidth / intProgressBarMax) * intCurrentProgress
'MsgBox intWidth
Me.rectProgressBar.Width = intWidth
Me.Repaint
Next intCurrentProgress
Any ideas?
I tried inserting a 2 second pause using:
Code:
PauseTime = 2 ' Set duration.
Start = Timer ' Set start time.
Do While Timer < Start + PauseTime
DoEvents ' Yield to other processes.
Loop
Finish = Timer