Results 1 to 6 of 6

Thread: Has object been set?

  1. #1

    Thread Starter
    Lively Member
    Join Date
    May 2000
    Location
    Dublin, IRE
    Posts
    111

    Has object been set?

    Code:
    Static myDb As Database, myRs As Recordset
    Set myDb = whatever
    Set myRs = whatever
    Now, when I enter this procedure, I want to find out if the recordset has been set already. If not, I want to set it. If so, I want to do some stuff with it. Basically, we're talkin' persistent recordsets. That's possible, right?

    I thought I could put a
    Code:
    If myRs = Nothing Then
    in before the Set myRs statement, but that would be too easy, so how?

    The point of all this (if you're at all interested) is that I want to create an RS when the user loads the form, consisting of, say 50 records. There is a drop down on the form where they can select a filter of that RS. So I want to load the whole thing first time, but set a filter on the existing RS (which is a random sample of the full database) on subsequent calls.


  2. #2
    Addicted Member stevess's Avatar
    Join Date
    May 2001
    Posts
    251
    If myrs IS Nothing Then

  3. #3
    The Devil crptcblade's Avatar
    Join Date
    Aug 2000
    Location
    Quetzalshacatenango
    Posts
    9,091
    try this :
    VB Code:
    1. If myRs Is Nothing Then
    Laugh, and the world laughs with you. Cry, and you just water down your vodka.


    Take credit, not responsibility

  4. #4

    Thread Starter
    Lively Member
    Join Date
    May 2000
    Location
    Dublin, IRE
    Posts
    111
    Thanks people. God, I suck

  5. #5
    gaffa
    Guest
    Static Recordsets.... what is the world coming to?

    - gaffa

  6. #6

    Thread Starter
    Lively Member
    Join Date
    May 2000
    Location
    Dublin, IRE
    Posts
    111
    I know!

    Seemed like a good idea at the time

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