VERSION 5.00
Object = "{BDC217C8-ED16-11CD-956C-0000C04E4C0A}#1.1#0"; "TABCTL32.OCX"
Object = "{0ECD9B60-23AA-11D0-B351-00A0C9055D8E}#6.0#0"; "MSHFLXGD.OCX"
Begin VB.Form Form_ConsultaGral 
   BorderStyle     =   1  'Fixed Single
   Caption         =   "Consulta Alumno"
   ClientHeight    =   7305
   ClientLeft      =   45
   ClientTop       =   330
   ClientWidth     =   13020
   Icon            =   "Form_ConsultaGral.frx":0000
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MDIChild        =   -1  'True
   MinButton       =   0   'False
   ScaleHeight     =   7305
   ScaleWidth      =   13020
   Begin VB.ListBox lst_Rut 
      BeginProperty Font 
         Name            =   "Arial"
         Size            =   8.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   900
      Left            =   5280
      TabIndex        =   30
      Top             =   720
      Visible         =   0   'False
      Width           =   1335
   End
   Begin VB.ListBox lst_Alumnos 
      BeginProperty Font 
         Name            =   "Arial"
         Size            =   8.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   900
      Left            =   840
      TabIndex        =   24
      Top             =   720
      Visible         =   0   'False
      Width           =   3735
   End
   Begin VB.Frame Frame_Apo_Caja 
      Caption         =   "Datos del Alumno"
      BeginProperty Font 
         Name            =   "Arial"
         Size            =   8.25
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H00C00000&
      Height          =   855
      Left            =   120
      TabIndex        =   25
      Top             =   120
      Width           =   6735
      Begin VB.TextBox txt_NombreCompleto 
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   285
         Left            =   720
         TabIndex        =   29
         Top             =   360
         Width           =   3735
      End
      Begin VB.TextBox txt_RutBusqueda 
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   285
         Left            =   5160
         TabIndex        =   28
         Top             =   360
         Width           =   1335
      End
      Begin VB.Label Label1 
         Caption         =   "Nombre"
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   255
         Left            =   120
         TabIndex        =   27
         Top             =   360
         Width           =   735
      End
      Begin VB.Label Label2 
         Caption         =   "R.u.t."
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   255
         Left            =   4680
         TabIndex        =   26
         Top             =   360
         Width           =   615
      End
   End
   Begin VB.CommandButton btn_Cancelar 
      Caption         =   "Cancelar"
      BeginProperty Font 
         Name            =   "Arial"
         Size            =   8.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   735
      Left            =   9600
      Picture         =   "Form_ConsultaGral.frx":2A8B2
      Style           =   1  'Graphical
      TabIndex        =   23
      Top             =   240
      Width           =   1215
   End
   Begin VB.CommandButton btnOtroAlumno 
      Caption         =   "Otro Alumno"
      BeginProperty Font 
         Name            =   "Arial"
         Size            =   8.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   735
      Left            =   8280
      Picture         =   "Form_ConsultaGral.frx":2AC1A
      Style           =   1  'Graphical
      TabIndex        =   22
      Top             =   240
      Width           =   1215
   End
   Begin VB.CommandButton btn_Ver 
      Caption         =   "Ver"
      BeginProperty Font 
         Name            =   "Arial"
         Size            =   8.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   735
      Left            =   6960
      Picture         =   "Form_ConsultaGral.frx":2B16F
      Style           =   1  'Graphical
      TabIndex        =   21
      Top             =   240
      Width           =   1215
   End
   Begin TabDlg.SSTab sst_Busqueda 
      Height          =   5655
      Left            =   120
      TabIndex        =   0
      Top             =   1440
      Width           =   12615
      _ExtentX        =   22251
      _ExtentY        =   9975
      _Version        =   393216
      Tabs            =   6
      Tab             =   5
      TabsPerRow      =   6
      TabHeight       =   520
      Enabled         =   0   'False
      ForeColor       =   12582912
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "Arial"
         Size            =   8.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      TabCaption(0)   =   "Personal"
      TabPicture(0)   =   "Form_ConsultaGral.frx":2B6E6
      Tab(0).ControlEnabled=   0   'False
      Tab(0).Control(0)=   "frm_DatosAlumno"
      Tab(0).ControlCount=   1
      TabCaption(1)   =   "Apoderado"
      TabPicture(1)   =   "Form_ConsultaGral.frx":2B702
      Tab(1).ControlEnabled=   0   'False
      Tab(1).Control(0)=   "Label21"
      Tab(1).Control(1)=   "Frame1"
      Tab(1).Control(2)=   "Frame2"
      Tab(1).ControlCount=   3
      TabCaption(2)   =   "Matrícula"
      TabPicture(2)   =   "Form_ConsultaGral.frx":2B71E
      Tab(2).ControlEnabled=   0   'False
      Tab(2).Control(0)=   "Frame_Mov_Matricula"
      Tab(2).ControlCount=   1
      TabCaption(3)   =   "Académicos"
      TabPicture(3)   =   "Form_ConsultaGral.frx":2B73A
      Tab(3).ControlEnabled=   0   'False
      Tab(3).Control(0)=   "lbl_promedio"
      Tab(3).Control(1)=   "Frame3"
      Tab(3).Control(2)=   "Frame4"
      Tab(3).ControlCount=   3
      TabCaption(4)   =   "Asistencia"
      TabPicture(4)   =   "Form_ConsultaGral.frx":2B756
      Tab(4).ControlEnabled=   0   'False
      Tab(4).Control(0)=   "Frame6"
      Tab(4).Control(1)=   "Frame5"
      Tab(4).ControlCount=   2
      TabCaption(5)   =   "Historico"
      TabPicture(5)   =   "Form_ConsultaGral.frx":2B772
      Tab(5).ControlEnabled=   -1  'True
      Tab(5).Control(0)=   "Frame7"
      Tab(5).Control(0).Enabled=   0   'False
      Tab(5).Control(1)=   "Frame8"
      Tab(5).Control(1).Enabled=   0   'False
      Tab(5).ControlCount=   2
      Begin VB.Frame Frame8 
         Caption         =   "Informe Historico"
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H00C00000&
         Height          =   3975
         Left            =   240
         TabIndex        =   91
         Top             =   1320
         Width           =   12135
         Begin MSHierarchicalFlexGridLib.MSHFlexGrid Grilla_Historica 
            Height          =   3495
            Left            =   120
            TabIndex        =   92
            Top             =   240
            Width           =   11895
            _ExtentX        =   20981
            _ExtentY        =   6165
            _Version        =   393216
            FixedCols       =   0
            FocusRect       =   0
            FillStyle       =   1
            GridLines       =   2
            SelectionMode   =   1
            BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
               Name            =   "Arial"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            _NumberOfBands  =   1
            _Band(0).Cols   =   2
         End
      End
      Begin VB.Frame Frame7 
         Caption         =   "Tipo Consulta"
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H00C00000&
         Height          =   735
         Left            =   240
         TabIndex        =   87
         Top             =   480
         Width           =   4335
         Begin VB.CommandButton CmdConsultar 
            Caption         =   "Consultar"
            BeginProperty Font 
               Name            =   "Arial"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   375
            Left            =   2760
            TabIndex        =   90
            Top             =   240
            Width           =   1215
         End
         Begin VB.OptionButton OptFinanciera 
            Caption         =   "Financiera"
            Height          =   255
            Left            =   1440
            TabIndex        =   89
            Top             =   360
            Width           =   1215
         End
         Begin VB.OptionButton OptACademica 
            Caption         =   "Academica"
            BeginProperty Font 
               Name            =   "Arial"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   255
            Left            =   120
            TabIndex        =   88
            Top             =   360
            Width           =   1335
         End
      End
      Begin VB.Frame Frame5 
         Caption         =   "Año"
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H00C00000&
         Height          =   735
         Left            =   -74880
         TabIndex        =   83
         Top             =   780
         Width           =   2775
         Begin VB.CommandButton cmd_ver_asistencia 
            Caption         =   "Ver Asistencia"
            BeginProperty Font 
               Name            =   "Arial"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   375
            Left            =   1320
            TabIndex        =   85
            Top             =   240
            Width           =   1215
         End
         Begin VB.ComboBox cb_agno_asistencia 
            BeginProperty Font 
               Name            =   "Arial"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   330
            Left            =   120
            TabIndex        =   84
            Text            =   "Combo1"
            Top             =   240
            Width           =   975
         End
      End
      Begin VB.Frame Frame6 
         Caption         =   "Asistencia"
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H00C00000&
         Height          =   4095
         Left            =   -74880
         TabIndex        =   76
         Top             =   1740
         Width           =   10455
         Begin MSHierarchicalFlexGridLib.MSHFlexGrid grilla_asistencia 
            Height          =   3735
            Left            =   120
            TabIndex        =   77
            Top             =   240
            Width           =   10215
            _ExtentX        =   18018
            _ExtentY        =   6588
            _Version        =   393216
            FocusRect       =   0
            FillStyle       =   1
            SelectionMode   =   1
            BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
               Name            =   "Arial"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            _NumberOfBands  =   1
            _Band(0).Cols   =   2
         End
         Begin VB.Label lbl_total 
            ForeColor       =   &H00FF0000&
            Height          =   375
            Left            =   6000
            TabIndex        =   82
            Top             =   600
            Width           =   3855
         End
         Begin VB.Label lbl_asistencia 
            ForeColor       =   &H00FF0000&
            Height          =   375
            Left            =   6000
            TabIndex        =   81
            Top             =   1080
            Width           =   3855
         End
         Begin VB.Label lbl_inasistencia 
            ForeColor       =   &H00FF0000&
            Height          =   375
            Left            =   6000
            TabIndex        =   80
            Top             =   1560
            Width           =   3735
         End
         Begin VB.Label porc_asist 
            ForeColor       =   &H00FF0000&
            Height          =   375
            Left            =   6000
            TabIndex        =   79
            Top             =   2040
            Width           =   3735
         End
         Begin VB.Label porc_inasist 
            ForeColor       =   &H00FF0000&
            Height          =   255
            Left            =   6000
            TabIndex        =   78
            Top             =   2520
            Width           =   3855
         End
      End
      Begin VB.Frame Frame4 
         Caption         =   "Año"
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H00C00000&
         Height          =   735
         Left            =   -74880
         TabIndex        =   73
         Top             =   780
         Width           =   2775
         Begin VB.CommandButton cmd_VerNotas 
            Caption         =   "Ver Notas"
            BeginProperty Font 
               Name            =   "Arial"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   375
            Left            =   1320
            TabIndex        =   75
            Top             =   240
            Width           =   1215
         End
         Begin VB.ComboBox cb_agno 
            BeginProperty Font 
               Name            =   "Arial"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   330
            Left            =   120
            TabIndex        =   74
            Text            =   "Combo1"
            Top             =   240
            Width           =   975
         End
      End
      Begin VB.Frame Frame3 
         Caption         =   "Notas"
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H00C00000&
         Height          =   4095
         Left            =   -74880
         TabIndex        =   71
         Top             =   1740
         Width           =   10455
         Begin MSHierarchicalFlexGridLib.MSHFlexGrid grid_asig 
            Height          =   3735
            Left            =   120
            TabIndex        =   72
            Top             =   240
            Width           =   10215
            _ExtentX        =   18018
            _ExtentY        =   6588
            _Version        =   393216
            FocusRect       =   0
            FillStyle       =   1
            SelectionMode   =   1
            BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
               Name            =   "Arial"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            _NumberOfBands  =   1
            _Band(0).Cols   =   2
         End
      End
      Begin VB.Frame frm_DatosAlumno 
         Caption         =   "Datos Alumno"
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H00C00000&
         Height          =   2895
         Left            =   -74880
         TabIndex        =   46
         Top             =   1260
         Visible         =   0   'False
         Width           =   10455
         Begin VB.TextBox txt_ApePat 
            BeginProperty Font 
               Name            =   "Arial"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   285
            Left            =   960
            Locked          =   -1  'True
            TabIndex        =   57
            Top             =   480
            Width           =   3975
         End
         Begin VB.TextBox txt_ApeMat 
            BeginProperty Font 
               Name            =   "Arial"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   285
            Left            =   6120
            Locked          =   -1  'True
            TabIndex        =   56
            Top             =   480
            Width           =   3975
         End
         Begin VB.TextBox txt_Nombres 
            BeginProperty Font 
               Name            =   "Arial"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   285
            Left            =   960
            Locked          =   -1  'True
            TabIndex        =   55
            Top             =   840
            Width           =   3975
         End
         Begin VB.TextBox txt_Rut 
            BeginProperty Font 
               Name            =   "Arial"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   285
            Left            =   6120
            Locked          =   -1  'True
            TabIndex        =   54
            Top             =   840
            Width           =   1815
         End
         Begin VB.TextBox txt_FechaNacimiento 
            BeginProperty Font 
               Name            =   "Arial"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   285
            Left            =   960
            Locked          =   -1  'True
            TabIndex        =   53
            Top             =   1200
            Width           =   1815
         End
         Begin VB.TextBox txt_Edad 
            BeginProperty Font 
               Name            =   "Arial"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   285
            Left            =   6120
            Locked          =   -1  'True
            TabIndex        =   52
            Top             =   1200
            Width           =   375
         End
         Begin VB.TextBox txt_Direccion 
            BeginProperty Font 
               Name            =   "Arial"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   285
            Left            =   6120
            Locked          =   -1  'True
            TabIndex        =   51
            Top             =   1560
            Width           =   3975
         End
         Begin VB.TextBox txt_Comuna 
            BeginProperty Font 
               Name            =   "Arial"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   285
            Left            =   960
            Locked          =   -1  'True
            TabIndex        =   50
            Top             =   1560
            Width           =   1815
         End
         Begin VB.TextBox txt_Telefono 
            BeginProperty Font 
               Name            =   "Arial"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   285
            Left            =   960
            Locked          =   -1  'True
            TabIndex        =   49
            Top             =   2280
            Width           =   1815
         End
         Begin VB.TextBox txt_Curso 
            BeginProperty Font 
               Name            =   "Arial"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   285
            Left            =   6120
            Locked          =   -1  'True
            TabIndex        =   48
            Top             =   1920
            Width           =   1815
         End
         Begin VB.TextBox txt_Jornada 
            BeginProperty Font 
               Name            =   "Arial"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   285
            Left            =   960
            Locked          =   -1  'True
            TabIndex        =   47
            Top             =   1920
            Width           =   1815
         End
         Begin VB.Label Label4 
            Caption         =   "Ap.Pat."
            BeginProperty Font 
               Name            =   "Arial"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   255
            Left            =   240
            TabIndex        =   68
            Top             =   480
            Width           =   615
         End
         Begin VB.Label Label5 
            Caption         =   "Ap.Mat."
            BeginProperty Font 
               Name            =   "Arial"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   255
            Left            =   5280
            TabIndex        =   67
            Top             =   480
            Width           =   615
         End
         Begin VB.Label Label7 
            Caption         =   "Nombres"
            BeginProperty Font 
               Name            =   "Arial"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   255
            Left            =   240
            TabIndex        =   66
            Top             =   840
            Width           =   735
         End
         Begin VB.Label Label8 
            Caption         =   "Rut"
            BeginProperty Font 
               Name            =   "Arial"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   255
            Left            =   5280
            TabIndex        =   65
            Top             =   840
            Width           =   375
         End
         Begin VB.Label Label9 
            Caption         =   "Fec.Nac."
            BeginProperty Font 
               Name            =   "Arial"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   255
            Left            =   240
            TabIndex        =   64
            Top             =   1200
            Width           =   735
         End
         Begin VB.Label Label10 
            Caption         =   "Edad"
            BeginProperty Font 
               Name            =   "Arial"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   255
            Left            =   5280
            TabIndex        =   63
            Top             =   1200
            Width           =   615
         End
         Begin VB.Label Label11 
            Caption         =   "Dirección"
            BeginProperty Font 
               Name            =   "Arial"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   255
            Left            =   5280
            TabIndex        =   62
            Top             =   1560
            Width           =   735
         End
         Begin VB.Label Label12 
            Caption         =   "Comuna"
            BeginProperty Font 
               Name            =   "Arial"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   255
            Left            =   240
            TabIndex        =   61
            Top             =   1560
            Width           =   735
         End
         Begin VB.Label Label23 
            Caption         =   "Teléfono"
            BeginProperty Font 
               Name            =   "Arial"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   255
            Left            =   240
            TabIndex        =   60
            Top             =   2280
            Width           =   735
         End
         Begin VB.Label Label3 
            Caption         =   "Curso"
            BeginProperty Font 
               Name            =   "Arial"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   255
            Left            =   5280
            TabIndex        =   59
            Top             =   1920
            Width           =   735
         End
         Begin VB.Label Label6 
            Caption         =   "Jornada"
            BeginProperty Font 
               Name            =   "Arial"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   255
            Left            =   240
            TabIndex        =   58
            Top             =   1920
            Width           =   735
         End
      End
      Begin VB.Frame Frame2 
         Caption         =   "Datos del Apoderado"
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H00C00000&
         Height          =   3135
         Left            =   -74880
         TabIndex        =   5
         Top             =   2700
         Width           =   10455
         Begin VB.TextBox txt_NombresApo 
            BeginProperty Font 
               Name            =   "Arial"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   285
            Left            =   960
            Locked          =   -1  'True
            TabIndex        =   45
            Top             =   720
            Width           =   4095
         End
         Begin VB.TextBox txt_TipoApoderadoApo 
            BeginProperty Font 
               Name            =   "Arial"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   285
            Left            =   6120
            Locked          =   -1  'True
            TabIndex        =   44
            Top             =   2520
            Width           =   2415
         End
         Begin VB.TextBox txt_FonoTrabajoApo 
            BeginProperty Font 
               Name            =   "Arial"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   285
            Left            =   6120
            Locked          =   -1  'True
            TabIndex        =   43
            Top             =   2160
            Width           =   1455
         End
         Begin VB.TextBox txt_ConvenioApo 
            BeginProperty Font 
               Name            =   "Arial"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   285
            Left            =   960
            Locked          =   -1  'True
            TabIndex        =   42
            Top             =   2520
            Width           =   4095
         End
         Begin VB.TextBox txt_LugarTrabajoApo 
            BeginProperty Font 
               Name            =   "Arial"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   285
            Left            =   960
            Locked          =   -1  'True
            TabIndex        =   41
            Top             =   2160
            Width           =   4095
         End
         Begin VB.TextBox txt_OcupacionApo 
            BeginProperty Font 
               Name            =   "Arial"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   285
            Left            =   6120
            Locked          =   -1  'True
            TabIndex        =   40
            Top             =   1800
            Width           =   4095
         End
         Begin VB.TextBox txt_NivelEducacionalApo 
            BeginProperty Font 
               Name            =   "Arial"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   285
            Left            =   960
            Locked          =   -1  'True
            TabIndex        =   39
            Top             =   1800
            Width           =   4095
         End
         Begin VB.TextBox txt_ParentescoApo 
            BeginProperty Font 
               Name            =   "Arial"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   285
            Left            =   6120
            Locked          =   -1  'True
            TabIndex        =   38
            Top             =   1440
            Width           =   1455
         End
         Begin VB.TextBox txt_CelularApo 
            BeginProperty Font 
               Name            =   "Arial"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   285
            Left            =   3720
            Locked          =   -1  'True
            TabIndex        =   37
            Top             =   1440
            Width           =   1335
         End
         Begin VB.TextBox txt_TelefonoApo 
            BeginProperty Font 
               Name            =   "Arial"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   285
            Left            =   960
            Locked          =   -1  'True
            TabIndex        =   36
            Top             =   1440
            Width           =   1335
         End
         Begin VB.TextBox txt_ComunaApo 
            BeginProperty Font 
               Name            =   "Arial"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   285
            Left            =   6120
            Locked          =   -1  'True
            TabIndex        =   35
            Top             =   1080
            Width           =   4095
         End
         Begin VB.TextBox txt_DireccionApo 
            BeginProperty Font 
               Name            =   "Arial"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   285
            Left            =   960
            Locked          =   -1  'True
            TabIndex        =   34
            Top             =   1080
            Width           =   4095
         End
         Begin VB.TextBox txt_RutApo 
            BeginProperty Font 
               Name            =   "Arial"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   285
            Left            =   6120
            Locked          =   -1  'True
            TabIndex        =   33
            Top             =   720
            Width           =   1455
         End
         Begin VB.TextBox txt_ApeMatApo 
            BeginProperty Font 
               Name            =   "Arial"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   285
            Left            =   6120
            Locked          =   -1  'True
            TabIndex        =   32
            Top             =   360
            Width           =   4095
         End
         Begin VB.TextBox txt_ApePatApo 
            BeginProperty Font 
               Name            =   "Arial"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   285
            Left            =   960
            Locked          =   -1  'True
            TabIndex        =   31
            Top             =   360
            Width           =   4095
         End
         Begin VB.CommandButton cmd_VerApoderado 
            Caption         =   "Ver Apoderado"
            BeginProperty Font 
               Name            =   "Arial"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   615
            Left            =   8760
            Picture         =   "Form_ConsultaGral.frx":2B78E
            Style           =   1  'Graphical
            TabIndex        =   70
            Top             =   2280
            Visible         =   0   'False
            Width           =   1455
         End
         Begin VB.Label Label15 
            Caption         =   "Dirección"
            BeginProperty Font 
               Name            =   "Arial"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   255
            Left            =   120
            TabIndex        =   20
            Top             =   1080
            Width           =   735
         End
         Begin VB.Label Label16 
            Caption         =   "Rut"
            BeginProperty Font 
               Name            =   "Arial"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   255
            Left            =   5160
            TabIndex        =   19
            Top             =   720
            Width           =   375
         End
         Begin VB.Label Label18 
            Caption         =   "Nombres"
            BeginProperty Font 
               Name            =   "Arial"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   255
            Left            =   120
            TabIndex        =   18
            Top             =   720
            Width           =   735
         End
         Begin VB.Label Label19 
            Caption         =   "Ap.Mat."
            BeginProperty Font 
               Name            =   "Arial"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   255
            Left            =   5160
            TabIndex        =   17
            Top             =   360
            Width           =   615
         End
         Begin VB.Label Label20 
            Caption         =   "Ap.Pat."
            BeginProperty Font 
               Name            =   "Arial"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   255
            Left            =   120
            TabIndex        =   16
            Top             =   360
            Width           =   615
         End
         Begin VB.Label Label22 
            Caption         =   "Comuna"
            BeginProperty Font 
               Name            =   "Arial"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   255
            Left            =   5160
            TabIndex        =   15
            Top             =   1080
            Width           =   735
         End
         Begin VB.Label Label24 
            Caption         =   "Teléfono"
            BeginProperty Font 
               Name            =   "Arial"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   255
            Left            =   120
            TabIndex        =   14
            Top             =   1440
            Width           =   735
         End
         Begin VB.Label Label25 
            Caption         =   "Celular"
            BeginProperty Font 
               Name            =   "Arial"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   255
            Left            =   3000
            TabIndex        =   13
            Top             =   1440
            Width           =   615
         End
         Begin VB.Label Label26 
            Caption         =   "Nivel educ."
            BeginProperty Font 
               Name            =   "Arial"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   255
            Left            =   120
            TabIndex        =   12
            Top             =   1800
            Width           =   855
         End
         Begin VB.Label Label27 
            Caption         =   "Parentesco"
            BeginProperty Font 
               Name            =   "Arial"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   255
            Left            =   5160
            TabIndex        =   11
            Top             =   1440
            Width           =   855
         End
         Begin VB.Label Label28 
            Caption         =   "Ocupación"
            BeginProperty Font 
               Name            =   "Arial"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   255
            Left            =   5160
            TabIndex        =   10
            Top             =   1800
            Width           =   855
         End
         Begin VB.Label Label29 
            Caption         =   "Lugar trab."
            BeginProperty Font 
               Name            =   "Arial"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   255
            Left            =   120
            TabIndex        =   9
            Top             =   2160
            Width           =   855
         End
         Begin VB.Label Label30 
            Caption         =   "Fono trab."
            BeginProperty Font 
               Name            =   "Arial"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   255
            Left            =   5160
            TabIndex        =   8
            Top             =   2160
            Width           =   855
         End
         Begin VB.Label Label31 
            Caption         =   "Convenio"
            BeginProperty Font 
               Name            =   "Arial"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   255
            Left            =   120
            TabIndex        =   7
            Top             =   2520
            Width           =   855
         End
         Begin VB.Label Label32 
            Caption         =   "Tipo apod."
            BeginProperty Font 
               Name            =   "Arial"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   255
            Left            =   5160
            TabIndex        =   6
            Top             =   2520
            Width           =   855
         End
      End
      Begin VB.Frame Frame1 
         Caption         =   "Listado de Apoderados"
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H00C00000&
         Height          =   1695
         Left            =   -74880
         TabIndex        =   4
         Top             =   900
         Width           =   10455
         Begin MSHierarchicalFlexGridLib.MSHFlexGrid mshflex_Apoderados 
            Height          =   1335
            Left            =   120
            TabIndex        =   69
            Top             =   240
            Width           =   10215
            _ExtentX        =   18018
            _ExtentY        =   2355
            _Version        =   393216
            FocusRect       =   0
            FillStyle       =   1
            SelectionMode   =   1
            BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
               Name            =   "Arial"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            _NumberOfBands  =   1
            _Band(0).Cols   =   2
         End
      End
      Begin VB.Frame Frame_Mov_Matricula 
         Caption         =   "Listado de Matriculas"
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H00C00000&
         Height          =   4935
         Left            =   -74880
         TabIndex        =   2
         Top             =   900
         Width           =   10455
         Begin MSHierarchicalFlexGridLib.MSHFlexGrid msflex_matriculas 
            Height          =   4575
            Left            =   120
            TabIndex        =   3
            Top             =   240
            Width           =   10215
            _ExtentX        =   18018
            _ExtentY        =   8070
            _Version        =   393216
            FixedCols       =   0
            FocusRect       =   0
            FillStyle       =   1
            GridLines       =   2
            SelectionMode   =   1
            BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
               Name            =   "Arial"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            _NumberOfBands  =   1
            _Band(0).Cols   =   2
         End
      End
      Begin VB.Label lbl_promedio 
         BeginProperty Font 
            Name            =   "MS Sans Serif"
            Size            =   13.5
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   375
         Left            =   -70200
         TabIndex        =   86
         Top             =   1140
         Width           =   5175
      End
      Begin VB.Label Label21 
         Alignment       =   2  'Center
         Caption         =   "-"
         BeginProperty Font 
            Name            =   "MS Sans Serif"
            Size            =   12
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   255
         Left            =   -72960
         TabIndex        =   1
         Top             =   1260
         Width           =   255
      End
   End
