Hi Everyone,
I am reading through a recordset to delte all the records.
The code that tests for EOF doesn't execute.
When I use debug it shows the EOF to be true.
Thanks.
I am reading through a recordset to delte all the records.
The code that tests for EOF doesn't execute.
When I use debug it shows the EOF to be true.
Thanks.
Code:
Set HDRdb = CurrentDb
Set HDRtdf = HDRdb.TableDefs("Delete_Table")
Set HDRrst = HDRdb.OpenRecordset("Delete_Table")
With HDRrst
.MoveFirst
.Edit
MsgBox (!Name)
.Delete
End With
Do_until_loop:
Do Until HDRrst.EOF
If HDRrst.EOF = True Then
GoTo Records_Deleted
End If
With HDRrst
.MoveNext
MsgBox (!Name)
.Delete
If HDRrst.EOF = True Then
GoTo Records_Deleted
End If
End With
Loop
Records_Deleted:
MsgBox ("All Records Deleted")
Last edited by a moderator: