+ Reply to Thread
Results 1 to 3 of 3

Button using Form, Iteration and Input values

  1. #1
    coco
    Guest

    Button using Form, Iteration and Input values

    Hello everybody
    I have a simple question about Buttons in a Form doing a loop; my question
    is how can I implement or what this program needs because I know a little
    bit of excel progamming.

    I want to run this Form(that has 3 buttons, Start,Next,Close), after
    entering values in the following TextBoxes:TxtQty and TxtValue, and pressing
    "Start", the program will let me input VALUES for Txtvalue, after pressing
    "Next" (TxtQty-1) times. After finishing the iteration will show me the
    TxtResults in another TextBox.

    Thanks for your advice.

    Coco

    Private Sub BtnStart_Click()
    Dim x As Integer
    x = 0
    If TxtQty.Text > 0 Then
    For i = 1 To TxtQty.Text
    TxtResult.Text = TxtResult.Text + TxtValue.Text

    *** what function has to be added to pause the loop and wait for the next
    TxtValue ***

    Next
    End If
    End Sub

  2. #2
    Gary Keramidas
    Guest

    Re: Button using Form, Iteration and Input values

    i changed it a little to get it to work, but hopefully it will help you out

    Private Sub BtnStart_Click()
    Dim txtqty As Integer
    Dim x As Integer
    txtqty = 10
    x = 0
    If txtqty > 0 Then
    For i = 1 To txtqty
    MsgBox txtqty

    txtqty = txtqty - 1
    Next
    End If
    End Sub

    --


    Gary


    "coco" <[email protected]> wrote in message
    news:[email protected]...
    > Hello everybody
    > I have a simple question about Buttons in a Form doing a loop; my question
    > is how can I implement or what this program needs because I know a little
    > bit of excel progamming.
    >
    > I want to run this Form(that has 3 buttons, Start,Next,Close), after
    > entering values in the following TextBoxes:TxtQty and TxtValue, and
    > pressing
    > "Start", the program will let me input VALUES for Txtvalue, after
    > pressing
    > "Next" (TxtQty-1) times. After finishing the iteration will show me the
    > TxtResults in another TextBox.
    >
    > Thanks for your advice.
    >
    > Coco
    >
    > Private Sub BtnStart_Click()
    > Dim x As Integer
    > x = 0
    > If TxtQty.Text > 0 Then
    > For i = 1 To TxtQty.Text
    > TxtResult.Text = TxtResult.Text + TxtValue.Text
    >
    > *** what function has to be added to pause the loop and wait for the next
    > TxtValue ***
    >
    > Next
    > End If
    > End Sub




  3. #3
    coco
    Guest

    Re: Button using Form, Iteration and Input values

    Gary,
    Is "MsgBox" a command that pops up another default form?
    because, What I would like to do is to use the "same Form" that is already
    running
    and it has all the input TextBoxes.
    Thanks for your comments
    coco
    ps. could you suggest me a link that let me practice with different ways to
    interact dynamically: Buttons, TextBoxes and 1 single "form"?. Thanks.


    "Gary Keramidas" wrote:

    > i changed it a little to get it to work, but hopefully it will help you out
    >
    > Private Sub BtnStart_Click()
    > Dim txtqty As Integer
    > Dim x As Integer
    > txtqty = 10
    > x = 0
    > If txtqty > 0 Then
    > For i = 1 To txtqty
    > MsgBox txtqty
    >
    > txtqty = txtqty - 1
    > Next
    > End If
    > End Sub
    >
    > --
    >
    >
    > Gary
    >
    >
    > "coco" <[email protected]> wrote in message
    > news:[email protected]...
    > > Hello everybody
    > > I have a simple question about Buttons in a Form doing a loop; my question
    > > is how can I implement or what this program needs because I know a little
    > > bit of excel progamming.
    > >
    > > I want to run this Form(that has 3 buttons, Start,Next,Close), after
    > > entering values in the following TextBoxes:TxtQty and TxtValue, and
    > > pressing
    > > "Start", the program will let me input VALUES for Txtvalue, after
    > > pressing
    > > "Next" (TxtQty-1) times. After finishing the iteration will show me the
    > > TxtResults in another TextBox.
    > >
    > > Thanks for your advice.
    > >
    > > Coco
    > >
    > > Private Sub BtnStart_Click()
    > > Dim x As Integer
    > > x = 0
    > > If TxtQty.Text > 0 Then
    > > For i = 1 To TxtQty.Text
    > > TxtResult.Text = TxtResult.Text + TxtValue.Text
    > >
    > > *** what function has to be added to pause the loop and wait for the next
    > > TxtValue ***
    > >
    > > Next
    > > End If
    > > End Sub

    >
    >
    >


+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1