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