End
Attribute VB_Name = "Form_ConsultaGral"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False

Private Sub btn_Cancelar_Click()
    Unload Me
End Sub

Public Sub btn_Ver_Click()
    If txt_RutBusqueda <> "" Then
        txt_RutBusqueda.Locked = True
        txt_NombreCompleto.Locked = True
        frm_DatosAlumno.Visible = True
        sst_Busqueda.Tab = 0
        habilita_controles
        LLena_SSTab_Personal
        lst_Alumnos.Visible = False
        sst_Busqueda.Enabled = True
        llenar_matriculas
        llenar_apoderados
        btn_Ver.Enabled = False
    End If
End Sub

Private Sub btnOtroAlumno_Click()
    txt_RutBusqueda.Locked = False
    txt_NombreCompleto.Locked = False
    btn_Ver.Enabled = True
    limpia_controles
    frm_DatosAlumno.Visible = False
    desabilita_controles
    lst_Rut.Visible = False
    lst_Alumnos.Visible = False
    msflex_matriculas.Clear
    msflex_matriculas.Rows = 1
    mshflex_Apoderados.Clear
    mshflex_Apoderados.Rows = 1
    Grilla_Historica.Clear
    Grilla_Historica.Rows = 1
    sst_Busqueda.Enabled = False
    sst_Busqueda.Tab = 0
