Results 1 to 4 of 4

Thread: textbox question-please read

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Apr 2000
    Posts
    29
    I'm having a problem...i'm making a program for a friend of mine that is supposed to list all 7-digit numbers from 1000000 to 9999999, but i have it to where the user puts i nthe first number of the seven digit number they want to start with, ex. 6 would start at 600000...anyways, i'm using a loop, but the probelm is, it doesn't display them as it goes, it just puts the final value of the counter variable there...i've gotten it to work with a listbox to a certain extent, but it can't handle that many numbers evidently, so i'm back to using the textbox, anyways, here's my code:

    Dim lngCounter As Long
    Private Sub Command1_Click()
    num = Val(Form2.Text1.Text)
    Select Case num
    Case 1
    lngCounter = 1000000
    Do Until lngCounter = 1999999
    lngCounter = lngCounter + 1
    Text1.Text = lngCounter & Chr$(13) & Chr$(10)
    Loop
    End Select
    End Sub

    i'll have to add the cases for 2-9 later, but i'm not gonna worry about that until i can get 1 to work.
    Thans for any help!

  2. #2
    Frenzied Member Mark Sreeves's Avatar
    Join Date
    Nov 1999
    Location
    UK
    Posts
    1,845
    swap the line

    Text1.Text = lngCounter & Chr$(13) & Chr$(10)

    for

    Text1.Text = Text1.Text & lngCounter & Chr$(13) & Chr$(10)


    Mark
    -------------------

  3. #3
    PowerPoster Chris's Avatar
    Join Date
    Jan 1999
    Location
    K-PAX
    Posts
    3,238

    Lightbulb DoEvents

    Just a one more line -> DoEvents

    [code]
    Private Sub Command1_Click()
    Dim lngCounter As Long
    num = Val(Form2.Text1.Text)
    Select Case num
    Case 1
    lngCounter = 1000000
    Do Until lngCounter = 1999999
    lngCounter = lngCounter + 1
    DoEvents
    Text1.Text = lngCounter & Chr$(13) & Chr$(10)
    Loop
    End Select
    End Sub
    [code]

  4. #4
    Guest
    I could be other programs that are using up resources. Did you have any other programs on at the time?

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