Programación General > Visual Basic 6.0 e inferiores
Error En El Update Con Ciclo Y Matriz De Controles
(1/1)
az8:
hola de nuevo... tengo un problemilla... resulta ke estoy tratando de hacer un update a una tabla, pero estoy manejando una matriz de controles en este caso son text box, se supone ke tengo lo siguiente
bim1
3
4
5
6
8
kiero hacer ese update y me hace el update pero todos mal... o sea ke hace el update tomando el ultimo valor de la matriz de control en este caso el 8.. y me lo deja asi
bim1
8
8
8
8
8
ya probe varias soluciones y nada.. les pongo mi codigo haber si encuentran algo y me pueden ayudar...
--- Código: Text --- a = 1 Do Until a = numMate + 1 Dim Mat1, varBimE1 varBimE1 = Val(txtBim1(a).Text) varUpdate = "UPDATE Calificaciones SET IdAlumno='" & IdAlumno & "' , IdCiclo='" & IdCiclo1 & "', IdGpo='" & IdGpo & "', Bim1= " & Val(varBimE1) & " WHERE IdAlumno='" & IdAlumno & "' and IdCiclo='" & IdCiclo1 & "' " CONEXION.Execute varUpdate Loop
F_Tanori:
Puedes ampliar mas el codigo?
mostrar el Procedimineto completo
Saludos
az8:
BUENO AKI TE PONGO OTRA PARTE DEL CODIGO
--- Código: Text ---Private Sub Form_Load() OpenConn Label2(0).Visible = False Label4(0).Visible = False txtBim1(0).Visible = False txtBim2(0).Visible = False txtBim3(0).Visible = False txtBim4(0).Visible = False txtBim5(0).Visible = False txtPromBim(0).Visible = False txtTurno.Locked = TrueEnd SubSub Calificaciones() Dim materia, idmateria Dim a Dim i, b, c, d, e, f, l As Long 'selecciona el NUMERO de materias de acuerdo al grupo seleccionado SqlnumMat = "SELECT count(*)as NumMat FROM Materias where IdGpo='" & IdGpo & "'" Call OnRs(rsnumMat, SqlnumMat) numMate = rsnumMat.Fields("NumMat") 'MsgBox numMate 'selecciona las MATERIAS de acuerdo al grupo seleccionado SqlMat = "SELECT * FROM Materias where IdGpo='" & IdGpo & "'" Call OnRs(rsMat, SqlMat) Do While Not rsMat.EOF materia = rsMat.Fields("NombreMat") idmateria = rsMat.Fields("IdMateria") i = Label2.Count Load Label2(i) With Label2(i) .Top = Label2(i - 1).Top + 390 .Caption = materia .Visible = True End With i = Label4.Count Load Label4(i) With Label4(i) .Top = Label4(i - 1).Top + 390 .Caption = idmateria .Visible = True End With ' Carga controles de bimestres i = txtBim1.Count Load txtBim1(i) b = txtBim2.Count Load txtBim2(b) c = txtBim3.Count Load txtBim3(c) d = txtBim4.Count Load txtBim4(d) e = txtBim5.Count Load txtBim5(e) f = txtPromBim.Count Load txtPromBim(f) If IdBim = "B1" Then txtBim1(i).Enabled = True txtBim2(b).Enabled = False txtBim3(c).Enabled = False txtBim4(d).Enabled = False txtBim5(e).Enabled = False End If If IdBim = "B2" Then txtBim1(i).Enabled = False txtBim2(b).Enabled = True txtBim3(c).Enabled = False txtBim4(d).Enabled = False txtBim5(e).Enabled = False End If If IdBim = "B3" Then txtBim1(i).Enabled = False txtBim2(b).Enabled = False txtBim3(c).Enabled = True txtBim4(d).Enabled = False txtBim5(e).Enabled = False End If If IdBim = "B4" Then txtBim1(i).Enabled = False txtBim2(b).Enabled = False txtBim3(c).Enabled = False txtBim4(d).Enabled = True txtBim5(e).Enabled = False End If If IdBim = "B5" Then txtBim1(i).Enabled = False txtBim2(b).Enabled = False txtBim3(c).Enabled = False txtBim4(d).Enabled = False txtBim5(e).Enabled = True End If 'dibuja las matrices de control ke utilizo' txt's 1er Bimestre With txtBim1(i) .Top = txtBim1(i - 1).Top + 390 .Visible = True End With' txt's 2do Bimestre With txtBim2(b) .Top = txtBim2(b - 1).Top + 390 .Visible = True End With' txt's 3er Bimestre With txtBim3(c) .Top = txtBim3(c - 1).Top + 390 .Visible = True End With' txt's 4to Bimestre With txtBim4(d) .Top = txtBim4(d - 1).Top + 390 .Visible = True End With' txt's 5to Bimestre With txtBim5(e) .Top = txtBim5(e - 1).Top + 390 .Visible = True End With ' txt's Promedio por materia With txtPromBim(f) .Top = txtPromBim(f - 1).Top + 390 .Visible = True End With rsMat.MoveNext Loopend sub
espero ke con esto si me puedan ayudar
gracias
Navegación
Ir a la versión completa