Visual Basic - Error 424 Command 1

Life is soft - evento anual de software empresarial
   
Vista:

Error 424 Command 1

Publicado por Angélica (1 intervención) el 28/04/2012 06:24:46
TENGO PROBLEMAS CON EL ERROR 424 AL MOMENTO DE EJECUTARSE EL COMMAND 1 EN MI PROGRAMA, ES UN PROGRAMA QUE CALCULA AL AZAR NUMEROS DE LA LOTERIA ME PUEDEN AYUDAR? POR SU ATENCION GRACIAS
Dim X1 As Integer, X2 As Integer, X3 As Integer, x4 As Integer, x5 As Integer

Private Sub cmdCalcula_Click()

X1 = (99 - 1) * Rnd + 1
X2 = (99 - 1) * Rnd + 1
While (X2 = X1)
X2 = (99 - 1) * Rnd + 1
Wend
X3 = (99 - 1) * Rnd + 1
While (X3 = X2) Or (X3 = X1)
X3 = (99 - 1) * Rnd + 1
Wend
x4 = (99 - 1) * Rnd + 1
While (x4 = X3) Or (x4 = X2) Or (x4 = X1)
x4 = (99 - 1) * Rnd + 1
Wend
x5 = (99 - 1) * Rnd + 1
While (x5 = x4) Or (x5 = X3) Or (x5 = X2) Or (x5 = X1)
x5 = (99 - 1) * Rnd + 1
Wend


End Sub

Private Sub cmdImprime_Click()

lbl1.Caption = X1 & " " & X2 & " " & X3 & " " & x4 & " " & x5
End Sub


Private Sub Command1_Click()
Menu.Show
Menu.Text2 = ""
Form1.Hide

End Sub
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder

Error 424 Command 1

Publicado por jcmg (518 intervenciones) el 05/05/2012 06:20:55
Hola Angelica
Te falto un wend

Dim X1 As Integer, X2 As Integer, X3 As Integer, x4 As Integer, x5 As Integer

Private Sub cmdCalcula_Click()
X1 = (99 - 1) * Rnd + 1
X2 = (99 - 1) * Rnd + 1
While (X2 = X1)
X2 = (99 - 1) * Rnd + 1
Wend
X3 = (99 - 1) * Rnd + 1
While (X3 = X2) Or (X3 = X1)
X3 = (99 - 1) * Rnd + 1
Wend
x4 = (99 - 1) * Rnd + 1
While (x4 = X3) Or (x4 = X2) Or (x4 = X1)
x4 = (99 - 1) * Rnd + 1
Wend
x5 = (99 - 1) * Rnd + 1
While (x5 = x4) Or (x5 = X3) Or (x5 = X2) Or (x5 = X1)
x5 = (99 - 1) * Rnd + 1
Wend ' este te falto
End Sub

Private Sub cmdImprime_Click()

lbl1.Caption = X1 & " " & X2 & " " & X3 & " " & x4 & " " & x5
End Sub

Private Sub Command1_Click()
menu.Show
menu.Text2 = ""
Form1.Hide
End Sub
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar