S
Sash
I tried to format this so it would be easier to look at. I'm trying to do a
nested loop. This program is 7 pages, so I took the middle section out as
you will see below. I can't see why I'm getting the aforementioned error
message.
Do While Not rs.EOF 'First Loop for initial RS
With rs4
If Not rs4.BOF And Not rs4.EOF Then
rs4.MoveFirst
Do While Not rs4.EOF ' Second Loop for RS4
If rs4.Fields("DEBT_NO") <> DebtNo Then
HD = "HD" & Chr(9) & rs.Fields("DEBTOR_ID") & Chr(9) &
rs4.Fields("CLT_ID")
HD = HD & Chr(9) & rs4.Fields("CLT_REF_NO") & Chr(9)
HD = HD & rs4.Fields("CLT_REF_NO") & Chr(9) & Chr(9) & Chr(9)
Print #1, HD
DebtNo = rs4.Fields("DEBT_NO")
------------------lots of other code-----------------------------
rs.MoveNext '1st loop
Loop
rs4.MoveNext
End If
Loop '2nd loop
rs4.Close
End If
End With
nested loop. This program is 7 pages, so I took the middle section out as
you will see below. I can't see why I'm getting the aforementioned error
message.
Do While Not rs.EOF 'First Loop for initial RS
With rs4
If Not rs4.BOF And Not rs4.EOF Then
rs4.MoveFirst
Do While Not rs4.EOF ' Second Loop for RS4
If rs4.Fields("DEBT_NO") <> DebtNo Then
HD = "HD" & Chr(9) & rs.Fields("DEBTOR_ID") & Chr(9) &
rs4.Fields("CLT_ID")
HD = HD & Chr(9) & rs4.Fields("CLT_REF_NO") & Chr(9)
HD = HD & rs4.Fields("CLT_REF_NO") & Chr(9) & Chr(9) & Chr(9)
Print #1, HD
DebtNo = rs4.Fields("DEBT_NO")
------------------lots of other code-----------------------------
rs.MoveNext '1st loop
Loop
rs4.MoveNext
End If
Loop '2nd loop
rs4.Close
End If
End With