End Sub

Private Sub cmd_ver_asistencia_Click()
    grilla_asistencia.ClearStructure
    grilla_asistencia.Rows = 2
    llena_asistencia
End Sub

Private Sub cmd_VerApoderado_Click()
    If txt_RutApo.Text <> "" Then
        Load Form_ConsultaApoderados
        Form_ConsultaApoderados.limpiar
        Form_ConsultaApoderados.txt_RutBusqueda.Text = txt_RutApo.Text
        Form_ConsultaApoderados.txt_NombreCompleto.Text = _
        txt_ApePatApo.Text & " " & txt_ApeMatApo.Text & " " & txt_NombresApo.Text
        Form_ConsultaApoderados.lst_Nombre.Visible = False
        Form_ConsultaApoderados.lst_RutBusqueda.Visible = False
        Form_ConsultaApoderados.btn_Ver_Apo_Click
    End If
End Sub

Private Sub cmd_VerNotas_Click()
    grid_asig.Rows = 2
    grid_asig.ClearStructure
    llena_notas
End Sub

Private Sub CmdConsultar_Click()
    grilla_asistencia.ClearStructure
    grilla_asistencia.Rows = 2
    If OptACademica.Value = False And OptFinanciera.Value = False Then
        MsgBox "Debe seleccionar tipo de consulta", vbInformation, Me.Caption
        Exit Sub
    End If
    Llena_Historico

End Sub

Private Sub Form_Load()
    Dim I As Integer
    For I = 2005 To Year(Date)
        cb_agno.AddItem I
        cb_agno_asistencia.AddItem I
    Next
    cb_agno.Text = Year(Date)
    cb_agno_asistencia.Text = Year(Date)
End Sub

Private Sub Label17_Click()

End Sub

Private Sub lst_Alumnos_dblClick()
    'Dim dig As String
    'dig = digito(lst_Alumnos.ItemData(lst_Alumnos.ListIndex))
    'Dim Rut As String
    Dim varsql As String
    'Rut = lst_Alumnos.ItemData(lst_Alumnos.ListIndex) & "-" & dig
    
    Dim objRS As ADODB.Recordset
    varsql = "SELECT ci_alu" _
           & " FROM postulantes where concat(ape_pat_alu,' ',ape_mat_alu,' ',nom_alu) = '" _
           & lst_Alumnos.Text & "'"

    Set objRS = New ADODB.Recordset
    objRS.Open varsql, conn
    If Not objRS.EOF Then
        txt_NombreCompleto.Text = lst_Alumnos.Text
        txt_RutBusqueda.Text = objRS("ci_alu")
    End If
    objRS.Close
    lst_Rut.Clear
    lst_Rut.Visible = False
    If txt_RutBusqueda.Text <> "" And txt_NombreCompleto.Text <> "" Then
        txt_RutBusqueda.Locked = True
        txt_NombreCompleto.Locked = True
    End If
End Sub

Private Sub lst_Alumnos_LostFocus()
    lst_Alumnos.Visible = False
End Sub

Private Sub lst_Rut_DblClick()
    txt_RutBusqueda.Text = lst_Rut.Text
    lst_Rut.Visible = False
    Dim objRS As ADODB.Recordset
    Dim varsql As String
    varsql = "SELECT ape_pat_alu,ape_mat_alu,nom_alu" _
           & " FROM postulantes where ci_alu='" & txt_RutBusqueda.Text & "'"

    Set objRS = New ADODB.Recordset
        objRS.Open varsql, conn
    If Not objRS.EOF Then
        txt_NombreCompleto.Text = objRS("ape_pat_alu") & " " & objRS("ape_mat_alu") & " " & objRS("nom_alu")
    End If
    objRS.Close
    lst_Alumnos.Visible = False
    lst_Rut.Clear
    If txt_RutBusqueda.Text <> "" And txt_NombreCompleto.Text <> "" Then
        txt_RutBusqueda.Locked = True
        txt_NombreCompleto.Locked = True
    End If
End Sub

Private Sub marca_seleccionada()
        Dim Colum As Integer
        Dim Row As Integer
        Dim fila_seleccionada As Integer
        fila_seleccionada = msflex_matriculas.Row
        With msflex_matriculas
            For Row = 1 To .Rows - 1
            .Row = Row
                For Colum = 0 To .Cols - 1
                    .Col = Colum
                    .CellBackColor = &H80000005
                    .CellForeColor = white
                Next Colum
            Next Row
            .Row = fila_seleccionada
            For Colum = 0 To .Cols - 1
                .Col = Colum
                .CellForeColor = &H80000005
                .CellBackColor = &HFFC0C0
            Next Colum
        End With
End Sub


Private Sub mshflex_Apoderados_Click()
    Dim objRS As ADODB.Recordset
    Dim varsql As String
    Set objRS = New ADODB.Recordset
    varsql = "SELECT *" _
        & " FROM apoderados a,apo_x_alu axa, codigos__geograficos cg,convenios c,tipo_apo ta" _
        & " Where a.Rut_apo = axa.Rut_apo And a.Rut_apo = '" & mshflex_Apoderados.Text & "'" _
        & " And a.comuna_apo = cg.cod_geo And a.cod_conv = c.cod_conv" _
        & " and a.cod_tipo_apo = ta.cod_tipo_apo" _
        & " group by a.rut_apo"
    objRS.Open varsql, conn
    If Not objRS.EOF Then
        cmd_VerApoderado.Visible = True
        txt_ApePatApo = objRS("ape1_apo")
        txt_ApeMatApo = objRS("ape2_apo")
        txt_CelularApo = objRS("cel_apo")
        txt_ComunaApo = objRS("comuna")
        txt_NombresApo = objRS("noms_apo")
        txt_DireccionApo = objRS("dir_apo")
        txt_ConvenioApo = objRS("des_conv")
        txt_FonoTrabajoApo = objRS("empresa_fon")
        txt_LugarTrabajoApo = objRS("empresa")
        txt_NivelEducacionalApo = objRS("nivel_educ_apo")
        txt_OcupacionApo = objRS("profesio_apo")
        txt_TipoApoderadoApo = objRS("cod_tipo_apo")
        txt_TelefonoApo = objRS("fon_c_apo")
        txt_RutApo = objRS("rut_apo")
        txt_ParentescoApo = objRS("parent_apo")
        txt_TipoApoderadoApo = objRS("des_tipo_apo")
        cmd_VerApoderado.Visible = True
    End If
