• Viernes 14 de Junio de 2024, 04:21

Autor Tema:  Error En El Update Con Ciclo Y Matriz De Controles  (Leído 1179 veces)

az8

  • Miembro MUY activo
  • ***
  • Mensajes: 111
    • Ver Perfil
Error En El Update Con Ciclo Y Matriz De Controles
« en: Miércoles 4 de Julio de 2007, 09:50 »
0
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
  1.            a = 1
  2.          Do Until a = numMate + 1
  3.  
  4.                 Dim Mat1, varBimE1
  5.                 varBimE1 = Val(txtBim1(a).Text)
  6.                                    
  7. varUpdate = "UPDATE Calificaciones SET IdAlumno='" & IdAlumno & "' , IdCiclo='" & IdCiclo1 & "', IdGpo='" & IdGpo & "', Bim1= " & Val(varBimE1) & " WHERE IdAlumno='" & IdAlumno & "' and IdCiclo='" & IdCiclo1 & "' "
  8.                     CONEXION.Execute varUpdate
  9.           Loop
  10.  

F_Tanori

  • Moderador
  • ******
  • Mensajes: 1919
  • Nacionalidad: mx
    • Ver Perfil
Re: Error En El Update Con Ciclo Y Matriz De Controles
« Respuesta #1 en: Jueves 5 de Julio de 2007, 09:26 »
0
Puedes ampliar mas el codigo?

mostrar el Procedimineto completo

Saludos
" ExIsTo y A vEcEs PiEnSo "

NOTA:
===========================================================================================================================
Este foro es para ayudar, aprender, compartir... usenlo para eso,
NO SE RESUELVEN DUDAS POR MENSAJE PRIVADO Y MENOS POR CORREO
===========================================================================================================================

az8

  • Miembro MUY activo
  • ***
  • Mensajes: 111
    • Ver Perfil
Re: Error En El Update Con Ciclo Y Matriz De Controles
« Respuesta #2 en: Jueves 5 de Julio de 2007, 18:27 »
0
BUENO AKI TE PONGO OTRA PARTE DEL CODIGO

Código: Text
  1. Private Sub Form_Load()
  2.     OpenConn
  3.     Label2(0).Visible = False
  4.     Label4(0).Visible = False
  5.     txtBim1(0).Visible = False
  6.     txtBim2(0).Visible = False
  7.     txtBim3(0).Visible = False
  8.     txtBim4(0).Visible = False
  9.     txtBim5(0).Visible = False
  10.     txtPromBim(0).Visible = False
  11.     txtTurno.Locked = True
  12. End Sub
  13. Sub Calificaciones()
  14.  Dim materia, idmateria
  15.     Dim a
  16.     Dim i, b, c, d, e, f, l As Long
  17.     'selecciona el NUMERO de materias de acuerdo al grupo seleccionado
  18.     SqlnumMat = "SELECT count(*)as NumMat FROM Materias where IdGpo='" & IdGpo & "'"
  19.     Call OnRs(rsnumMat, SqlnumMat)
  20.         numMate = rsnumMat.Fields("NumMat")
  21.         'MsgBox numMate
  22.     'selecciona las MATERIAS de acuerdo al grupo seleccionado
  23.     SqlMat = "SELECT * FROM Materias where IdGpo='" & IdGpo & "'"
  24.     Call OnRs(rsMat, SqlMat)
  25.    
  26.     Do While Not rsMat.EOF
  27.         materia = rsMat.Fields("NombreMat")
  28.         idmateria = rsMat.Fields("IdMateria")
  29.        
  30.            i = Label2.Count
  31.            Load Label2(i)
  32.            With Label2(i)
  33.                .Top = Label2(i - 1).Top + 390
  34.                .Caption = materia
  35.                .Visible = True
  36.            End With
  37.            
  38.           i = Label4.Count
  39.            Load Label4(i)
  40.            With Label4(i)
  41.                .Top = Label4(i - 1).Top + 390
  42.                .Caption = idmateria
  43.                .Visible = True
  44.            End With
  45.        
  46.        
  47. ' Carga controles de bimestres
  48.         i = txtBim1.Count
  49.         Load txtBim1(i)
  50.         b = txtBim2.Count
  51.         Load txtBim2(b)
  52.         c = txtBim3.Count
  53.         Load txtBim3(c)
  54.         d = txtBim4.Count
  55.         Load txtBim4(d)
  56.         e = txtBim5.Count
  57.         Load txtBim5(e)
  58.         f = txtPromBim.Count
  59.         Load txtPromBim(f)
  60.        
  61.         If IdBim = "B1" Then
  62.               txtBim1(i).Enabled = True
  63.               txtBim2(b).Enabled = False
  64.               txtBim3(c).Enabled = False
  65.               txtBim4(d).Enabled = False
  66.               txtBim5(e).Enabled = False
  67.         End If
  68.         If IdBim = "B2" Then
  69.               txtBim1(i).Enabled = False
  70.               txtBim2(b).Enabled = True
  71.               txtBim3(c).Enabled = False
  72.               txtBim4(d).Enabled = False
  73.               txtBim5(e).Enabled = False
  74.         End If
  75.         If IdBim = "B3" Then
  76.               txtBim1(i).Enabled = False
  77.               txtBim2(b).Enabled = False
  78.               txtBim3(c).Enabled = True
  79.               txtBim4(d).Enabled = False
  80.               txtBim5(e).Enabled = False
  81.         End If
  82.         If IdBim = "B4" Then
  83.               txtBim1(i).Enabled = False
  84.               txtBim2(b).Enabled = False
  85.               txtBim3(c).Enabled = False
  86.               txtBim4(d).Enabled = True
  87.               txtBim5(e).Enabled = False
  88.         End If
  89.         If IdBim = "B5" Then
  90.               txtBim1(i).Enabled = False
  91.               txtBim2(b).Enabled = False
  92.               txtBim3(c).Enabled = False
  93.               txtBim4(d).Enabled = False
  94.               txtBim5(e).Enabled = True
  95.         End If
  96.  
  97. 'dibuja las matrices de control ke utilizo
  98. ' txt's 1er Bimestre
  99.         With txtBim1(i)
  100.             .Top = txtBim1(i - 1).Top + 390
  101.             .Visible = True
  102.         End With
  103. ' txt's 2do Bimestre
  104.         With txtBim2(b)
  105.             .Top = txtBim2(b - 1).Top + 390
  106.             .Visible = True
  107.         End With
  108. ' txt's 3er Bimestre
  109.         With txtBim3(c)
  110.             .Top = txtBim3(c - 1).Top + 390
  111.             .Visible = True
  112.         End With
  113. ' txt's 4to Bimestre
  114.         With txtBim4(d)
  115.             .Top = txtBim4(d - 1).Top + 390
  116.             .Visible = True
  117.         End With
  118. ' txt's 5to Bimestre
  119.         With txtBim5(e)
  120.             .Top = txtBim5(e - 1).Top + 390
  121.             .Visible = True
  122.         End With
  123.      
  124. ' txt's Promedio por materia
  125.         With txtPromBim(f)
  126.             .Top = txtPromBim(f - 1).Top + 390
  127.             .Visible = True
  128.         End With
  129.     rsMat.MoveNext
  130.     Loop
  131. end sub
  132.  

espero ke con esto si me puedan ayudar

gracias