M
Manuel
I don't understand why I'm getting runtime error 3021: 'No Current Record'
when I run the below code. There are 8 records in the table and on the last
record, after MoveNext, I get the error. But why, since I'm on a current
record. Here's the code:
Function CreateExceptionTable()
Dim strSQL As String
Dim db As dao.Database
Dim rst As dao.Recordset
Dim i As Integer
Set db = CurrentDb
Set rst = db.OpenRecordset("tblSLQStmts")
DoCmd.SetWarnings False
rst.MoveFirst
i = rst.RecordCount
strSQL = rst("ExceptionCkSQL").Value
Do While i > 0
db.Execute strSQL
If Not rst.EOF Then
rst.MoveNext
strSQL = rst("ExceptionCkSQL").Value 'HERE IS WHERE I GET THE
ERROR!
End If
i = i - 1
Loop
DoCmd.SetWarnings True
End Function
Any help would be appreciated.
Thanks,
Manuel
when I run the below code. There are 8 records in the table and on the last
record, after MoveNext, I get the error. But why, since I'm on a current
record. Here's the code:
Function CreateExceptionTable()
Dim strSQL As String
Dim db As dao.Database
Dim rst As dao.Recordset
Dim i As Integer
Set db = CurrentDb
Set rst = db.OpenRecordset("tblSLQStmts")
DoCmd.SetWarnings False
rst.MoveFirst
i = rst.RecordCount
strSQL = rst("ExceptionCkSQL").Value
Do While i > 0
db.Execute strSQL
If Not rst.EOF Then
rst.MoveNext
strSQL = rst("ExceptionCkSQL").Value 'HERE IS WHERE I GET THE
ERROR!
End If
i = i - 1
Loop
DoCmd.SetWarnings True
End Function
Any help would be appreciated.
Thanks,
Manuel