-
How can I detect if a recordset is still open? Because in the Form_unload event I have it close all the recordsets, however if the recordset isn't open, then I get an error, so I want to check if it is open first. How can I do this? Thanks
------------------
Ryan
-
If you use ADO, then it is very easy:
Code:
If rs.State = adStateClosed Then
MsgBox "Recordset is closed."
Elseif rs.State = adStateOpen Then
MsgBox "Recordset is opened."
End If
------------------
Serge
Programmer Analyst
[email protected]
[email protected]
ICQ#: 51055819
-
a recordset is Nothing when not open, so it's fairly simple (assume rstTmp is the recordset):
Code:
If rstTmp Is Nothing Then
'do nothing
Else
'do something
End If