Results 1 to 5 of 5

Thread: Exitting a loop

  1. #1
    Join Date
    Jan 2004
    Location
    South Africa
    Posts
    178

    Question Unanswered: Exitting a loop

    I have a while loop
    eg.
    While ...
    ..
    ..
    ..
    Wend

    what is the command to exit the loop before it reaches the end?

    thanks in advance
    ActionAnt

  2. #2
    Join Date
    Sep 2003
    Location
    MI
    Posts
    3,713
    It's not available with the While ... Wend. You have to goto the Do While ... Loop and then you can use the Exit Loop ...
    Back to Access ... ADO is not the way to go for speed ...

  3. #3
    Join Date
    Jan 2004
    Location
    South Africa
    Posts
    178
    i've been using
    while
    ..
    if then
    END
    else
    end if
    ..
    wend

    this seems to be working. is there anything I'm missing?

  4. #4
    Join Date
    Sep 2003
    Location
    MI
    Posts
    3,713
    Quote Originally Posted by actionant
    i've been using
    while
    ..
    if then
    END
    else
    end if
    ..
    wend

    this seems to be working. is there anything I'm missing?
    Well that will work ... Or you can even use the GoTo {label} construct ... As I said, Exit is not available under While ... Wend
    Back to Access ... ADO is not the way to go for speed ...

  5. #5
    Join Date
    Feb 2005
    Location
    The Hague, Netherlands
    Posts
    95
    Quote Originally Posted by actionant
    i've been using
    while
    ..
    if then
    END
    else
    end if
    ..
    wend

    this seems to be working. is there anything I'm missing?
    Thats not actual 'exiting' of a loop but giving options for different cases.. Exiting would mean you have a loop that goes on until some (external) event occurs..

    For all kinds of loops, check out http://www.functionx.com/vbaccess/Lesson08.htm

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •