E
Ember
I have a report that OnClose the following code is set to run. Its purpose
is to check to see if the field "Print" is checked or not. If it is, I want
it unchecked. The code works fine, but takes forever as it has 5000 plus
records to loop through and that number will only grow. Is there anyway to
speed the process up?
Thanks!
Private Sub Report_Close()
strTableName = "tblFiles"
Set db = CurrentDb
Set rst = db.OpenRecordset(strTableName, dbOpenDynaset)
With rst
Do Until .EOF
.MoveFirst
.FindFirst "[Print] = -1"
.Edit
.Fields("Print") = 0
.Update
.MoveNext
Loop
End With
rst.Close
Set db = Nothing
Set rst = Nothing
End Sub
is to check to see if the field "Print" is checked or not. If it is, I want
it unchecked. The code works fine, but takes forever as it has 5000 plus
records to loop through and that number will only grow. Is there anyway to
speed the process up?
Thanks!
Private Sub Report_Close()
strTableName = "tblFiles"
Set db = CurrentDb
Set rst = db.OpenRecordset(strTableName, dbOpenDynaset)
With rst
Do Until .EOF
.MoveFirst
.FindFirst "[Print] = -1"
.Edit
.Fields("Print") = 0
.Update
.MoveNext
Loop
End With
rst.Close
Set db = Nothing
Set rst = Nothing
End Sub