Results 1 to 8 of 8

Thread: [RESOLVED] Stop the cycle FOR for input

  1. #1

    Thread Starter
    Addicted Member alexia_net's Avatar
    Join Date
    Jun 2006
    Posts
    216

    Resolved [RESOLVED] Stop the cycle FOR for input

    Hi. How could I stop a cycle FOR for input. For example:
    FOR x=1 to 100
    do something
    stop for input some value into a textbox (a window will appear lets say and the user must insert some value)
    resume (the user will click a button to resume the cycle FOR)
    NEXT

    Thank you very much.

  2. #2

  3. #3

    Thread Starter
    Addicted Member alexia_net's Avatar
    Join Date
    Jun 2006
    Posts
    216

    Re: Stop the cycle FOR for input

    I do not want to leave the FOR cycle
    During its execution I want the user to input some values. A small window will appear and the user will have to input a value to the program. So
    FOR x=1 to 100
    the user will have to give value to the program for 100 times
    NEXT

  4. #4
    Fanatic Member
    Join Date
    Jul 2007
    Location
    Essex, UK.
    Posts
    579

    Re: Stop the cycle FOR for input

    An input box will halt execution of the loop;

    Code:
    Dim X, A$
        For X = 1 To 5
            A$ = InputBox("Prompt for the information required")
            'Do something with the info
        Next X

  5. #5

  6. #6
    PowerPoster Ellis Dee's Avatar
    Join Date
    Mar 2007
    Location
    New England
    Posts
    3,530

    Re: Stop the cycle FOR for input

    If you need more flexibility than an inputbox gives you, you can open any form modally:

    frmSomeForm.Show vbModal, Me

    This will suspend execution until the modal form closes.

  7. #7

  8. #8

    Thread Starter
    Addicted Member alexia_net's Avatar
    Join Date
    Jun 2006
    Posts
    216

    Re: Stop the cycle FOR for input

    Thank you all for your help. It is working fine now. Maybe the name of this thread was a little confusing. Sorry. Thanks again!

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