Quantcast
Channel: VBForums - Visual Basic 6 and Earlier
Viewing all articles
Browse latest Browse all 21090

[RESOLVED] calling a timer in a loop

$
0
0
how can i correct this code to run 12 times
The timer is only called in the first run and never gets called again.

Code:

Option Explicit
 Dim mlAmount As Long
 Dim iCnt As Long
 Dim miCounter As Integer



Sub Start()
    Dim i As Integer
    For i = 1 To 12
      iCnt = 1
    mlAmount = 10
    DoEvents
    Timer1.Interval = 60
    Timer1.Enabled = True
    Next
End Sub

Private Sub Timer1_Timer()
If iCnt <= mlAmount Then
    lblWinThisRun.Caption = iCnt
    lblCredit = Val(lblCredit) + 1
    iCnt = iCnt + 1
Else
    iCnt = 1
    Timer1.Enabled = False
    mWinInProgress = False
  miCounter = miCounter + 1
Debug.Print miCounter
 
End If
End Sub


Viewing all articles
Browse latest Browse all 21090

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>