Problem with do..loop

  • Thread starter Thread starter graeme34 via AccessMonster.com
  • Start date Start date
G

graeme34 via AccessMonster.com

I have a do.....loop within my code which works fine as long as the loop
terminates within the recordset. It doenst seem to stop at the EOF condition.
I know its a problem with my coding could any body tell me what it is:

Do While rsOrdLine!SalesOrderNumber = lngOrderNum _
Or rsOrdLine.EOF = True
With rsOrdLine
.Edit
!SalesOrderLineStatus = "Despatch Note Printed"
.Update
.MoveNext
End With
Loop
 
Its ok now, I have taken the Or rsOrdLine.EOF = True
out of the do while condition and placed
IF rsOrdLine.EOF = True Go To OutofLoop
Where OutofLoop is a Line label.
 
I probably would use while rsOrdLine.EOF=False with an AND conjunction

Do While rsOrdLine!SalesOrderNumber = lngOrderNum _
AND rsOrdLine.EOF = False
 
Back
Top