Can any one tell me how to pass an open Recordset as a parameter? I have tried the following...

private sub SUB1()
'dim and open a rs called RS1

bResult = MyFunction(RS1)

'close recordset and move on

end sub

Public MyFunction(ByVal RS2 as ADODB.Recordset) as Boolean
RS2.open
'do something with the recordset
RS2.close
MyFunction = True
End Function

The RS2.Open fails to execute. If I move the call below the close recordset in SUB1 it works just fine. I have tried passing it ByVal and ByRef.

Any assistance would be appreciated!!