|
-
Oct 11th, 2001, 03:07 PM
#1
Thread Starter
Addicted Member
Passing Recordsets
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!!
-
Oct 11th, 2001, 03:31 PM
#2
Fanatic Member
It fails when you try to open a recordset that is already open. You
open it in sub1, pass it to myFunction, then inappropriately you're opening it again with RS2.Open so remove that line.
Ralph
-
Oct 11th, 2001, 03:34 PM
#3
Thread Starter
Addicted Member
Thank you very much... it was too obvious and simple of a solution!!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|