Compile difficulties (do while loop)
I have put this code in one of my modules. Function is to delete any records where a field value is 0.
Every time I try to debug or compile it I get the message "loop without do". I cannot make sense of it since it seems OK to me
-------------
With rst
.MoveFirst
Do While Not rst.EOF
If .Fields("dblSupQty") = 0 Then
.Delete
.MoveNext
Loop
End With
-------------
I have set up cnn and rst properly in ADO earlier in the module.
Any ideas most welcomed!
Thanks
Malcy
I have put this code in one of my modules. Function is to delete any records where a field value is 0.
Every time I try to debug or compile it I get the message "loop without do". I cannot make sense of it since it seems OK to me
-------------
With rst
.MoveFirst
Do While Not rst.EOF
If .Fields("dblSupQty") = 0 Then
.Delete
.MoveNext
Loop
End With
-------------
I have set up cnn and rst properly in ADO earlier in the module.
Any ideas most welcomed!
Thanks
Malcy