LOOP
Alguém consegue ver erro neste código :
Private Sub Command1_Click()
Dim control As Long
On Error Resume Next
control = Text1.Text
Form1.BackColor = vbWhite
Do While control <> 0
control = Text1.Text
Label2.Caption = _
[Ô]Current variable calcule: [Ô] & control
If Form1.BackColor = vbWhite Then
Form1.BackColor = vbRed
Else
Form1.BackColor = vbWhite
End If
DoEvents
Loop
MsgBox [Ô]Looping complete[Ô]
End Sub
Private Sub form_Load()
Label1.Caption = [Ô]Loop-control variable value:[Ô]
Label2.Caption = [Ô]current variable value: [Ô]
Text1.Text = [Ô]5[Ô]
Command1.Caption = [Ô]Start Loop[Ô]
End Sub
Private Sub Command1_Click()
Dim control As Long
On Error Resume Next
control = Text1.Text
Form1.BackColor = vbWhite
Do While control <> 0
control = Text1.Text
Label2.Caption = _
[Ô]Current variable calcule: [Ô] & control
If Form1.BackColor = vbWhite Then
Form1.BackColor = vbRed
Else
Form1.BackColor = vbWhite
End If
DoEvents
Loop
MsgBox [Ô]Looping complete[Ô]
End Sub
Private Sub form_Load()
Label1.Caption = [Ô]Loop-control variable value:[Ô]
Label2.Caption = [Ô]current variable value: [Ô]
Text1.Text = [Ô]5[Ô]
Command1.Caption = [Ô]Start Loop[Ô]
End Sub
Amigo segue abaixo
Private Sub Command1_Click()
Dim control As Long
On Error Resume Next
control = Text1.Text
Form1.BackColor = vbWhite
Do While control <> 0
[ô]control = Text1.Text --------------- se toda vez vc colocar o control = ao text sempre ira começar de novo comente esta linha
Label2.Caption = _
[Ô]Current variable calcule: [Ô] & control
If Form1.BackColor = vbWhite Then
Form1.BackColor = vbRed
Else
Form1.BackColor = vbWhite
control = control - 1 --------------------------------- aqui você subtrai o control para controlar o LOOP -
End If
DoEvents
Loop
MsgBox [Ô]Looping complete[Ô]
End Sub
Tópico encerrado , respostas não são mais permitidas