Ajuda Urgente

willie22

I'm cool cuz I Fold
Código:
Private Function testa_euromilhoes()
        Dim i, j As Integer
        Dim verificar_numeros As String
        Dim verificar_estrelas As String
        Dim teste_estrelas As String
        If opt_euromilhoes = Checked Then
        For i = 0 To 4
            teste_numeros = InputBox("Insira o número", "Verificação")
            If i < 4 Then
                verificar_numeros = verificar_numeros + teste_numeros + "-"
            Else
                verificar_numeros = verificar_numeros + teste_numeros
            End If
        Next
        For j = 0 To 1
            teste_estrelas = InputBox("Insira a estrela", "Verificação")
            If j < 1 Then
               verificar_estrelas = verificar_estrelas + teste_estrelas + "-"
            Else
               verificar_estrelas = verificar_estrelas + teste_estrelas
            End If
        Next
        verificar_numeros = " "
        If (verificar_numeros = txt_euromilhoes_numeros1.Text And verificar_estrelas = txt_euromilhoes_estrelas1.Text) Or (verificar_numeros = txt_euromilhoes_numeros2.Text And verificar_estrelas = txt_euromilhoes_estrelas2.Text) Or (verificar_numeros = txt_euromilhoes_numeros3.Text And verificar_estrelas = txt_euromilhoes_estrelas3.Text) Or (verificar_numeros = txt_euromilhoes_numeros4.Text And verificar_estrelas = txt_euromilhoes_estrelas4.Text) Or (verificar_numeros = txt_euromilhoes_numeros5.Text And verificar_estrelas = txt_euromilhoes_estrelas5.Text) Then
            box = MsgBox("Parabéns, acertaste na chave!!", vbOKOnly, "Verificação")
        Else
            box = MsgBox("Fica para a próxima :(", vbOKOnly, "Verificação")
        End If
    End If
    
End Function

Private Function testa_totoloto()
        Dim i, j As Integer
        Dim verificar_numeros As String
        Dim teste_numeros As String
        Dim teste_estrelas As String
        If opt_totoloto = Checked Then
        For i = 0 To 5
            teste_numeros = InputBox("Insira o número", "Verificação")
            If i < 5 Then
               verificar_numeros = verificar_numeros + teste_numeros + "-"
            Else
               verificar_numeros = verificar_numeros + teste_numeros
            End If
        Next
        If (verificar_numeros = txt_totoloto1.Text Or verificar_numeros = txt_totoloto2.Text Or verificar_numeros = txt_totoloto3.Text Or verificar_numeros = txt_totoloto4.Text Or verificar_numeros = txt_totoloto5.Text Or verificar_numeros = txt_totoloto6.Text) Then
            box = MsgBox("Parabéns, acertaste na chave!!", vbOKOnly, "Verificação")
        Else
            box = MsgBox("Fica para a próxima :(", vbOKOnly, "Verificação")
        End If
    End If
        
End Function
Fiz estas duas funções para verificar chaves do Euromilhões...Isoladas funcionam as duas...Quando correm em paralelo a primeira dá sempre a seguinte mensagem: box = MsgBox("Fica para a próxima :(", vbOKOnly, "Verificação") .O problema é que isto acontece mesmo quando as chaves são iguais, e quando são iguais a mensagem a ser mostrada é esta: box = MsgBox("Parabéns, acertaste na chave!!", vbOKOnly, "Verificação") ...Alguém me pode ajudar a resolver este problema?O trabalho é para entregar na Quarta-feira por isso estou mesmo atrapalhado... :lol: Agradeço toda a ajuda que me possam dar :)
 
Última edição:
Back
Topo