If a Loop is very long (lasts more than 10 seconds or so) the program just stops responding and I have to use ctrl-alt-delete. Also, while the Loop is running, I can't use my computer until it either finishes or until it stops responding. How do I get my program to not work so hard?
If the Loop condition is 'Until (lASDF = 1000000)' it will take about nine seconds to finish. Looping a million times isn't enough to freeze the program, but during the time it takes I can't do anything on my computer. Not even view my desktop.VB Code:
Dim lASDF As Long Private Sub Form_Load() End Sub Private Sub cmndStart_Click() lASDF = 0 Do lASDF = lASDF + 1 lblCount.Caption = lASDF Loop Until (1 = 2) End Sub




Reply With Quote