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 = True
End Sub
Sub 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
Loop
end sub