Results 1 to 2 of 2

Thread: Return a recordset from a function

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    May 1999
    Posts
    161
    I am trying to write a function that will return a recordset:

    Property Get QueryResult() As Recordset

    Dim ado as New Recordset

    'Other declarations and execution of the query here

    QueryResult = ado

    End Property


    The line 'QueryResult = ado' gives me an error: 'Inalid use of Property'. Can someone tell me how I can pass this recordset as a variable ?

    Thanks

  2. #2
    Serge's Avatar
    Join Date
    Feb 1999
    Location
    Scottsdale, Arizona, USA
    Posts
    2,744
    Since Recordset is an OBJECT, you have to change property from Get to Set. So your property would look like this:
    Code:
    Property Set QueryResult() As Recordset 
        Dim ado as New Recordset 
    
        'Other declarations and execution of the query here 
        Set QueryResult = ado 
    End Property

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