|
-
Jan 12th, 2000, 04:17 AM
#1
Thread Starter
New Member
How do I pass a recordset as an argument to a function?
-
Jan 12th, 2000, 04:55 AM
#2
Frenzied Member
I don't, usually. I define my recordsets as globals and use them when/where needed.
-
Jan 12th, 2000, 04:57 AM
#3
Addicted Member
Are you using DAO, RDO or ADO? Anyway, in most of the cases, a recordset is an object of the class "Recordset". That means, that in order to pass it to a function, you need first to define the function:
Function Function1(Arg1 As Recordset,...) As ...
Then you need to pass the parameter:
Var1=Function1(RecSet,...)
Hope I helped you!!!
-
Jan 18th, 2000, 11:16 PM
#4
Addicted Member
Recordsets to my knowledge can be sent like any other parameter. I use ADO and have used it numberous times.
Example below.
Public Sub NextRecord(records As ADODB.Recordset)
If lb_recordsLoaded Then
If records.EOF Then
MsgBox "Already at last record"
Else
records.MoveNext
Call FillCustomerDetails(records)
End If
Else
MsgBox "No Records to Populate Form"
End If
End Sub
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
|