I'm writing code In vb and when I run this code it says it cant refresh because the object is not open. When I put in "Adodc1.RecordSet.Open" it works perfectly the first time.
But If i run the function again, I get an error saying it cant open the recordset cause its already open.

I've tried putting adodc1.recordset.close, right before the function ends figuring that i'd be ok, but alas that didn't work either. Is there any way I can check to see if the recordset is already open?

I would really appreciate the help.. Thanks in Advance.


IF Adodc1.Recordset.RecordCount > 0 THEN

Adodc1.RecordSource = "DELETE FROM EquipOut WHERE Sequence = " & SeqNum
Adodc1.Refresh
MsgBox "DELETED SeqNum"

END IF