i was just wondering, if you had a sub that creates object variables (such as recordsets), and in the middle of this sub you wanted to exit it, would it be a good idea to use a GoTo that jumps to the end of the sub that sets these object variables to Nothing, or is there a better way? eg:

VB Code:
  1. Private Sub MySub()
  2.     Dim rs As ADODB.Recordset
  3.     Dim rs2 As ADODB.Recordset
  4.  
  5.     Set rs = New ADODB.Recordset
  6.     Set rs2 = New ADODB.Recordset
  7.  
  8.     If ([i]some condition[/i]) Then
  9.         If ([i]another condition[/i]) Then
  10.             'do something
  11.         Else
  12.             GoTo CleanUp
  13.         End If
  14.     Else
  15.         'do something else
  16.     End If
  17.  
  18.     'Do some more code
  19.  
  20. CleanUp:
  21.     Set rs = Nothing
  22.     Set rs2 = Nothing
  23. End Sub

thanks