Private Sub Command1_Click()
Dim i As Integer, j As Integer
For i = 1 To 10000
For j = 1 To 10000
Print "SDFGH========="; j
Next j
Next i

End Sub

when i click on command1, i want to view the enitre execution of loop,i.e, from

SDGGH=============1
                      SDFGH=============2
                      .
                      .
            till.......SDFGH============10000

in separate lines but form is too small and it displays only till ...
SDFGH=============42
please help...

Recommended Answers

All 2 Replies

something like...

If j Mod 42 = 0 Then Me.cls
Print ...

This will clear the form of the printing you have done to it and reset the currentx and currenty properties to 0. Look it up in help to make sure you use it right if you are manipulating the forms autoredraw property.

Good Luck

You can also try and the loop to a list box -

Private Sub Command1_Click()Dim i As Integer, j As Integer
For i = 1 To 10000
For j = 1 To 10000
Print "SDFGH=========";j
List1.AddItem j   'Or the like
Next j
Next i 
End Sub

If this is not working for you and you want to print to your form, use a scrollable form. I have add a attachment with code on how to create such a form.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.