Hi,
I'm looping 2 fairly large tables say 10000 records in one and 3000 in the other and when it runs windows says access is not responding -which it isn't windows just thinks so. But the problem i've got is i want to run a progress bar which consists of a box which grows in width and a label that shows the percent complete for the looping but this only seems to update right at the end of the process and not during it which is what my code should make it do.
Const MAX_LENGTH = 5670 '10 cm
set tables
If Table1.RecordCount > 0 Then
intNextProgressTrigger = 1
dbCurrentNumRecords = 0
intRecordCount = Table1.RecordCount
Table1.MoveFirst
Do Until Table1.EOF
If (dbCurrentNumRecords / intRecordCount) > (intNextProgressTrigger / 100) Then
bxProgress.Width = MAX_LENGTH * (intNextProgressTrigger / 100)
lblPercentComp.Caption = intNextProgressTrigger & "%"
intNextProgressTrigger = intNextProgressTrigger + 1
End If
table2 loop
dbCurrentNumRecords = dbCurrentNumRecords + 1
Table1.MoveNext
Loop
End If
tables close
I'm looping 2 fairly large tables say 10000 records in one and 3000 in the other and when it runs windows says access is not responding -which it isn't windows just thinks so. But the problem i've got is i want to run a progress bar which consists of a box which grows in width and a label that shows the percent complete for the looping but this only seems to update right at the end of the process and not during it which is what my code should make it do.
Const MAX_LENGTH = 5670 '10 cm
set tables
If Table1.RecordCount > 0 Then
intNextProgressTrigger = 1
dbCurrentNumRecords = 0
intRecordCount = Table1.RecordCount
Table1.MoveFirst
Do Until Table1.EOF
If (dbCurrentNumRecords / intRecordCount) > (intNextProgressTrigger / 100) Then
bxProgress.Width = MAX_LENGTH * (intNextProgressTrigger / 100)
lblPercentComp.Caption = intNextProgressTrigger & "%"
intNextProgressTrigger = intNextProgressTrigger + 1
End If
table2 loop
dbCurrentNumRecords = dbCurrentNumRecords + 1
Table1.MoveNext
Loop
End If
tables close