I have written the following code:
Sub UpdateIL4010DB()
Dim rst As DAO.Recordset
Dim tbl As DAO.TableDef
Dim db As DAO.Database
Dim fld As DAO.Field
Dim indx As DAO.Index
Set db = CurrentDb
Set tbl = db.TableDefs("Rid")
Set rst = db.OpenRecordset("Rid", dbOpenTable)
rst.MoveFirst
Do
If IsNull(rst![Rcode]) Then
rst.Edit
rst![Rcode] = rst!
Sub UpdateIL4010DB()
Dim rst As DAO.Recordset
Dim tbl As DAO.TableDef
Dim db As DAO.Database
Dim fld As DAO.Field
Dim indx As DAO.Index
Set db = CurrentDb
Set tbl = db.TableDefs("Rid")
Set rst = db.OpenRecordset("Rid", dbOpenTable)
rst.MoveFirst
Do
If IsNull(rst![Rcode]) Then
rst.Edit
rst![Rcode] = rst!
Code:
rst.Update
End If
rst.MoveNext
Loop Until (rst.EOF)
rst.Close
End Sub
The number of records to be read is about 2000000 records, and the runtime error occurs somewhere in the middle.
At first i thought the problem was the database becoming too large with too much data, causing the problem, but then i realised it jumps to over 2GB once the problem occurs. Which means, the problem caused the large size, instead of the other way round.
So i need to know why it caused runtime '3001' in order to make the program run successfully. Please help me!!
Thank you!!!