PDA

Click to See Complete Forum and Search --> : Showing ProgressBar for DataReport Builing


Troy Mac
May 19th, 2000, 03:12 AM
I have a connection to an SQL Database over a Wan and I am building a report. My problem is that I want to show progress to the user while the report builds. I have a progressbar but it does not fill until the report is loaded. is there a way that I can get CPU cycles to update the progres or tie the bar into the report build. The Form shows and stays ontop but the progress is non existing until the data is loaded in the report...

Thanks Troy


CODE:
Private Sub Form_Load()
Left = (Screen.Width - Width) / 2
Top = (Screen.Height - Height) / 2
' Start the progress bar at zero.

tmrTaskTimer.Interval = 1000
ProgBar.Max = 5 ' Timer will go for 5 seconds.

' Enable the timer to start the long task.
tmrTaskTimer.Enabled = True
If ProgBar.Value < 100 Then
SetWindowPos hwnd, _
HWND_TOPMOST, 0, 0, 0, 0, _
SWP_NOMOVE + SWP_NOSIZE
Else
SetWindowPos hwnd, _
HWND_NOTOPMOST, 0, 0, 0, 0, _
SWP_NOMOVE + SWP_NOSIZE
End If

End Sub


Private Sub tmrTaskTimer_Timer()
Static intTime ' Declare the static variable.
' The first time, the variable will be empty.
' Set it to 1 if it is an empty variable.
If IsEmpty(intTime) Then intTime = 1

ProgBar.Value = intTime ' Update the ProgressBar.

If intTime = ProgBar.Max Then
tmrTaskTimer.Enabled = False
ProgBar.Visible = False
intTime = 1
ProgBar.Value = ProgBar.Min
Unload Me
'DataReport1.Visible = True
Else
intTime = intTime + 1
End If

End Sub