Form label showing number of records.

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi there!

My users will be appending a lot of records to a table and this can take
some time. I would like to figure out how I can have a label which shows
"You are at Record XX" so that at least they know something is happening.

I've tried the following on the click event of the button which launches the
query:

Do Until rst.EOF
strRecCount = "Record ID: " & rst.RecordCount
lblRecCount.Caption = strRecCount
Loop

It really doesn't do anything.

Thanks for any and all help!
 
That may work, but I have had to add Me.Repaint in some cases to get the
display to update.
 
Try and add Doevents to the loop

Do Until rst.EOF
strRecCount = "Record ID: " & rst.RecordCount
lblRecCount.Caption = strRecCount
DoEvents
Loop
 
Johnny said:
Hi there!

My users will be appending a lot of records to a table and this can take
some time. I would like to figure out how I can have a label which shows
"You are at Record XX" so that at least they know something is happening.

I've tried the following on the click event of the button which launches the
query:

Do Until rst.EOF
strRecCount = "Record ID: " & rst.RecordCount
lblRecCount.Caption = strRecCount
Loop

As Klatuu said calling me.repaint is probably your solution. Just
keep in mind that updating a label caption after each iteration
will probably add noticable time to the process.
 
Back
Top