End Sub


Private Sub txt_NombreCompleto_Change()
    If txt_NombreCompleto.Text <> "" Then
    Dim varsql As String
    'lst_Rut.Visible = False
    Dim objRC As ADODB.Recordset
    Dim rut As Long
    Set objRS = New ADODB.Recordset
    varsql = "SELECT distinct p.CI_ALU,APE_PAT_ALU,APE_MAT_ALU,NOM_ALU" _
           & " FROM postulantes p,matriculas m" _
           & " where concat(APE_PAT_ALU,' ',ape_mat_alu,' ',nom_alu) LIKE '" & txt_NombreCompleto.Text & "%'" _
           & " and p.ci_alu = m.ci_alu" _
           & " order by ape_pat_alu,ape_mat_alu,nom_alu"
    objRS.Open varsql, conn
    lst_Alumnos.Clear
    If Not objRS.EOF Then
        lst_Alumnos.Visible = True
    End If
    While Not objRS.EOF
        lst_Alumnos.AddItem objRS("APE_PAT_ALU") & " " & objRS("APE_MAT_ALU") & " " & objRS("NOM_ALU")
        rut = Mid(objRS("CI_ALU"), 1, 8)
        lst_Alumnos.ItemData(lst_Alumnos.NewIndex) = rut
        objRS.MoveNext
    Wend
    objRS.Close
    End If
End Sub
Private Sub txt_NombreCompleto_KeyPress(KeyAscii As Integer)
    KeyAscii = Asc(UCase(Chr(KeyAscii)))
End Sub

Private Sub txt_RutBusqueda_Change()
    If txt_RutBusqueda.Text <> "" Then
    Dim varsql As String
    lst_Rut.Visible = False
    lst_Alumnos.Visible = False
    Dim objRC As ADODB.Recordset
    Dim rut As Long
    Set objRS = New ADODB.Recordset
    varsql = "SELECT distinct m.CI_ALU" _
           & " FROM postulantes p,matriculas m" _
           & " where p.CI_ALU LIKE '" & txt_RutBusqueda & "%'" _
           & " and p.ci_alu = m.ci_alu"
    objRS.Open varsql, conn
    lst_Rut.Clear
    If Not objRS.EOF Then
        lst_Rut.Visible = True
    End If
    While Not objRS.EOF
        lst_Rut.AddItem objRS("CI_ALU")
        objRS.MoveNext
    Wend
    objRS.Close
    End If
End Sub

Private Sub LLena_SSTab_Personal()
    Dim rec As ADODB.Recordset
    Set rec = New ADODB.Recordset
    
    Dim rut As String
    rut = txt_RutBusqueda.Text
    varsql = "select * from postulantes p,codigos__geograficos cg where CI_ALU='" & rut _
           & "' and cg.cod_geo = p.cod_geo"
    Set objRS = New ADODB.Recordset
    objRS.Open varsql, conn
    If Not objRS.EOF Then
        sst_Busqueda.Tab = 0
        txt_ApePat = objRS("APE_PAT_ALU")
        txt_ApeMat = objRS("APE_MAT_ALU")
        txt_Nombres = objRS("NOM_ALU")
        txt_FechaNacimiento = objRS("FEC_NACALU")
        txt_Edad = Year(Now) - Year(objRS("FEC_NACALU"))
        txt_Direccion = objRS("DIRE_ALU")
        txt_Comuna = objRS("COMUNA")
        txt_Rut.Text = rut
        txt_Telefono = objRS("FON_ALU")
    End If
    objRS.Close
    
    'Obtiene Curso
    var_sql = "select mat.num_gra,mat.cod_des,axc.let_cur,axc.agno,axc.cod_ens" _
            & " From (select *" _
            & " from matriculas m,codigos_ensenanza ce" _
            & " where m.cod_ens = ce.cod_ens and m.anno_mat = " & Year(Date) _
            & " and m.ci_alu = '" & rut & "' ORDER BY fec_mat DESC) as mat" _
            & " left join alu_x_cur axc on mat.ci_alu = axc.ci_alu and" _
            & " mat.anno_mat = axc.agno and mat.fec_mat = axc.fec_mat and" _
            & " mat.activo_alu = axc.activo_alu And mat.Cod_Ens = axc.Cod_Ens And" _
            & " mat.Num_Gra = axc.Num_Gra"
    objRS.Open var_sql, conn
    If Not objRS.EOF Then
         If IsNull(objRS("let_cur")) Then
                txt_Curso.Text = "Sin Curso"
         Else
                txt_Curso.Text = objRS("num_gra") & " " & objRS("let_cur") & " " & objRS("cod_des")
         End If
               
    End If
        
    If txt_Curso.Text <> "Sin Curso" And txt_Curso.Text <> "" Then
        var_sql = "select cod_ens,num_gra,let_cur,agno,des_jor" _
                & " from cursos c,jornadas j" _
                & " Where c.cod_jor = j.cod_jor and c.cod_ens = '" & objRS("cod_ens") _
                & "' and c.num_gra = " & objRS("Num_Gra") & " and c.let_cur = '" & objRS("let_cur") _
                & "' and agno = " & objRS("agno")
        rec.Open var_sql, conn
        If Not rec.EOF Then
            txt_Jornada.Text = rec("des_jor")
        End If
        objRS.Close
        rec.Close
    Else
        objRS.Close
    End If
End Sub

Private Sub llenar_matriculas()
  Dim objRS As ADODB.Recordset
  Set objRS = New ADODB.Recordset
  Dim varsql As String
  Dim I, j As Integer
  var_sql = "select mat.ci_alu as 'Rut. Alu.',mat.anno_mat as 'Año',mat.num_mat as 'Nro. Mat.'," _
          & "mat.fec_mat as 'Fec. Mat.',mat.fec_retiro as 'Fec. Ret.'," _
          & "axc.fec_ing_curso as 'Ing. Curso',axc.fec_cam as 'Fec. Cambio'," _
          & "concat(axc.num_gra,' ',axc.let_cur,' ',mat.cod_des) as Curso" _
          & " From (select *" _
          & " from matriculas m,codigos_ensenanza ce" _
          & " where m.cod_ens = ce.cod_ens" _
          & " and m.ci_alu = '" & txt_RutBusqueda.Text & "') as mat" _
          & " left join alu_x_cur axc on mat.ci_alu = axc.ci_alu and" _
          & " mat.anno_mat = axc.agno and mat.fec_mat = axc.fec_mat and" _
          & " mat.activo_alu = axc.activo_alu And mat.Cod_Ens = axc.Cod_Ens And" _
          & " mat.Num_Gra = axc.Num_Gra" _
          & " order by axc.agno desc,'Fec. Mat.' DESC"
  objRS.Open var_sql, conn
  If Not objRS.EOF Then
    Call Rec2Grid(objRS, msflex_matriculas, True)
    msflex_matriculas.ColSel = 8
  Else
    Exit Sub
  End If
  For I = 1 To msflex_matriculas.Rows - 1
    For j = 4 To 8
        If msflex_matriculas.TextMatrix(I, j) = "11/11/1111" _
           Or msflex_matriculas.TextMatrix(I, j) = "Null" Then
            msflex_matriculas.TextMatrix(I, j) = ""
        End If
    Next j
  Next I
  objRS.Close
End Sub

Private Sub llenar_apoderados()
    Dim objRS As ADODB.Recordset
    Set objRS = New ADODB.Recordset
    Dim varsql As String
    varsql = "select a.rut_apo RUT,concat(ape1_apo,' ',ape2_apo,' ',noms_apo) Nombres," _
        & " dir_apo Dirección,parent_apo Parentesco,agno Año" _
        & " from apo_x_alu axa,apoderados a,matriculas m" _
        & " Where axa.Rut_apo = a.Rut_apo and axa.ci_alu = m.ci_alu and" _
        & " axa.agno = m.anno_mat" _
        & " and axa.ci_alu = '" & txt_RutBusqueda.Text & "'" _
        & " order by agno desc"
    objRS.Open varsql, conn
    If Not objRS.EOF Then
        Call Rec2Grid(objRS, mshflex_Apoderados, True)
        mshflex_Apoderados.ColSel = 5
    End If
    objRS.Close
End Sub

Private Sub Rec2Grid(ByRef rec As ADODB.Recordset, ByRef grid As Object, Optional ByVal Numeracion As Boolean = True)
    grid.ClearStructure
    If rec.RecordCount > 0 Then
        grid.Cols = rec.Fields.count + 1
        grid.Rows = rec.RecordCount + 1
        grid.FixedCols = 1
        grid.FixedRows = 1
        grid.TextMatrix(0, 0) = "Nº"
        grid.ColWidth(0) = IIf(Numeracion, TextWidth(grid.TextMatrix(0, 0)) + 100, 0)
        For I = 1 To rec.Fields.count
            grid.TextMatrix(0, I) = UCase(rec.Fields(I - 1).Name)
            grid.ColWidth(I) = TextWidth(grid.TextMatrix(0, I)) + 100
        Next I
        rec.MoveFirst
        For I = 1 To rec.RecordCount
            grid.TextMatrix(I, 0) = I
            grid.ColWidth(0) = IIf(Numeracion, IIf(TextWidth(grid.TextMatrix(I, 0)) + 100 > grid.ColWidth(0), TextWidth(grid.TextMatrix(I, 0)) + 100, grid.ColWidth(0)), 0)
            For j = 1 To rec.Fields.count
                grid.TextMatrix(I, j) = IIf(IsNull(rec(j - 1)), "Null", rec(j - 1))
                grid.ColWidth(j) = IIf(TextWidth(grid.TextMatrix(I, j)) + 100 > grid.ColWidth(j), TextWidth(grid.TextMatrix(I, j)) + 100, grid.ColWidth(j))
            Next j
            rec.MoveNext
        Next I
    Else
        grid.Cols = 2
        grid.Rows = 2
    End If
End Sub

Public Sub limpia_controles()
        cmd_VerApoderado.Visible = False
        grid_asig.Rows = 2
        grid_asig.ClearStructure
        msflex_matriculas.Rows = 2
        msflex_matriculas.ClearStructure
        mshflex_Apoderados.Rows = 2
        mshflex_Apoderados.ClearStructure
        txt_NombreCompleto.Text = ""
        txt_RutBusqueda.Text = ""
        txt_Digito = ""
        txt_ApePat = ""
        txt_ApeMat = ""
        txt_Nombres = ""
        txt_FechaNacimiento = ""
        txt_Edad = ""
        txt_Direccion = ""
        txt_Comuna = ""
        txt_Curso = ""
        txt_Jornada = ""
        txt_Rut.Text = ""
        txt_Telefono = ""
        txt_ApePatApo.Text = ""
        txt_ApeMatApo.Text = ""
        txt_NombresApo.Text = ""
        txt_RutApo.Text = ""
        txt_DireccionApo.Text = ""
        txt_TelefonoApo.Text = ""
        txt_CelularApo.Text = ""
        txt_NivelEducacionalApo.Text = ""
        txt_LugarTrabajoApo.Text = ""
        txt_ComunaApo.Text = ""
        txt_OcupacionApo.Text = ""
        txt_FonoTrabajoApo.Text = ""
        lbl_total = ""
        lbl_asistencia = ""
        lbl_inasistencia = ""
        porc_asist = ""
        porc_inasist = ""
        grilla_asistencia.ClearStructure
        grilla_asistencia.Rows = 2
End Sub

Private Sub habilita_controles()
        txt_ApePat.Enabled = True
        txt_ApeMat.Enabled = True
        txt_Nombres.Enabled = True
        txt_FechaNacimiento.Enabled = True
        txt_Edad.Enabled = True
        txt_Direccion.Enabled = True
        txt_Comuna.Enabled = True
        txt_Curso.Enabled = True
        txt_Jornada.Enabled = True
        txt_Rut.Enabled = True
        txt_Telefono.Enabled = True
End Sub

Private Sub desabilita_controles()
        txt_ApePat.Enabled = False
        txt_ApeMat.Enabled = False
        txt_Nombres.Enabled = False
        txt_FechaNacimiento.Enabled = False
        txt_Edad.Enabled = False
        txt_Direccion.Enabled = False
        txt_Comuna.Enabled = False
        txt_Curso.Enabled = False
        txt_Jornada.Enabled = False
        txt_Rut.Enabled = False
        txt_Telefono.Enabled = False
End Sub

