Error loop sin do, visual basic 6

Tengo un problema con una parte del codigo del un formulario, que hace que me de error en el loop, dice que no tiene do, aun cuanto si lo tiene, si elimino el loop me da un error en el end while, tambien que no tiene el while, si elimino este lo da en el end if, y por utimo termina diciendo que no exise codigo en el formulario. Y no hay end sub
este es parte del codigo, gracias si me puede ayudar.
With Adodc5
    cont = 0
    .Recordset.MoveFirst
    Do While Not .Recordset.EOF
        If UCase(Trim(.Recordset("ced_alum"))) = UCase(Trim(Text1(16).Text)) Then
            If UCase(Trim(Adodc1.Recordset("curso"))) = "7MO GRADO" Or _
            UCase(Trim(Adodc1.Recordset("curso"))) = "8VO GRADO" Then
                If .Recordset("resp1") = "0" Then
                    cont = cont + 1
                End If
                If .Recordset("resp2") = "8" Then
                    cont = cont + 1
                End If
                If .Recordset("resp3") = "11" Then
                    cont = cont + 1
                End If
                If .Recordset("resp4") = "15" Then
                    cont = cont + 1
                End If
                If .Recordset("resp5") = "22" Then
                    cont = cont + 1
                End If
                If .Recordset("resp6") = "29" Then
                    cont = cont + 1
                End If
                If .Recordset("resp7") = "31" Then
                    cont = cont + 1
                End If
                If .Recordset("resp8") = "37" Then
                    cont = cont + 1
                End If
                If .Recordset("resp9") = "41" Then
                    cont = cont + 1
                End If
                If .Recordset("resp10") = "49" Then
                    cont = cont + 1
                End If
                If .Recordset("resp11") = "53" Then
                    cont = cont + 1
                End If
                If .Recordset("resp12") = "57" Then
                    cont = cont + 1
                End If
                If .Recordset("resp13") = "61" Then
                    cont = cont + 1
                End If
                If .Recordset("resp14") = "68" Then
                    cont = cont + 1
                End If
                If .Recordset("resp15") = "70" Then
                    cont = cont + 1
                End If
                If .Recordset("resp16") = "78" Then
                    cont = cont + 1
                End If
                If .Recordset("resp17") = "82" Then
                    cont = cont + 1
                End If
                If...

1 Respuesta

