R
Robert
I have 2 recordsets, rt and ru. I want to delete every record from rt where
there is a record in ru with the same value for "itemid":
Set rt = db.OpenRecordset(SQLstr1)
Set ru = db.OpenRecordset(SQLstr2)
If Not (rt.BOF And rt.EOF) Then
rt.MoveFirst
Do Until rt.EOF
If (ru.BOF And ru.EOF) Then
ru.MoveFirst
Do Until ru.EOF
If rt.Fields("itemid") = ru.Fields("itemid") Then
rt.Delete
End If
ru.MoveNext
Loop
End If
rt.MoveNext
Loop
End If
As you can see, if the itemid fields in rt and ru are equal then I do a
delete on rt. My question is, should there be a MoveNext after that? Since
a record has been deleted from rt that MoveNext won't cause it to skip a
record will it?
Robert
there is a record in ru with the same value for "itemid":
Set rt = db.OpenRecordset(SQLstr1)
Set ru = db.OpenRecordset(SQLstr2)
If Not (rt.BOF And rt.EOF) Then
rt.MoveFirst
Do Until rt.EOF
If (ru.BOF And ru.EOF) Then
ru.MoveFirst
Do Until ru.EOF
If rt.Fields("itemid") = ru.Fields("itemid") Then
rt.Delete
End If
ru.MoveNext
Loop
End If
rt.MoveNext
Loop
End If
As you can see, if the itemid fields in rt and ru are equal then I do a
delete on rt. My question is, should there be a MoveNext after that? Since
a record has been deleted from rt that MoveNext won't cause it to skip a
record will it?
Robert