I have a recordset that extracts some records from a table-but the problem is with my code-is that it only extracts one record-instead of a few-so the only way to delete the whole recordset (that's what i want to do ) is to keep on looping and setting new recordset-and I get one record every time-until there's no more records left.
How can I get all the records at once and delete them all at once?
here's my code: (the msgbox-was for debugging and only outputted 1 or 0 -never more -even though I have more records)
Set rec = dbs.OpenRecordset("Select Quarterlies.IFSPID, Quarterlies.DateDue, Quarterlies.Type FROM Quarterlies WHERE (Quarterlies.IFSPID =" & IFSPCounter & "
"
MsgBox "record Count " & rec.RecordCount
Do While rec.RecordCount > 0
rec.Delete
Set rec = dbs.OpenRecordset("Select Quarterlies.IFSPID, Quarterlies.DateDue, Quarterlies.Type FROM Quarterlies WHERE (Quarterlies.IFSPID =" & IFSPCounter & "
"
MsgBox "record Count " & rec.RecordCount
Loop
thank you
How can I get all the records at once and delete them all at once?
here's my code: (the msgbox-was for debugging and only outputted 1 or 0 -never more -even though I have more records)
Set rec = dbs.OpenRecordset("Select Quarterlies.IFSPID, Quarterlies.DateDue, Quarterlies.Type FROM Quarterlies WHERE (Quarterlies.IFSPID =" & IFSPCounter & "
MsgBox "record Count " & rec.RecordCount
Do While rec.RecordCount > 0
rec.Delete
Set rec = dbs.OpenRecordset("Select Quarterlies.IFSPID, Quarterlies.DateDue, Quarterlies.Type FROM Quarterlies WHERE (Quarterlies.IFSPID =" & IFSPCounter & "
MsgBox "record Count " & rec.RecordCount
Loop
thank you