recordset error 3021

adaniele

Registered User.
Local time
Tomorrow, 02:35
Joined
Jul 18, 2005
Messages
176
hi guys, i hope somebody can hlp me with this.....thx in advance, max.

I am trying to compare to tables (pop and tempwinestatus). The idea is look for the same ponumber in both tables. If there is a match, ask for the qty value in table tempwinestatus, and if qty is 0, then modify ifsstatus and ranking in table pop.
This process works ok, but when access find the eof for the tempwinestatus table, the following error appears:

"run-time error 3021"

Any clue?

Also, i pasted the code used in the form.


Code:
   Dim rsttemp As Recordset
   Dim rstpop As Recordset
   
   Set dbsname = CurrentDb
   

    ' transfer data from xls to a temp table
    DoCmd.SetWarnings False
    DoCmd.TransferSpreadsheet acImport, 8, "TempWineStatus", "S:\qf_space\wine\melani.xls", True, B2
    
    Set rstpop = dbsname.OpenRecordset("pop", dbOpenTable)
    Set rsttemp = dbsname.OpenRecordset("TempWineStatus", dbOpenTable)
    rstpop.MoveFirst
    rsttemp.MoveFirst
    Do
        Do
            If rstpop!ponumber = rsttemp!ponumber Then
                If rsttemp!qty = 0 Then
                    rstpop.Edit
                    rstpop![ifsstatus] = "Completed"
                    rstpop![ranking] = 1000
                    rstpop.Update
                End If
            End If
            rstpop.MoveNext
        Loop Until rstpop.EOF = True
        rsttemp.MoveNext
    Loop Until rsttemp.EOF = True
    rstpop.Close
    rsttemp.Close
    dbsname.Close
 
Maybe you should replace

Loop Until rstpop.EOF = True

With

Loop while rstpop.EOF = false
 
KenHigg said:
Maybe you should replace

Loop Until rstpop.EOF = True

With

Loop while rstpop.EOF = false

kenhigg, thx 4 your clue. i made the change in the second loop (not in the first one) and it worked.

thx again, Max.
 

Users who are viewing this thread

Back
Top Bottom