D
Dale
HI all, could someone point out how to get rid of the "no current record"
error in this code. What I'm doing is copying a block of records from
"testpatients" into table "All_Forms_Test" so that the block of 10 records
in "testpatients" is repeated for every 10 rows in table "All_Forms_Test"
(1550 records). I can populate the table the way I want, I just can't
figure how to stop the no current record message...tried all manner of
things...thanks again.
Sub FillTestOrders()
Dim count As Long
Dim db As Database
Dim rstPatients As Recordset
Dim rstOrders As Recordset
Set db = CurrentDb
Set rstPatients = db.OpenRecordset("Select * from tblTestPatients where id
between 45 and 70")
Set rstOrders = db.OpenRecordset("All_Forms_Test")
rstPatients.MoveFirst
rstOrders.MoveFirst
Do Until rstOrders.EOF <--- also tried EOF-1, Do Until Not EOF....
Do Until rstPatients.EOF
With rstOrders
.Edit
!Tpatient = rstPatients!TestPatient
.Update
.MoveNext
End With
rstPatients.MoveNext
Loop
rstPatients.MoveFirst
Loop
Set rstPatients = Nothing
Set rstOrders = Nothing
End Sub
error in this code. What I'm doing is copying a block of records from
"testpatients" into table "All_Forms_Test" so that the block of 10 records
in "testpatients" is repeated for every 10 rows in table "All_Forms_Test"
(1550 records). I can populate the table the way I want, I just can't
figure how to stop the no current record message...tried all manner of
things...thanks again.
Sub FillTestOrders()
Dim count As Long
Dim db As Database
Dim rstPatients As Recordset
Dim rstOrders As Recordset
Set db = CurrentDb
Set rstPatients = db.OpenRecordset("Select * from tblTestPatients where id
between 45 and 70")
Set rstOrders = db.OpenRecordset("All_Forms_Test")
rstPatients.MoveFirst
rstOrders.MoveFirst
Do Until rstOrders.EOF <--- also tried EOF-1, Do Until Not EOF....
Do Until rstPatients.EOF
With rstOrders
.Edit
!Tpatient = rstPatients!TestPatient
.Update
.MoveNext
End With
rstPatients.MoveNext
Loop
rstPatients.MoveFirst
Loop
Set rstPatients = Nothing
Set rstOrders = Nothing
End Sub