J
Julia Boswell
Hi all
I've got a strange problem with a simple piece of code:
Dim db As ADODB.Connection
Dim rsQuery As New ADODB.Recordset
Set db = CurrentProject.Connection
Dim PN As String
Dim App As String
rsQuery.Open "LoopQuerywithPNsandApps", db, adOpenKeyset, adLockOptimistic,
adCmdTableDirect
rsQuery.MoveFirst
While Not rsQuery.EOF
PN = rsQuery!Query
PN = Left(PN, 12)
rsQuery.Fields("TopLevelPN").Value = PN
App = rsQuery!Query
App = Right(App, 5)
rsQuery.Fields("AppliqueSN").Value = App
rsQuery.Update
rsQuery.MoveNext
Wend
The code is falling over at the rsQuery.MoveFirst - I get error 3021 either
EOF or BOF is true or the current record has been deleted. None of those
statements are true, I've run the query and it works fine. It is populated
with 1227 records and the first record is fully complete.
Any ideas?
Thanks
Julia
I've got a strange problem with a simple piece of code:
Dim db As ADODB.Connection
Dim rsQuery As New ADODB.Recordset
Set db = CurrentProject.Connection
Dim PN As String
Dim App As String
rsQuery.Open "LoopQuerywithPNsandApps", db, adOpenKeyset, adLockOptimistic,
adCmdTableDirect
rsQuery.MoveFirst
While Not rsQuery.EOF
PN = rsQuery!Query
PN = Left(PN, 12)
rsQuery.Fields("TopLevelPN").Value = PN
App = rsQuery!Query
App = Right(App, 5)
rsQuery.Fields("AppliqueSN").Value = App
rsQuery.Update
rsQuery.MoveNext
Wend
The code is falling over at the rsQuery.MoveFirst - I get error 3021 either
EOF or BOF is true or the current record has been deleted. None of those
statements are true, I've run the query and it works fine. It is populated
with 1227 records and the first record is fully complete.
Any ideas?
Thanks
Julia