Results 1 to 5 of 5

Thread: record sets

  1. #1

    Thread Starter
    New Member
    Join Date
    Jan 2000
    Location
    New York, NY 10003
    Posts
    2

    Post

    I have the following code:
    Dim db as database, Dim rsbiograph as recorset, Dim rsDoNotEmail as recordset, Dim rsEmailTracking as recordset, Set rsbiograph =..., Set rsDoNotEmail = ..., Set rsEmailTracking = ...
    when I get to rsBiograph.FindFirst "StuID = '" & strAL_SID & "'" it gives me an error 'Object variable or with block variable not set (error 91)...
    Would someone pls help me on this??
    THanks alot

  2. #2
    Hyperactive Member
    Join Date
    Jun 1999
    Location
    Calgary Alberta
    Posts
    359

    Post

    post the code where you set the recordsets. I assume you have set the database already? It's easier to find what's wrong if you post the code.

  3. #3

    Thread Starter
    New Member
    Join Date
    Jan 2000
    Location
    New York, NY 10003
    Posts
    2

    Post

    Here is a more detailed chuck of code
    Dim db As Dtabase
    Dim rsBiograph As Recordset
    Dim rsDoNotEmail As Recordset
    Dim rsEmailTracking As Recordset

    Set db = OpenDatabase("C:\Windows\Desktop\Award Letter Pilot\FStudents2.mdb")
    Set rsBiograph = bd.OpenRecordset ("Biograph", dbOpenDynaset)
    Set rsDoNotEmail = db.OpenRecordset("DoNotEmail", dbOpenDynaset)
    Set rsEmailTracking = db.OpenRecordset("EmailTracking", dbOpenDynaset)

    Do while not EOF(2)
    input #2, strAL_SID

    rsBiograph.FindFirst "StuID = '" & strAL_SID & "'"

    loop

    rsBiograph.close
    db.close

    I get an error in the rsBiograph.FindFist statement.. can someone please help??

    Thanks

  4. #4
    Hyperactive Member
    Join Date
    Jun 1999
    Location
    Calgary Alberta
    Posts
    359

    Post

    I assume you have opened the file(2) correctly and all of that. I think, and I could be wrong, that the problem is your recordset.

    Set rsBiograph = bd.OpenRecordset ("Biograph", dbOpenDynaset)

    I usually do it like this:

    set rsBiograph = bd.OpenRecordset("Select * from Biograph")

    I used to use the dbOpenDynaset but haven't for a while and I can't remember what it's for. And I'm not sure if opening hte recordset as "Biograph" is enough to open it. Possibly you have to check to see if rsBiograph.EOF is true or false. I can't think of anything else. Hope that helped.

  5. #5
    Guest

    Post

    if you have anything in form_load() take it out and put it into form_activate() that could be your problem b/c you might be asking it to do something before its loaded on the form so make that change.

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