Record counter freezes (1 Viewer)

Jas_The_Ace

New member
Local time
Yesterday, 17:27
Joined
Apr 29, 2009
Messages
4
I get this problem all the time....

Do Until rs.EOF
Forms!frmMigration!lblProgress.Caption = "Record " & _
rs.AbsolutePosition & " of " & rs.Recordcount
Forms!frmMigration.Repaint
rs.MoveNext
Loop

I see the counter running fine and then it freezes at about 3000. I have to ctl-break out and use a debug.print instead

Help Please.
It worked fine in Access 97. I guess I have been struggling for 9 years now
 

Poppa Smurf

Registered User.
Local time
Today, 10:27
Joined
Mar 21, 2008
Messages
448
I do not know the reason for the freeze, maybe it is a timing issue with the repaint and next record.

If you are trying to display the status of the migration, have you thought about displaying the progress using the status bar?

I use the follwing method to display the progress of reading a text file and adding the data to a table, here is part of the code. Because of the speed of the reading the data and adding the record the status bar is updated every 100 records.

dim countem as integer
countem=0

Do Until EOF
.....
.....
rst.AddNew
(fields to be added go in here)
rst.Update

countem = countem + 1

If countem / 100 = Int(countem / 100) Then
Dim sttext As String
sttext = "Count = " & countem
DoCmd.Echo False, sttext
End If

Loop
 

gemma-the-husky

Super Moderator
Staff member
Local time
Today, 01:27
Joined
Sep 12, 2006
Messages
15,656
jas

Do Until rs.EOF
Forms!frmMigration!lblProgress.Caption = "Record " & _
rs.AbsolutePosition & " of " & rs.Recordcount
Forms!frmMigration.Repaint
doevents
rs.MoveNext

Loop

when you do this does it stop working, or just stop updating the screen

if its just the display then siimply adding doevents as above will most probably fix it.

if its a processing thing, then it depends what else is in your code, because that is clearly just an edited fragment
 

Users who are viewing this thread

Top Bottom