Status Bar Stops in middle of process

mrgreen

Registered User.
Local time
Today, 13:36
Joined
Jan 11, 2008
Messages
60
I know this ? is form related but I'll start here. I'm writing approximately 2700+ records from Excel 2003 to Access 2003 using an ADO connection and I have created a status bar. When about 30 - 40% of the records are recorded the status bar quits updating but the records get sent up properly. Do I need to put a pause in to allow the form to catch up? Below is my For Next code. Thanks

For Each cell In LoadRange
cell.Activate
dtmscheddate = ActiveCell.Value
strshift = ActiveCell.Offset(0, 2).Value
stroven = ActiveCell.Offset(0, 3).Value
lngcotime = ActiveCell.Offset(0, 4).Value
strsku = ActiveCell.Offset(0, 5).Value
lngpromisedcases = IIf(ActiveCell.Offset(0, 7).Value = "", 0, ActiveCell.Offset(0, 7).Value)
lngadjcases = IIf(ActiveCell.Offset(0, 8).Value = "", 0, ActiveCell.Offset(0, 8).Value)
strnotes = ActiveCell.Offset(0, 9).Value
strSQL = "INSERT INTO tblschedule ([UNIQUEDATE],[DATESCHED],[SHIFTRAN],[OVEN],[COTIME],"
strSQL = strSQL & "[SKU],[PROMISEDCASES],[CASESADJ],[NOTES])"
strSQL = strSQL & " VALUES(#" & dtmuploaddate & "#,#" & dtmscheddate & "#,'" & strshift & "',"
strSQL = strSQL & "'" & stroven & "'," & lngcotime & ",'" & strsku & "'," & lngpromisedcases & ","
strSQL = strSQL & "" & lngadjcases & ",""" & strnotes & """);"
cnt.Execute strSQL
x = x + 1
With frmstatus
dblperc = (x / lngnumrecords) * 100
.lblcompl.Caption = Round(dblperc, 0) & "%"
.Repaint
.lblfront.Width = (x / lngnumrecords) * .txtbackground.Width
.Repaint
End With
Next cell
 
I took out one of the .Repaint commands and it seems to be a bit more consistent. If anyone has any other suggestions I'd be happy to hear 'em. :)
 

Users who are viewing this thread

Back
Top Bottom