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.
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