Progress bar showing progress of a make table query

J

JoeA2006

Is there a way to modify this code to create a progress bar based on the
number of records loaded into the new table from a make table query or a
spreadsheet. The only code I have for a progress bar is

Private Sub cmdGo_Click()

Dim inti As Double
Dim dblpct As Double

Do Until inti > Me.txtNumIterations
dblpct = inti / Me.txtNumIterations
Me.txtPctComplete = dblpct
Me.boxPct.Width = Me.boxWhole.Width * dblpct

Me.txtI = inti
If Me.txtI Mod 100 = 0 Then
DoEvents
End If
inti = inti + 1
Loop

This table loads quite a large number of records and I would rather have
something besides the access progress bar

End Sub
 
S

Stefan Hoffmann

hi Joe,
JoeA2006 said:
Is there a way to modify this code to create a progress bar based on the
number of records loaded into the new table from a make table query or a
spreadsheet.
How do you load the records into the new table? If you are loading it
from a rceordset record for record, than you can modify the source below
to set inti to the current record number and txtNumIterations to the
record count of your record set.
Private Sub cmdGo_Click()

Dim inti As Double
Dim dblpct As Double

Do Until inti > Me.txtNumIterations
dblpct = inti / Me.txtNumIterations
Me.txtPctComplete = dblpct
Me.boxPct.Width = Me.boxWhole.Width * dblpct

Me.txtI = inti
If Me.txtI Mod 100 = 0 Then
DoEvents
End If
inti = inti + 1
Loop
End Sub

Private m_RecordCount As Long

Public Sub ProgressBarInit(ARecordCount As Long)

m_RecordCount = ARecordCount
boxPct.Width = 0

End Sub

Public Sub PrograssBarCurrent(ARecordNumber As Long)

Dim dblPct As Double

If ARecordNumber <= m_RecordCount Then
dblPct = ARecordNumber / m_RecordCount
txtPctComplete = dblPct
boxPct.Width = boxWhole.Width * dblPct
Repaint
End If

End Sub
 

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