How to quit a loop

darkmastergyz

Registered User.
Local time
Today, 07:00
Joined
May 7, 2006
Messages
85
Hi! This is the loop I have:

Code:
Do While Not fcrs.EOF
If file_test <> fcrs![File] Then
          fcrs.MoveNext
          MsgBox (fcrs![ID])
Else
          'How do I quit the loop here?
End If
Loop

How can I quit the loop if the else criteria is met? Thanks!!!
 
Does this work?
Code:
If Not fcrs.EOF then
  Loop
[COLOR="Green"]    'If this line moves you to fcrs.eof...[/COLOR]
    fcrs.MoveNext
[COLOR="Green"]    '...won't this line cause an error.  Should these be reversed?[/COLOR]
    MsgBox fcrs!ID
  Until file_test = fcrs!File or fcrs.eof
End if
 
Exit Do
Will also work
 

Users who are viewing this thread

Back
Top Bottom