Results 1 to 4 of 4

Thread: How do I pass a recordset as an argument to a function?

  1. #1

    Thread Starter
    New Member
    Join Date
    Jan 2000
    Posts
    7

    Post

    How do I pass a recordset as an argument to a function?

  2. #2
    Frenzied Member
    Join Date
    Aug 1999
    Location
    Santa Clara, Ca , 95058
    Posts
    1,105

    Post

    I don't, usually. I define my recordsets as globals and use them when/where needed.

  3. #3
    Addicted Member
    Join Date
    Oct 1999
    Posts
    253

    Post

    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!!!


  4. #4
    Addicted Member
    Join Date
    Feb 1999
    Location
    Belfast
    Posts
    254

    Post

    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
  •  



Click Here to Expand Forum to Full Width