R
Rod
Does anyone have any idea why this code only processes 95,039 of my 99,790
records?
Public Sub AssignOwnerDF()
Dim Db As DAO.Database
Dim rs As DAO.Recordset
DAO.DBEngine.SetOption dbMaxLocksPerFile, 150000
Set Db = CurrentDb
RecordCount = DCount("*", "tblWholesaler")
Set rs = Db.OpenRecordset("tblWholesaler") '
Mgr = 0
For RecCount = 1 To RecordCount 'Traverse table
If Mgr = 20 Then
Mgr = 0
Else
Mgr = Mgr + 1
rs.Edit
Select Case rs![Zip]
Case "60505" Or "60564"
rs![Owner] = 21
Case "60134" Or "60151" Or "60174" Or "60510" Or "60542" Or
"60554"
rs![Owner] = 22
Case Else
rs![Owner] = Mgr
End Select
rs.Update
rs.MoveNext
End If
Next RecCount
End Sub
I used research from http://support.microsoft.com/kb/815281
Thanks
records?
Public Sub AssignOwnerDF()
Dim Db As DAO.Database
Dim rs As DAO.Recordset
DAO.DBEngine.SetOption dbMaxLocksPerFile, 150000
Set Db = CurrentDb
RecordCount = DCount("*", "tblWholesaler")
Set rs = Db.OpenRecordset("tblWholesaler") '
Mgr = 0
For RecCount = 1 To RecordCount 'Traverse table
If Mgr = 20 Then
Mgr = 0
Else
Mgr = Mgr + 1
rs.Edit
Select Case rs![Zip]
Case "60505" Or "60564"
rs![Owner] = 21
Case "60134" Or "60151" Or "60174" Or "60510" Or "60542" Or
"60554"
rs![Owner] = 22
Case Else
rs![Owner] = Mgr
End Select
rs.Update
rs.MoveNext
End If
Next RecCount
End Sub
I used research from http://support.microsoft.com/kb/815281
Thanks