PDA

Click to See Complete Forum and Search --> : record sets


Millie
Jan 28th, 2000, 12:18 AM
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

netSurfer
Jan 28th, 2000, 12:20 AM
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.

Millie
Jan 28th, 2000, 03:18 AM
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

netSurfer
Jan 28th, 2000, 03:26 AM
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.

Jan 28th, 2000, 03:35 AM
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.