|
-
Jun 4th, 2000, 02:15 PM
#1
Thread Starter
Junior Member
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!
-
Jun 4th, 2000, 03:22 PM
#2
Frenzied Member
swap the line
Text1.Text = lngCounter & Chr$(13) & Chr$(10)
for
Text1.Text = Text1.Text & lngCounter & Chr$(13) & Chr$(10)
-
Jun 4th, 2000, 05:17 PM
#3
PowerPoster
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]
-
Jun 5th, 2000, 05:35 AM
#4
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|