Private Sub llena_notas()
    Dim total_notas As Integer
    Dim colegio As String
    Dim largo As Long
    Dim prom As Double
    Dim var_sql, Num_Gra, Let_Cur, Cod_Ens, agno, cod_asi, notas, notas2 As String
    Dim asi, a1, a2, p1, p2, PG As Integer
    Dim I, Col As Integer
    Dim objRS As ADODB.Recordset
    Set objRS = New ADODB.Recordset
    Dim rec2 As ADODB.Recordset
    Set rec2 = New ADODB.Recordset
    
    'Obtiene colegio
    var_sql = "SELECT valor FROM cfg where param = 'CODBC'"
    objRS.Open var_sql, conn
    colegio = objRS("valor")
    objRS.Close
    
    'Obtiene Curso
    var_sql = "select mat.num_gra,mat.cod_des,axc.let_cur,axc.agno,axc.cod_ens" _
            & " From (select *" _
            & " from matriculas m,codigos_ensenanza ce" _
            & " where m.cod_ens = ce.cod_ens and confirmado = 'SI' and m.anno_mat = " & cb_agno.Text _
            & " and m.ci_alu = '" & txt_RutBusqueda.Text & "') as mat" _
            & " left join alu_x_cur axc on mat.ci_alu = axc.ci_alu and" _
            & " mat.anno_mat = axc.agno and mat.fec_mat = axc.fec_mat and" _
            & " mat.activo_alu = axc.activo_alu And mat.Cod_Ens = axc.Cod_Ens And" _
            & " mat.Num_Gra = axc.Num_Gra ORDER BY mat.fec_mat DESC, axc.fec_ing_curso DESC LIMIT 1"
    objRS.Open var_sql, conn
    If Not objRS.EOF Then
         If IsNull(objRS("let_cur")) Then
                MsgBox "Alumno no posee asignaturas para el año consultado", vbInformation
                Exit Sub
         End If
    Else
        MsgBox "Alumno no posee asignaturas para el año consultado", vbInformation
        Exit Sub
    End If
    Num_Gra = objRS("num_gra")
    Let_Cur = objRS("let_cur")
    Cod_Ens = objRS("cod_ens")
    objRS.Close
    
    'Obtiene asignaturas
    var_sql = "SELECT acp.agno,acp.cod_ens,cod_des,acp.num_gra,acp.let_cur,acp.cod_sec," _
            & "acp.cod_asi, s.nom_sec,a.nom_asi" _
            & " FROM cursos as c, asi_x_cur_prof as acp, sectores as s," _
            & "subsectores as a,codigos_ensenanza ce" _
            & " Where c.Cod_Ens = acp.Cod_Ens And c.Num_Gra = acp.Num_Gra And" _
            & " c.Let_Cur = acp.Let_Cur And c.agno = acp.agno And acp.cod_sec = s.cod_sec" _
            & " And acp.cod_sec = a.cod_sec And acp.cod_asi = a.cod_asi And" _
            & " acp.Cod_Ens = a.Cod_Ens And acp.Num_Gra = a.Num_Gra And" _
            & " acp.Cod_Ens = ce.Cod_Ens and acp.agno = " & cb_agno.Text _
            & " and acp.num_gra = " & Num_Gra & " and acp.let_cur = '" & Let_Cur & "' and acp.cod_ens = '" & Cod_Ens & "'" _
            & " ORDER BY acp.agno, acp.cod_ens, acp.num_gra, acp.let_cur," _
            & "a.nom_asi"
    objRS.Open var_sql, conn
        
    Frame3.Caption = "Notas " & cb_agno.Text
        
    grid_asig.Rows = 2
    grid_asig.Cols = 9
    grid_asig.TextMatrix(0, 1) = "Asignaturas"
    grid_asig.TextMatrix(0, 2) = "Aprendizaje 60%"
    grid_asig.TextMatrix(0, 3) = "Proceso 40%"
    grid_asig.TextMatrix(0, 4) = "1ªS"
    grid_asig.TextMatrix(0, 5) = "Aprendizaje 60%"
    grid_asig.TextMatrix(0, 6) = "Proceso 40%"
    grid_asig.TextMatrix(0, 7) = "2ªS"
    grid_asig.TextMatrix(0, 8) = "NF"
    
    If (colegio = "PUD001") Or (colegio = "LIN001") Then
        grid_asig.TextMatrix(0, 2) = "Aprendizaje 100%"
        grid_asig.TextMatrix(0, 5) = "Aprendizaje 100%"
        grid_asig.ColWidth(3) = 0
        grid_asig.ColWidth(6) = 0
    End If
    
    While Not objRS.EOF
        grid_asig.TextMatrix(grid_asig.Rows - 1, 0) = grid_asig.Rows - 1
        grid_asig.TextMatrix(grid_asig.Rows - 1, 1) = objRS("nom_asi")
        
        'Obtiene notas y promedios
        var_sql = "select n.agno,n.ci_alu,n.cod_ens,n.num_gra,n.letra_curso,num_per,cod_eva," _
                & "n.cod_asi,nota,p1,p2,pg" _
                & " from notas n,promedios p" _
                & " Where n.agno = p.agno And n.cod_ens = p.cod_ens And n.num_gra = p.num_gra" _
                & " and n.letra_curso = p.letra_curso and n.cod_sec = p.cod_sec and" _
                & " n.cod_asi = p.cod_asi and n.ci_alu = p.ci_alu" _
                & " and n.agno = " & objRS("agno") _
                & " and n.ci_alu = '" & txt_RutBusqueda.Text _
                & "' and n.cod_ens = '" & objRS("cod_ens") & "' and" _
                & " n.num_gra = '" & objRS("num_gra") & "' and n.letra_curso = '" & objRS("let_cur") _
                & "' and n.cod_asi = '" & objRS("cod_asi") & "'" _
                & " and n.cod_sec = '" & objRS("cod_sec") & "'"
          
        rec2.Open var_sql, conn
                
        While Not rec2.EOF
            notas = CStr(rec2("nota"))
            If rec2("num_per") = 0 Then
                If rec2("cod_eva") = 0 Then
                    Col = 2
                Else
                    Col = 3
                End If
            Else
                If rec2("cod_eva") = 0 Then
                    Col = 5
                Else
                    Col = 6
                End If
            End If
            If rec2("nota") = "" Then
                grid_asig.TextMatrix(grid_asig.Rows - 1, Col) = ""
            Else
                For I = 1 To Len(notas) Step 2
                    If Len(grid_asig.TextMatrix(grid_asig.Rows - 1, Col)) = 0 Then
                        grid_asig.TextMatrix(grid_asig.Rows - 1, Col) = Mid(notas, I, 1) & "," & Mid(notas, I + 1, 1)
                    Else
                        grid_asig.TextMatrix(grid_asig.Rows - 1, Col) = grid_asig.TextMatrix(grid_asig.Rows - 1, Col) _
                        & " - " & Mid(notas, I, 1) & "," & Mid(notas, I + 1, 1)
                    End If
                Next I
            End If
            'MsgBox Len(rec2("p1"))
            If rec2("p1") - val(rec2("p1")) > 0 Then
                grid_asig.TextMatrix(grid_asig.Rows - 1, 4) = rec2("p1")
            Else
                grid_asig.TextMatrix(grid_asig.Rows - 1, 4) = rec2("p1") & ",0"
            End If
            If (rec2("p2") - val(rec2("p2"))) > 0 Then
                grid_asig.TextMatrix(grid_asig.Rows - 1, 7) = rec2("p2")
            Else
                grid_asig.TextMatrix(grid_asig.Rows - 1, 7) = rec2("p2") & ",0"
            End If
            If (rec2("pg") - val(rec2("pg"))) > 0 Then
                grid_asig.TextMatrix(grid_asig.Rows - 1, 8) = rec2("pg")
            Else
                grid_asig.TextMatrix(grid_asig.Rows - 1, 8) = rec2("pg") & ",0"
            End If
            'grid_asig.TextMatrix(grid_asig.Rows - 1, 7) = rec2("p2")
            'grid_asig.TextMatrix(grid_asig.Rows - 1, 8) = rec2("pg")
            rec2.MoveNext
        Wend
        'grid_asig.TextMatrix(grid_asig.Rows - 1, 2) = Mid(grid_asig.TextMatrix(grid_asig.Rows - 1, 2), 1, Len(grid_asig.TextMatrix(grid_asig.Rows - 1, 2)) - 1)
        objRS.MoveNext
        grid_asig.Rows = grid_asig.Rows + 1
        rec2.Close
    Wend
    grid_asig.Rows = grid_asig.Rows - 1
    objRS.Close
    asi = 0
    p1 = 0
    p2 = 0
    a1 = 0
    a2 = 0
    PG = 0
    For I = 1 To grid_asig.Rows - 1
        If Len(grid_asig.TextMatrix(I, 1)) > asi Then
            asi = Len(grid_asig.TextMatrix(I, 1))
        End If
        If Len(grid_asig.TextMatrix(I, 2)) > a1 Then
            a1 = Len(grid_asig.TextMatrix(I, 2))
        End If
        If Len(grid_asig.TextMatrix(I, 3)) > p1 Then
            p1 = Len(grid_asig.TextMatrix(I, 3))
        End If
        If Len(grid_asig.TextMatrix(I, 5)) > a2 Then
            a2 = Len(grid_asig.TextMatrix(I, 5))
        End If
        If Len(grid_asig.TextMatrix(I, 6)) > p2 Then
            p2 = Len(grid_asig.TextMatrix(I, 6))
        End If
            PG = Len(grid_asig.TextMatrix(I, 6))
    Next I
    
'    grid_asig.ColWidth(0) = 250
'    grid_asig.ColWidth(1) = (asi + 1) * 100
'    If a1 < 1301 Then
'        grid_asig.ColWidth(2) = 1300
'    Else
'        If ((a1 / 3) > 7) Then a1 = a1 - 2
'        grid_asig.ColWidth(2) = ((a1 / 3) - 2) * 300
'    End If
'    If p1 < 1101 Then
'        grid_asig.ColWidth(3) = 1100
'    Else
'        If ((p1 / 3) > 7) Then p1 = p1 - 2
'        grid_asig.ColWidth(3) = ((p1 / 3) - 2) * 300
'    End If
'    grid_asig.ColWidth(4) = 400
'    If a2 < 1301 Then
'        grid_asig.ColWidth(5) = 1300
'    Else
'        If ((a2 / 3) > 7) Then a2 = a2 - 2
'        grid_asig.ColWidth(5) = ((a2 / 3) - 2) * 300
'    End If
'    If p2 < 1101 Then
'        grid_asig.ColWidth(6) = 1100
'    Else
'        If ((p2 / 3) > 7) Then p2 = p2 - 2
'        grid_asig.ColWidth(6) = ((p2 / 3) - 2) * 300
'    End If
'    grid_asig.ColWidth(7) = 400
'    grid_asig.ColWidth(8) = 400

    grid_asig.ColWidth(0) = 250
    grid_asig.ColWidth(1) = (asi + 1) * 100
    largo = ((a1 / 3) - 2) * 300
    
    If (colegio = "PUD001") Or (colegio = "LIN001") Then
        If largo < 2401 Then
            grid_asig.ColWidth(2) = 2400
        Else
            If ((a1 / 3) > 7) Then a1 = a1 - 2
            grid_asig.ColWidth(2) = ((a1 / 3) - 2) * 300
        End If
        grid_asig.ColWidth(4) = 400
        largo = ((a2 / 3) - 2) * 300
        If largo < 2401 Then
            grid_asig.ColWidth(5) = 2400
        Else
            If ((a2 / 3) > 7) Then a2 = a2 - 2
            grid_asig.ColWidth(5) = ((a2 / 3) - 2) * 300
        End If
    Else
    If largo < 1301 Then
        grid_asig.ColWidth(2) = 1300
    Else
        If ((a1 / 3) > 7) Then a1 = a1 - 2
        grid_asig.ColWidth(2) = ((a1 / 3) - 2) * 300
    End If
    largo = ((p1 / 3) - 2) * 300
    If largo < 1101 Then
       grid_asig.ColWidth(3) = 1100
    Else
        If ((p1 / 3) > 7) Then p1 = p1 - 2
        grid_asig.ColWidth(3) = ((p1 / 3) - 2) * 300
    End If
    grid_asig.ColWidth(4) = 400
    largo = ((a2 / 3) - 2) * 300
    If largo < 1301 Then
       grid_asig.ColWidth(5) = 1300
    Else
        If ((a2 / 3) > 7) Then a2 = a2 - 2
        grid_asig.ColWidth(5) = ((a2 / 3) - 2) * 300
    End If
    largo = ((p2 / 3) - 2) * 300
    If largo < 1101 Then
       grid_asig.ColWidth(6) = 1100
    Else
        If ((p2 / 3) > 7) Then p2 = p2 - 2
        grid_asig.ColWidth(6) = ((p2 / 3) - 2) * 300
    End If
    End If
    
    grid_asig.ColWidth(7) = 400
    grid_asig.ColWidth(8) = 400
        
    For I = 1 To grid_asig.Rows - 1
        grid_asig.Row = I
        grid_asig.Col = 1
        grid_asig.CellBackColor = &H80FF80
        grid_asig.Col = 2
        grid_asig.CellBackColor = &H80FFFF
        grid_asig.CellAlignment = 1
        grid_asig.Col = 3
        grid_asig.CellBackColor = &HFFFF80
        grid_asig.CellAlignment = 1
        grid_asig.Col = 4
        grid_asig.CellBackColor = &H80C0FF
        grid_asig.Col = 5
        grid_asig.CellBackColor = &H80FFFF
        grid_asig.CellAlignment = 1
        grid_asig.Col = 6
        grid_asig.CellBackColor = &HFFFF80
        grid_asig.CellAlignment = 1
        grid_asig.Col = 7
        grid_asig.CellBackColor = &H80C0FF