Respuesta
1
Perdon poer la tardanza intenta con el codigo asi como te lo pongo el problema segun lo aprecio es solo un end if que te faltaba y por Jerarquia ewl compilador se fue primero a que no encontro un cierre para el ciclo cuando tenia el problema en una condicional
With Adodc5
    cont = 0
    .Recordset.MoveFirst
    Do While Not .Recordset.EOF
        If UCase(Trim(.Recordset("ced_alum"))) = UCase(Trim(Text1(16).Text)) Then
            If UCase(Trim(Adodc1.Recordset("curso"))) = "7MO GRADO" Or _
            UCase(Trim(Adodc1.Recordset("curso"))) = "8VO GRADO" Then
                If .Recordset("resp1") = "0" Then
                    cont = cont + 1
                End If
                If .Recordset("resp2") = "8" Then
                    cont = cont + 1
                End If
                If .Recordset("resp3") = "11" Then
                    cont = cont + 1
                End If
                If .Recordset("resp4") = "15" Then
                    cont = cont + 1
                End If
                If .Recordset("resp5") = "22" Then
                    cont = cont + 1
                End If
                If .Recordset("resp6") = "29" Then
                    cont = cont + 1
                End If
                If .Recordset("resp7") = "31" Then
                    cont = cont + 1
                End If
                If .Recordset("resp8") = "37" Then
                    cont = cont + 1
                End If
                If .Recordset("resp9") = "41" Then
                    cont = cont + 1
                End If
                If .Recordset("resp10") = "49" Then
                    cont = cont + 1
                End If
                If .Recordset("resp11") = "53" Then
                    cont = cont + 1
                End If
                If .Recordset("resp12") = "57" Then
                    cont = cont + 1
                End If
                If .Recordset("resp13") = "61" Then
                    cont = cont + 1
                End If
                If .Recordset("resp14") = "68" Then
                    cont = cont + 1
                End If
                If .Recordset("resp15") = "70" Then
                    cont = cont + 1
                End If
                If .Recordset("resp16") = "78" Then
                    cont = cont + 1
                End If
                If .Recordset("resp17") = "82" Then
                    cont = cont + 1
                End If
                If .Recordset("resp18") = "89" Then
                    cont = cont + 1
                End If
                If .Recordset("resp19") = "90" Then
                    cont = cont + 1
                End If
                If .Recordset("resp20") = "97" Then
                    cont = cont + 1
                End If
                If .Recordset("resp21") = "103" Then
                    cont = cont + 1
                End If
                If .Recordset("resp22") = "105" Then
                    cont = cont + 1
                End If
                If .Recordset("resp23") = "114" Then
                    cont = cont + 1
                End If
                If .Recordset("resp24") = "117" Then
                    cont = cont + 1
                End If
                If .Recordset("resp25") = "123" Then
                    cont = cont + 1
                End If
                If .Recordset("resp26") = "129" Then
                    cont = cont + 1
                End If
                If .Recordset("resp27") = "130" Then
                    cont = cont + 1
                End If
                If .Recordset("resp28") = "139" Then
                    cont = cont + 1
                End If
                If .Recordset("resp29") = "142" Then
                    cont = cont + 1
                End If
                If .Recordset("resp30") = "146" Then
                    cont = cont + 1
                End If
            ElseIf UCase(Trim(Adodc1.Recordset("curso"))) = "4TO AÑO DIV." Or _
            UCase(Trim(Adodc1.Recordset("curso"))) = "5TO AÑO DIV." Or _
            UCase(Trim(Adodc1.Recordset("curso"))) = "6TO AÑO T.M" Then
                        If .Recordset("resp1") = "0" Then
                    cont = cont + 1
                End If
                If .Recordset("resp2") = "8" Then
                    cont = cont + 1
                End If
                If .Recordset("resp3") = "11" Then
                    cont = cont + 1
                End If
                If .Recordset("resp4") = "15" Then
                    cont = cont + 1
                End If
                If .Recordset("resp5") = "22" Then
                    cont = cont + 1
                End If
                If .Recordset("resp6") = "29" Then
                    cont = cont + 1
                End If
                If .Recordset("resp7") = "31" Then
                    cont = cont + 1
                End If
                If .Recordset("resp8") = "37" Then
                    cont = cont + 1
                End If
                If .Recordset("resp9") = "41" Then
                    cont = cont + 1
                End If
                If .Recordset("resp10") = "49" Then
                    cont = cont + 1
                End If
                If .Recordset("resp11") = "53" Then
                    cont = cont + 1
                End If
                If .Recordset("resp12") = "57" Then
                    cont = cont + 1
                End If
                If .Recordset("resp13") = "61" Then
                    cont = cont + 1
                End If
                If .Recordset("resp14") = "68" Then
                    cont = cont + 1
                End If
                If .Recordset("resp15") = "70" Then
                    cont = cont + 1
                End If
                If .Recordset("resp16") = "78" Then
                    cont = cont + 1
                End If
                If .Recordset("resp17") = "82" Then
                    cont = cont + 1
                End If
                If .Recordset("resp18") = "89" Then
                    cont = cont + 1
                End If
                If .Recordset("resp19") = "90" Then
                    cont = cont + 1
                End If
                If .Recordset("resp20") = "97" Then
                    cont = cont + 1
                End If
                If .Recordset("resp21") = "103" Then
                    cont = cont + 1
                End If
                If .Recordset("resp22") = "105" Then
                    cont = cont + 1
                End If
                If .Recordset("resp23") = "114" Then
                    cont = cont + 1
                End If
                If .Recordset("resp24") = "117" Then
                    cont = cont + 1
                End If
                If .Recordset("resp25") = "123" Then
                    cont = cont + 1
                End If
                If .Recordset("resp26") = "129" Then
                    cont = cont + 1
                End If
                If .Recordset("resp27") = "130" Then
                    cont = cont + 1
                End If
                If .Recordset("resp28") = "139" Then
                    cont = cont + 1
                End If
                If .Recordset("resp29") = "142" Then
                    cont = cont + 1
                End If
                If .Recordset("resp30") = "146" Then
                    cont = cont + 1
            End If
        End If
        End If
        .Recordset.MoveNext
    Loop
    Text1(12).Text = cont
End With

Añade tu respuesta

Haz clic para o

Más respuestas relacionadas