Show record processing

G

Guest

Hi there,

I want my user to be able so see the processing of records as my db runs a
query. They are working with large recordsets, up to 1,000,000 records.
Now, the query bar moves very slowly and not at all for minutes at a time.
What I want is for the user to see, "processing 2,154 of 500,000 etc with the
first number constantly increasing.

I have tried the following:

Dim conn As ADODB.Connection
Set conn = CurrentProject.Connection
Dim Frst As New ADODB.Recordset
Dim TotalRecords As Long
Dim RecordNum As Long
Dim Feedback As String

RecordNum = 0
Frst.Open "Select * From ClientData", conn, adOpenKeyset, acLockOptimistic
TotalRecords = Frst.RecordCount

Do Until Frst.EOF
RecordNum = RecordNum + 1

Feedback = "Processing " & RecordNum & " of " & TotalRecords

SysCmd acSysCmdSetStatus, Feedback

Frst.MoveNext
Loop

Frst.Close
Set Frst = Nothing

This seems to work, but my status bar is unreadable things are going so
fast. I've tried doing this as well:
Me.txtTotRecs.Text = CStr(TotalRecords)
with another text box showing the total number of records in the set which
is populated in the on open event of the form. I also tried this with a
label's caption property, but it won't show anything until after all is done
and the last record is reached.

Any suggestions?

Thanks!
 
R

ruralguy via AccessMonster.com

Screen updating is a very low priority task in Access. Toss in some DoEvents
to give the other tasks some computer time.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top