Results 1 to 5 of 5

Thread: How to stop a DO .. WHILE loop

  1. #1

    Thread Starter
    New Member
    Join Date
    Oct 2003
    Posts
    5

    How to stop a DO .. WHILE loop

    I have created a form in access and when it is loaded it automatically starts looking in a directory for a file. once the file is found it is moved and renamed and then begins checking in the original directory for that same file (the file is automatically generated from another system).

    The form will be runnin all day but there will be times during the day where i may need to stop the form from doing what it doing in the background.

    I have created a button and added debug.print "button has been pressed".

    However it does not recognise when the button is pressed because it is to busy doing what it is doing.

    How can i manually stop the looping process?

  2. #2
    Member
    Join Date
    May 2003
    Posts
    59
    Try placing a DoEvents command in your loop;

    VB Code:
    1. Do While Power
    2.     DoEvents
    3.     ...
    4. Loop

  3. #3
    Frenzied Member andreys's Avatar
    Join Date
    Sep 2002
    Location
    Los Angeles
    Posts
    1,615
    VB Code:
    1. Do While Something
    2.     Exit Do
    3. Loop
    Visit my PROJECTS @ www.asprojects.com

  4. #4
    Frenzied Member Spajeoly's Avatar
    Join Date
    Mar 2003
    Location
    Utah
    Posts
    1,068
    Not
    VB Code:
    1. Exit WHile
    ?

  5. #5
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 2002
    Location
    Bristol, UK
    Posts
    41,974
    nope - its a 'do' loop, 'while' or 'until' just specify the conditions for it to continue

Posting Permissions

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



Click Here to Expand Forum to Full Width