CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5

Thread: recordset

  1. #1
    Join Date
    Mar 2001
    Posts
    29

    recordset

    I would like to access a recordset in a previous form. Is there a way to pass the variable over to the next form or do i need to make it a global variable?


    thnxs


  2. #2
    Join Date
    Jan 2000
    Location
    Saskatchewan, Canada
    Posts
    595

    Re: recordset

    If you declare the recorset as public in a module, it will be assessable in all forms.


    David Paulson

  3. #3
    Join Date
    Mar 2001
    Posts
    29

    Re: recordset

    Is there any other way? because I would like to avoid using global variable.

    Thanks,



  4. #4
    Join Date
    Mar 2001
    Posts
    9

    Re: recordset

    You can make a public property on the second form
    and set the recordset to that.


    Private m_ThisRecordSet as RecordSet

    Public Property Set TheRecordSet(rsIn as RecordSet)

    set m_ThisRecordSet = rsIn

    End Property

    And then when you create the form

    Dim frm as FormName

    set frm = new FormName

    Set frm.TheRecordSet = Rs

    where Rs is the instance of the recordset
    you currently have.

    No global variables.

    hope this answers your question.


  5. #5
    Join Date
    Feb 2001
    Location
    PA
    Posts
    163

    Re: recordset

    Never tried but I don't know why you couldn't use Form1.rs to reference the recordset on another form. Seems rather crude though.


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

Featured