'        grid_asig.Col = 8
'        grid_asig.CellBackColor = &H8080FF
    Next I
    If grid_asig.Rows > 1 Then
        grid_asig.Row = 1
        grid_asig.Col = 8
        grid_asig.ColSel = 1
    End If
    prom = 0
    total_notas = 0
    For I = 1 To grid_asig.Rows - 1
        If (grid_asig.TextMatrix(I, 1) <> "RELIGION") And (grid_asig.TextMatrix(I, 8) <> "") And (grid_asig.TextMatrix(I, 8) <> "0,0") Then
            prom = prom + CDbl(grid_asig.TextMatrix(I, 8))
            total_notas = total_notas + 1
        End If
    Next I
    If total_notas > 0 Then
        lbl_promedio.Caption = "Promedio general del alumno " & cb_agno.Text & " : " & Mid(CStr((prom / total_notas)), 1, 3)
    Else
        lbl_promedio.Caption = ""
    End If
End Sub

Private Sub llena_asistencia()
    Dim I, asist, inasist, total As Integer
    Dim objRS As ADODB.Recordset
    Set objRS = New ADODB.Recordset
    Dim var_sql As String
    var_sql = "select if(mes_asis='MAR', 3, if(mes_asis='ABR', 4, if(mes_asis='MAY', 5,if(mes_asis='JUN', 6,if(mes_asis='JUL', 7," _
            & "if(mes_asis='AGO', 8,if(mes_asis='SEP', 9,if(mes_asis='OCT',10,if(mes_asis='NOV',11,12))))))))) as 'orden'," _
            & "if(mes_asis='MAR', 'MARZO', if(mes_asis='ABR', 'ABRIL', if(mes_asis='MAY','MAYO',if(mes_asis='JUN','JUNIO',if(mes_asis='JUL','JULIO'," _
            & "if(mes_asis='AGO','AGOSTO',if(mes_asis='SEP','SEPTIEMBRE',if(mes_asis='OCT','OCTUBRE',if(mes_asis='NOV','NOVIEMBRE','DICIEMBRE'))))))))) as 'mes'," _
            & "sum(asi_r) as 'Dias de clases', sum(asi_t) as 'Asistencia'," _
            & " (sum(asi_r)-sum(asi_t)) as 'Inasistencias'" _
            & " from asistencia where ci_alu='" & txt_RutBusqueda.Text & "' and agno = " & cb_agno_asistencia.Text _
            & " group by mes_asis" _
            & " order by orden;"
    objRS.Open var_sql, conn
    If Not objRS.EOF Then
        Call Rec2Grid(objRS, grilla_asistencia, True)
    Else
        MsgBox "El alumno no posee registro de asistencia para ese año", vbInformation
        Exit Sub
    End If
    grilla_asistencia.ColWidth(1) = 0
    objRS.Close
    
    'Calculo totales
    asist = 0
    inasist = 0
    total = 0
    For I = 1 To grilla_asistencia.Rows - 1
        total = total + grilla_asistencia.TextMatrix(I, 3)
        asist = asist + grilla_asistencia.TextMatrix(I, 4)
        inasist = inasist + grilla_asistencia.TextMatrix(I, 5)
    Next
    
    lbl_total = ""
    lbl_asistencia = ""
    lbl_inasistencia = ""
    porc_asist = ""
    porc_inasist = ""
    
    lbl_total = "Total de dias de clases : " & total
    lbl_asistencia = "Total de dias asistidos : " & asist
    lbl_inasistencia = "Total de inasistencias : " & inasist
    If total <> 0 Then
        porc_asist = "Porcentaje Asistencia : " & CInt(((100 * asist) / total)) & "%"
        porc_inasist = "Porcentaje Inasistencia : " & CInt(((100 * inasist) / total)) & "%"
    Else
        porc_asist = "Porcentaje Asistencia : " & 0 & "%"
        porc_inasist = "Porcentaje Inasistencia : " & 0 & "%"
    End If
End Sub

Private Sub Llena_Historico()
    Dim tabla As String
    Dim accion As String
    
    Dim total_notas As Integer
    Dim colegio As String
    Dim largo As Long
    Dim prom As Double
    Dim var_sql, Num_Gra, Let_Cur, Cod_Ens, agno, cod_asi, notas, notas2 As String
    Dim asi, a1, a2, p1, p2, PG As Integer
    Dim I, Col As Integer
    Dim objRS As ADODB.Recordset
    Set objRS = New ADODB.Recordset
    Dim rec2 As ADODB.Recordset
    Set rec2 = New ADODB.Recordset
    
    If OptACademica.Value Then
        tabla = "hist_vitacora_alumno "
        accion = "accion_realizada as accion"
    End If
    If OptFinanciera.Value Then
        tabla = "fnza_historico_log"
        accion = "accion_detalle as accion"
    End If
    'Obtiene Curso
    var_sql = ""
    var_sql = "select login_usuario, nombre_usuario, ip, pc, fecha, " & accion & "" _
            & " From " & tabla & "" _
            & " where ci_alu = '" & txt_RutBusqueda.Text & "'"
            
    objRS.Open var_sql, conn
    If Not objRS.EOF Then
        
    Grilla_Historica.Rows = objRS.RecordCount + 1
    Grilla_Historica.Cols = 6
    Grilla_Historica.TextMatrix(0, 0) = "Login Usuario"
    Grilla_Historica.TextMatrix(0, 1) = "Nombre Usurio"
    Grilla_Historica.TextMatrix(0, 2) = "IP"
    Grilla_Historica.TextMatrix(0, 3) = "PC"
    Grilla_Historica.TextMatrix(0, 4) = "Fecha"
    Grilla_Historica.TextMatrix(0, 5) = "Acción"
    
    I = 0
    While Not objRS.EOF
        I = I + 1
        Grilla_Historica.TextMatrix(I, 0) = Grilla_Historica.Rows - 1
        Grilla_Historica.ColWidth(0) = 1500
        Grilla_Historica.TextMatrix(I, 0) = objRS("login_usuario")
        Grilla_Historica.ColWidth(1) = 2500
        Grilla_Historica.TextMatrix(I, 1) = objRS("nombre_usuario")
        Grilla_Historica.ColWidth(2) = 1500
        Grilla_Historica.TextMatrix(I, 2) = objRS("ip")
        Grilla_Historica.ColWidth(3) = 1800
        Grilla_Historica.TextMatrix(I, 3) = objRS("pc")
        Grilla_Historica.ColWidth(4) = 1000
        Grilla_Historica.TextMatrix(I, 4) = objRS("fecha")
        Grilla_Historica.ColWidth(5) = 8500
        Grilla_Historica.TextMatrix(I, 5) = objRS("accion")
        
        
        'Obtiene notas y promedios
        objRS.MoveNext
        grid_asig.Rows = grid_asig.Rows + 1
    
    Wend
    'grid_asig.Rows = grid_asig.Rows - 1
    objRS.Close
        
  End If
'
'      For i = 1 To Grilla_Historica.Rows - 1
'        Grilla_Historica.Row = i
'        Grilla_Historica.Col = 0
'        Grilla_Historica.CellBackColor = &H80FF80
'        Grilla_Historica.Col = 1
'        Grilla_Historica.CellBackColor = &H80FFFF
'        Grilla_Historica.CellAlignment = 1
'        Grilla_Historica.Col = 2
'        Grilla_Historica.CellBackColor = &HFFFF80
'        Grilla_Historica.CellAlignment = 1
'        Grilla_Historica.Col = 3
'        Grilla_Historica.CellBackColor = &H80C0FF
'        Grilla_Historica.Col = 4
'        Grilla_Historica.CellBackColor = &H80FFFF
'        Grilla_Historica.CellAlignment = 1
'        Grilla_Historica.Col = 5
'        Grilla_Historica.CellBackColor = &HFFFF80
'    Next i
'    If Grilla_Historica.Rows > 1 Then
'        Grilla_Historica.Row = 1
'        Grilla_Historica.Col = 6
'        Grilla_Historica.ColSel = 1
'    End If

End Sub


