VERSION 5.00
Object = "{5E9E78A0-531B-11CF-91F6-C2863C385E30}#1.0#0"; "MSFLXGRD.OCX"
Begin VB.Form Form_Res_Pos2 
   BorderStyle     =   1  'Fixed Single
   Caption         =   "Resultado de postulaciones"
   ClientHeight    =   7335
   ClientLeft      =   45
   ClientTop       =   330
   ClientWidth     =   11715
   Icon            =   "Form_Res_Pos2.frx":0000
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MDIChild        =   -1  'True
   MinButton       =   0   'False
   Moveable        =   0   'False
   ScaleHeight     =   7335
   ScaleWidth      =   11715
   Begin VB.Frame Frame_postulantes 
      Height          =   7095
      Left            =   120
      TabIndex        =   0
      Top             =   120
      Width           =   11415
      Begin VB.Frame Frame2 
         Caption         =   "Evaluación"
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H00C00000&
         Height          =   2055
         Left            =   9720
         TabIndex        =   26
         Top             =   240
         Width           =   1575
         Begin VB.Label Label11 
            Alignment       =   2  'Center
            Caption         =   "REPROBADOS"
            BeginProperty Font 
               Name            =   "Arial"
               Size            =   8.25
               Charset         =   0
               Weight          =   700
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            ForeColor       =   &H000000FF&
            Height          =   255
            Left            =   120
            TabIndex        =   38
            Top             =   1320
            Width           =   1335
         End
         Begin VB.Label Label5 
            Alignment       =   2  'Center
            Caption         =   "Nota menor a 4,0"
            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        =   37
            Top             =   1560
            Width           =   1335
         End
         Begin VB.Line Line2 
            BorderColor     =   &H8000000C&
            X1              =   15
            X2              =   1560
            Y1              =   1080
            Y2              =   1080
         End
         Begin VB.Line Line1 
            BorderColor     =   &H80000005&
            X1              =   15
            X2              =   1560
            Y1              =   1095
            Y2              =   1095
         End
         Begin VB.Label Label13 
            Alignment       =   2  'Center
            Caption         =   "APROBADOS"
            BeginProperty Font 
               Name            =   "Arial"
               Size            =   8.25
               Charset         =   0
               Weight          =   700
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            ForeColor       =   &H00C00000&
            Height          =   255
            Left            =   120
            TabIndex        =   31
            Top             =   360
            Width           =   1335
         End
         Begin VB.Label Label7 
            Alignment       =   2  'Center
            Caption         =   "Nota mayor a 4,0"
            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        =   30
            Top             =   600
            Width           =   1335
         End
      End
      Begin VB.Frame Frame_valores 
         Caption         =   "Situación Final"
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H00C00000&
         Height          =   2055
         Left            =   7920
         TabIndex        =   21
         Top             =   240
         Width           =   1695
         Begin VB.Label Label18 
            Caption         =   "R"
            BeginProperty Font 
               Name            =   "Arial"
               Size            =   8.25
               Charset         =   0
               Weight          =   700
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   255
            Left            =   120
            TabIndex        =   36
            Top             =   720
            Width           =   135
         End
         Begin VB.Label Label17 
            Caption         =   "P"
            BeginProperty Font 
               Name            =   "Arial"
               Size            =   8.25
               Charset         =   0
               Weight          =   700
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   255
            Left            =   120
            TabIndex        =   35
            Top             =   1080
            Width           =   135
         End
         Begin VB.Label Label16 
            Caption         =   "F"
            BeginProperty Font 
               Name            =   "Arial"
               Size            =   8.25
               Charset         =   0
               Weight          =   700
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   255
            Left            =   120
            TabIndex        =   34
            Top             =   1440
            Width           =   135
         End
         Begin VB.Label Label15 
            Caption         =   "(Faltó al exámen)"
            BeginProperty Font 
               Name            =   "Arial"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   255
            Left            =   285
            TabIndex        =   33
            Top             =   1680
            Width           =   1335
         End
         Begin VB.Label Label14 
            Caption         =   "A"
            BeginProperty Font 
               Name            =   "Arial"
               Size            =   8.25
               Charset         =   0
               Weight          =   700
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   255
            Left            =   120
            TabIndex        =   32
            Top             =   360
            Width           =   135
         End
         Begin VB.Label Label4 
            Caption         =   "= Ausente"
            BeginProperty Font 
               Name            =   "Arial"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   255
            Left            =   300
            TabIndex        =   25
            Top             =   1440
            Width           =   975
         End
         Begin VB.Label Label3 
            Caption         =   "= Pendiente"
            BeginProperty Font 
               Name            =   "Arial"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   255
            Left            =   300
            TabIndex        =   24
            Top             =   1080
            Width           =   975
         End
         Begin VB.Label Label2 
            Caption         =   "= Reprobado"
            BeginProperty Font 
               Name            =   "Arial"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   255
            Left            =   300
            TabIndex        =   23
            Top             =   720
            Width           =   1215
         End
         Begin VB.Label Label1 
            Caption         =   "= Aceptado"
            BeginProperty Font 
               Name            =   "Arial"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   255
            Left            =   300
            TabIndex        =   22
            Top             =   360
            Width           =   1095
         End
      End
      Begin VB.CommandButton btn_carga_grilla 
         Caption         =   "Buscar"
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   375
         Left            =   7920
         TabIndex        =   20
         Top             =   2520
         Width           =   1575
      End
      Begin VB.CommandButton Command1 
         Caption         =   "Cancelar"
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   375
         Left            =   9600
         TabIndex        =   19
         Top             =   2520
         Width           =   1575
      End
      Begin VB.Frame Frame1 
         Caption         =   "Situación Final"
         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            =   120
         TabIndex        =   12
         Top             =   240
         Width           =   2295
         Begin VB.OptionButton Opt_tipopostulante 
            Caption         =   "Matriculados"
            BeginProperty Font 
               Name            =   "Arial"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   255
            Index           =   6
            Left            =   120
            TabIndex        =   27
            Top             =   2520
            Width           =   1695
         End
         Begin VB.OptionButton Opt_tipopostulante 
            Caption         =   "Ausentes"
            BeginProperty Font 
               Name            =   "Arial"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   255
            Index           =   3
            Left            =   120
            TabIndex        =   18
            Top             =   1440
            Width           =   1455
         End
         Begin VB.OptionButton Opt_tipopostulante 
            Caption         =   "Sin situación final"
            BeginProperty Font 
               Name            =   "Arial"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   255
            Index           =   5
            Left            =   120
            TabIndex        =   17
            Top             =   2160
            Width           =   2055
         End
         Begin VB.OptionButton Opt_tipopostulante 
            Caption         =   "Todos los inscritos"
            BeginProperty Font 
               Name            =   "Arial"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   195
            Index           =   4
            Left            =   120
            TabIndex        =   16
            Top             =   1800
            Width           =   1695
         End
         Begin VB.OptionButton Opt_tipopostulante 
            Caption         =   "Pendientes"
            BeginProperty Font 
               Name            =   "Arial"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   255
            Index           =   2
            Left            =   120
            TabIndex        =   15
            Top             =   1080
            Width           =   1335
         End
         Begin VB.OptionButton Opt_tipopostulante 
            Caption         =   "Reprobados"
            BeginProperty Font 
               Name            =   "Arial"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   255
            Index           =   1
            Left            =   120
            TabIndex        =   14
            Top             =   720
            Width           =   1455
         End
         Begin VB.OptionButton Opt_tipopostulante 
            Caption         =   "Aceptados"
            BeginProperty Font 
               Name            =   "Arial"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   255
            Index           =   0
            Left            =   120
            TabIndex        =   13
            Top             =   360
            Width           =   1215
         End
         Begin VB.Line Line10 
            BorderColor     =   &H80000005&
            X1              =   15
            X2              =   2280
            Y1              =   2055
            Y2              =   2055
         End
         Begin VB.Line Line9 
            BorderColor     =   &H8000000C&
            X1              =   15
            X2              =   2280
            Y1              =   2040
            Y2              =   2040
         End
      End
      Begin VB.Frame Frame3 
         Caption         =   "Criterios"
         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            =   2520
         TabIndex        =   2
         Top             =   240
         Width           =   5295
         Begin VB.OptionButton opt_orden 
            Caption         =   "Apellidos"
            BeginProperty Font 
               Name            =   "Arial"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   255
            Index           =   0
            Left            =   1560
            TabIndex        =   44
            Top             =   2520
            Width           =   1335
         End
         Begin VB.OptionButton opt_orden 
            Caption         =   "Fecha Evaluación"
            BeginProperty Font 
               Name            =   "Arial"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   255
            Index           =   1
            Left            =   3240
            TabIndex        =   43
            Top             =   2520
            Width           =   1815
         End
         Begin VB.ComboBox Combo2 
            Enabled         =   0   'False
            BeginProperty Font 
               Name            =   "Arial"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   330
            Left            =   3360
            TabIndex        =   40
            Top             =   1920
            Visible         =   0   'False
            Width           =   1815
         End
         Begin VB.ComboBox Combo1 
            Enabled         =   0   'False
            BeginProperty Font 
               Name            =   "Arial"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   330
            Left            =   3360
            TabIndex        =   39
            Top             =   1320
            Visible         =   0   'False
            Width           =   1815
         End
         Begin VB.ComboBox cmb_jor_reg 
            BeginProperty Font 
               Name            =   "Arial"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   330
            Left            =   1320
            TabIndex        =   7
            Top             =   1320
            Width           =   1815
         End
         Begin VB.ComboBox cmb_anho_reg 
            BeginProperty Font 
               Name            =   "Arial"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   330
            Left            =   3360
            TabIndex        =   6
            Top             =   480
            Width           =   1815
         End
         Begin VB.ComboBox cmb_mod_reg 
            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        =   5
            Top             =   480
            Width           =   3135
         End
         Begin VB.ListBox lst_niveles_reg 
            BeginProperty Font 
               Name            =   "Arial"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   1260
            Left            =   120
            Style           =   1  'Checkbox
            TabIndex        =   4
            Top             =   1320
            Width           =   1095
         End
         Begin VB.CheckBox chk_todos_niveles_reg 
            Caption         =   "Todos los niveles"
            BeginProperty Font 
               Name            =   "Arial"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   255
            Left            =   1320
            TabIndex        =   3
            Top             =   1680
            Width           =   1575
         End
         Begin VB.Label Label21 
            Caption         =   "Ordenar por"
            BeginProperty Font 
               Name            =   "Arial"
               Size            =   8.25
               Charset         =   0
               Weight          =   700
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            ForeColor       =   &H00C00000&
            Height          =   255
            Left            =   1320
            TabIndex        =   45
            Top             =   2280
            Width           =   975
         End
         Begin VB.Line Line8 
            BorderColor     =   &H80000005&
            X1              =   3255
            X2              =   3255
            Y1              =   975
            Y2              =   2390
         End
         Begin VB.Line Line7 
            BorderColor     =   &H8000000C&
            X1              =   3240
            X2              =   3240
            Y1              =   975
            Y2              =   2390
         End
         Begin VB.Label Label20 
            Caption         =   "Hasta el"
            Enabled         =   0   'False
            BeginProperty Font 
               Name            =   "Arial"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   255
            Left            =   3360
            TabIndex        =   42
            Top             =   1680
            Visible         =   0   'False
            Width           =   1575
         End
         Begin VB.Label Label19 
            Caption         =   "Desde el"
            Enabled         =   0   'False
            BeginProperty Font 
               Name            =   "Arial"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   255
            Left            =   3360
            TabIndex        =   41
            Top             =   1080
            Visible         =   0   'False
            Width           =   1575
         End
         Begin VB.Line Line6 
            BorderColor     =   &H8000000C&
            X1              =   15
            X2              =   5280
            Y1              =   960
            Y2              =   960
         End
         Begin VB.Line Line4 
            BorderColor     =   &H80000005&
            X1              =   15
            X2              =   5280
            Y1              =   975
            Y2              =   975
         End
         Begin VB.Label Label9 
            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            =   1320
            TabIndex        =   11
            Top             =   1080
            Width           =   1575
         End
         Begin VB.Label Label8 
            Caption         =   "Niveles"
            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        =   10
            Top             =   1080
            Width           =   615
         End
         Begin VB.Label Label10 
            Caption         =   "Tipo de Enseñanza"
            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             =   240
            Width           =   1575
         End
         Begin VB.Label Label12 
            Caption         =   "Año Postulació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            =   3480
            TabIndex        =   8
            Top             =   240
            Width           =   1215
         End
         Begin VB.Line Line11 
            BorderColor     =   &H80000005&
            X1              =   2040
            X2              =   5265
            Y1              =   2415
            Y2              =   2415
         End
         Begin VB.Line Line12 
            BorderColor     =   &H8000000C&
            X1              =   2040
            X2              =   5265
            Y1              =   2400
            Y2              =   2400
         End
      End
      Begin MSFlexGridLib.MSFlexGrid Grd_res_pos 
         Height          =   3015
         Left            =   120
         TabIndex        =   1
         Top             =   3600
         Width           =   11205
         _ExtentX        =   19764
         _ExtentY        =   5318
         _Version        =   393216
         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
      End
      Begin VB.Label lbl_totalalumnos 
         Caption         =   "0"
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   225
         Left            =   1800
         TabIndex        =   29
         Top             =   6720
         Width           =   1575
      End
      Begin VB.Label Label6 
         Caption         =   "Total alumnos :"
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   225
         Left            =   240
         TabIndex        =   28
         Top             =   6720
         Width           =   1335
      End
      Begin VB.Line Line5 
         BorderColor     =   &H8000000C&
         X1              =   15
         X2              =   11400
         Y1              =   3360
         Y2              =   3360
      End
   End
End
Attribute VB_Name = "Form_Res_Pos2"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim fila As Long, Columna As Long, FilaAnt As Long, ColAnt As Long
Dim Cadena As String, Editargrilla As Boolean
Sub Llenagrillapos(Criterio As String)
Dim Alumnos As Integer
Alumnos = 0
Me.Grd_res_pos.Clear
Me.Grd_res_pos.Rows = 2
Me.Grd_res_pos.FormatString = "R.U.N          |Apellido Paterno  |Apellido Materno  |Nombres                              |Nivel |Fecha evaluación|Fecha postulac.|Calificación|Situación final"
rs.CursorLocation = adUseClient
a = "select postulantes.ci_alu, postulantes.ape_pat_alu, postulantes.ape_mat_alu, postulantes.nom_alu, postulantes.num_gra, date(postulaciones.vii_hor_eval) as feceval , postulaciones.fec_pos, postulaciones.VIII_res_eval, postulaciones.VIII_sit_fin_alu from postulaciones, postulantes where " & Criterio
rs.Open a, conn
If rs.RecordCount > 0 Then
    fila = 1
    While Not rs.EOF
        If IsNull(rs("ci_alu")) Then
            Me.Grd_res_pos.TextMatrix(fila, 0) = ""
        Else
            Me.Grd_res_pos.TextMatrix(fila, 0) = rs("ci_alu")
        End If
        If IsNull(rs("ape_pat_alu")) Then
            Me.Grd_res_pos.TextMatrix(fila, 1) = ""
        Else
            Me.Grd_res_pos.TextMatrix(fila, 1) = rs("ape_pat_alu")
        End If
        If IsNull(rs("ape_mat_alu")) Then
            Me.Grd_res_pos.TextMatrix(fila, 2) = ""
        Else
            Me.Grd_res_pos.TextMatrix(fila, 2) = rs("ape_mat_alu")
        End If
        If IsNull(rs("nom_alu")) Then
            Me.Grd_res_pos.TextMatrix(fila, 3) = ""
        Else
            Me.Grd_res_pos.TextMatrix(fila, 3) = rs("nom_alu")
        End If
        If IsNull(rs("num_gra")) Then
            Me.Grd_res_pos.TextMatrix(fila, 4) = ""
        Else
            Me.Grd_res_pos.TextMatrix(fila, 4) = rs("num_gra")
        End If
        If IsNull(rs("feceval")) Then
            Me.Grd_res_pos.TextMatrix(fila, 5) = ""
        Else
            Me.Grd_res_pos.TextMatrix(fila, 5) = rs("feceval")
        End If
        If IsNull(rs("fec_pos")) Then
            Me.Grd_res_pos.TextMatrix(fila, 6) = ""
        Else
            Me.Grd_res_pos.TextMatrix(fila, 6) = rs("fec_pos")
        End If
        If IsNull(rs("VIII_res_eval")) Then
            Me.Grd_res_pos.TextMatrix(fila, 7) = ""
        Else
            Colorcel = IIf(rs("VIII_res_eval") < 40#, &HFF&, &HFF0000)
            Me.Grd_res_pos.Row = fila: Me.Grd_res_pos.Col = 7: Me.Grd_res_pos.CellForeColor = Colorcel
            If Len(CStr(rs("VIII_res_eval"))) = 1 Then
                Me.Grd_res_pos.TextMatrix(fila, 7) = rs("VIII_res_eval")
            Else
                Me.Grd_res_pos.TextMatrix(fila, 7) = Mid(rs("VIII_res_eval"), 1, 1) & "," & Mid(rs("VIII_res_eval"), 2, 1)
            End If
        End If
        Me.Grd_res_pos.Row = fila: Me.Grd_res_pos.Col = 7: Me.Grd_res_pos.CellAlignment = 4
        If IsNull(rs("VIII_sit_fin_alu")) Then
            Me.Grd_res_pos.TextMatrix(fila, 8) = ""
        Else
            Me.Grd_res_pos.TextMatrix(fila, 8) = rs("VIII_sit_fin_alu")
        End If
        Me.Grd_res_pos.Row = fila: Me.Grd_res_pos.Col = 8: Me.Grd_res_pos.CellAlignment = 4
        fila = fila + 1
        Alumnos = Alumnos + 1
        Me.Grd_res_pos.Rows = Me.Grd_res_pos.Rows + 1
        rs.MoveNext
        Me.lbl_totalalumnos.Caption = Alumnos & " de " & rs.RecordCount
        Me.lbl_totalalumnos.Refresh
    Wend
    Me.Grd_res_pos.Rows = Me.Grd_res_pos.Rows - 1
Else
    Me.lbl_totalalumnos.Caption = "0"
End If
rs.Close
End Sub
Sub Grabasituacion(Filagrab As Long)
Dim Fechapos As Date
rutalumno = Me.Grd_res_pos.TextMatrix(Filagrab, 0)
Fechapos = Me.Grd_res_pos.TextMatrix(Filagrab, 6)
If Len(Trim(Me.Grd_res_pos.TextMatrix(Filagrab, 8))) = 0 Then
    Situacion = "VIII_SIT_FIN_ALU = NULL"
Else
    Situacion = "VIII_SIT_FIN_ALU = '" & Me.Grd_res_pos.TextMatrix(Filagrab, 8) & "'"
End If
If Len(Trim(Me.Grd_res_pos.TextMatrix(Filagrab, 7))) = 0 Then
    Camporeseval = "VIII_RES_EVAL = Null"
ElseIf Len(Trim(Me.Grd_res_pos.TextMatrix(Filagrab, 7))) = 2 Then
    If Mid(Me.Grd_res_pos.TextMatrix(Filagrab, 7), 2, 1) = "," Then
        Nota = Mid(Me.Grd_res_pos.TextMatrix(Filagrab, 7), 1, 1)
    Else
        Nota = Me.Grd_res_pos.TextMatrix(Filagrab, 7)
    End If
    Camporeseval = "VIII_RES_EVAL = " & Nota

ElseIf Len(Trim(Me.Grd_res_pos.TextMatrix(Filagrab, 7))) = 3 Then
    Nota = CInt(Mid(Me.Grd_res_pos.TextMatrix(Filagrab, 7), 1, 1) & Mid(Me.Grd_res_pos.TextMatrix(Filagrab, 7), 2, 1))
    Camporeseval = "VIII_RES_EVAL = " & Nota
End If
conn.Execute "update postulaciones set " & Situacion & " , " & Camporeseval & " where ci_alu = '" & rutalumno & "' and fec_pos ='" & InvierteFecha(Fechapos, "R") & "'"
End Sub
Private Sub btn_carga_grilla_Click()
Dim Cadena As String
'Dim Faltancampos As Boolean, fechainicio As String, fechafin As String
'On Error GoTo Errorimpresion
'Faltancampos = True
'If Me.opt_tipobusqueda_reg(0) Then
'    If Me.cmb_fechaexa_reg.Text <> "" Then: Faltancampos = False
'ElseIf Me.opt_tipobusqueda_reg(1) Then
'    If Me.cmb_fechaexa1_reg.Text <> "" And Me.cmb_fechaexa2_reg.Text <> "" Then: Faltancampos = False
'ElseIf Me.opt_tipobusqueda_reg(2) Then
'    If Me.Dtp_fecha1_reg.Value <> "" And Me.Dtp_fecha2_reg.Value <> "" Then: Faltancampos = False
'End If

If Me.cmb_mod_reg.Text <> "" And Me.cmb_anho_reg.Text <> "" And Me.lst_niveles_reg.SelCount > 0 And Me.cmb_jor_reg.Text <> "" Then 'And Not Faltancampos Then
    Codens = "postulantes.cod_ens = '" & devuelvecampo("codigos_ensenanza", "", "cod_ens", "des_ens ='" & Me.cmb_mod_reg.Text & "'", conn) & "'"
    Anho = "and postulaciones.anno_pos_alu = '" & Me.cmb_anho_reg.Text & "'"
    If Me.Opt_tipopostulante(0).Value Then
        Situacion = "and UCase(postulaciones.VIII_SIT_FIN_ALU) = 'A' and (postulantes.matriculado_alu) <> '1'"
        Tipo = "APROBADOS"
    ElseIf Me.Opt_tipopostulante(1).Value Then
        Situacion = "and UCase(postulaciones.VIII_SIT_FIN_ALU) = 'R' and (postulantes.matriculado_alu) <> '1'"
        Tipo = "REPROBADOS"
    ElseIf Me.Opt_tipopostulante(2).Value Then
        Situacion = "and UCase(postulaciones.VIII_SIT_FIN_ALU) = 'P' and (postulantes.matriculado_alu) <> '1'"
        Tipo = "PENDIENTES"
    ElseIf Me.Opt_tipopostulante(3).Value Then
        Situacion = "and UCase(postulaciones.VIII_SIT_FIN_ALU) = 'F' and (postulantes.matriculado_alu) <> '1'"
        Tipo = "AUSENTES"
    ElseIf Me.Opt_tipopostulante(4).Value Then
        Situacion = "and (postulantes.matriculado_alu) <> '1'"
        Tipo = "INSCRITOS"
    ElseIf Me.Opt_tipopostulante(5).Value Then
        Situacion = "and isnull(postulaciones.VIII_SIT_FIN_ALU)"
        'situacion = "and (UpperCase({postulaciones.VIII_SIT_FIN_ALU}) <> 'A'  and Uppercase({postulaciones.VIII_SIT_FIN_ALU}) <> 'R' and Uppercase({postulaciones.VIII_SIT_FIN_ALU}) <> 'P' and Uppercase({postulaciones.VIII_SIT_FIN_ALU}) <> 'F')"
        Tipo = "SIN SITUACIÓN FINAL"
    ElseIf Me.Opt_tipopostulante(6).Value Then
        Situacion = "and (postulantes.matriculado_alu) = '1'"
        'situacion = "and (UpperCase({postulaciones.VIII_SIT_FIN_ALU}) <> 'A'  and Uppercase({postulaciones.VIII_SIT_FIN_ALU}) <> 'R' and Uppercase({postulaciones.VIII_SIT_FIN_ALU}) <> 'P' and Uppercase({postulaciones.VIII_SIT_FIN_ALU}) <> 'F')"
        Tipo = "MATRICULADOS"
    End If
        jornada = "and postulaciones.cod_jor = '" & devuelvecampo("jornadas", "", "cod_jor", "des_jor ='" & Me.cmb_jor_reg.Text & "'", conn) & "'"
    
    SelCursos = ""
    If Me.lst_niveles_reg.SelCount >= 0 Then
        For t = 0 To Me.lst_niveles_reg.ListCount - 1
            If Me.lst_niveles_reg.Selected(t) Then
                Con = t
            End If
        Next t
        For t = 0 To Me.lst_niveles_reg.ListCount - 1
            If Me.lst_niveles_reg.Selected(t) Then
                If t = Con Then
                    SelCursos = SelCursos & "postulantes.num_gra  = '" & Me.lst_niveles_reg.List(t) & "'"
                    Niveles = Niveles & t + 1
                Else
                    SelCursos = SelCursos & "postulantes.num_gra  = '" & Me.lst_niveles_reg.List(t) & "' or "
                    Niveles = Niveles & t + 1 & "-"
                End If '{}
            End If
        Next
        SelCursos = "(" & SelCursos & ")"
    End If
    If Me.opt_orden(0) Then
        Orden = "postulantes.ape_pat_alu, postulantes.ape_mat_alu, postulantes.nom_alu, postulaciones.vii_hor_eval"
        'Orden = "postulantes.ape_pat_alu, postulantes.ape_mat_alu, postulantes.nom_alu, postulaciones.vii_fec_eval"
    Else
        'Orden = "postulaciones.,postulantes.ape_pat_alu, postulantes.ape_mat_alu, postulantes.nom_alu"
        Orden = "postulaciones.vii_hor_eval,postulantes.ape_pat_alu, postulantes.ape_mat_alu, postulantes.nom_alu"
    End If
    Cadena = "postulantes.ci_alu = postulaciones.ci_alu and " & Codens & " and " & SelCursos & " " & jornada & " " & Anho & " " & Situacion & "order by " & Orden '& " " & Rangofechas
    Call Llenagrillapos(Cadena)
    If Len(Trim(Me.Grd_res_pos.TextMatrix(1, 0))) = 0 Then
        Me.Grd_res_pos.Enabled = False
    Else
        If Me.Opt_tipopostulante(6).Value Then
            Editargrilla = False
        Else
            Editargrilla = True
        End If
        Me.Grd_res_pos.Enabled = True
        Me.Grd_res_pos.SetFocus
        Me.Grd_res_pos.Row = 1: Me.Grd_res_pos.Col = 8: Me.Grd_res_pos.CellAlignment = 4
        Me.Grd_res_pos.Row = 1: Me.Grd_res_pos.Col = 7: Me.Grd_res_pos.CellAlignment = 4
        fila = Me.Grd_res_pos.Row: Columna = Me.Grd_res_pos.Col
        FilaAnt = Me.Grd_res_pos.Row: ColAnt = Me.Grd_res_pos.Col
    End If
Else
    MsgBox ("Faltan opciones por seleccionar")
End If

End Sub

Private Sub chk_todos_niveles_reg_Click()
If Me.chk_todos_niveles_reg.Value Then
    For t = 0 To Me.lst_niveles_reg.ListCount - 1
        Me.lst_niveles_reg.Selected(t) = True
    Next t
Else
    For t = 0 To Me.lst_niveles_reg.ListCount - 1
        Me.lst_niveles_reg.Selected(t) = False
        Me.lst_niveles_reg.ListIndex = 0
    Next t
End If
End Sub

Private Sub cmb_anho_reg_Click()
'Me.Frame_tipobusqueda_reg.Enabled = True
'For t = 0 To Me.Frame_fechas_reg.Count - 1
'    Me.Frame_fechas_reg(t).Enabled = True
'Next t
'Me.cmb_fechaexa_reg.Clear
'Me.cmb_fechaexa1_reg.Clear
' Me.cmb_fechaexa2_reg.Clear
'Me.Dtp_fecha1_reg.Value = Date
'Me.Dtp_fecha1_reg.Value = Date
'For t = 0 To Me.opt_tipobusqueda_reg.Count - 1
    'If Me.opt_tipobusqueda_reg(t).Value Then
    '    Me.opt_tipobusqueda_reg(t).Value = False
    '    Me.opt_tipobusqueda_reg(t).Value = True
    '    Exit For
    'End If
'Next t

End Sub

Private Sub cmb_anho_reg_KeyPress(KeyAscii As Integer)
KeyAscii = 0
End Sub

Private Sub cmb_jor_reg_KeyPress(KeyAscii As Integer)
KeyAscii = 0
End Sub

Private Sub cmb_mod_reg_Click()
Me.chk_todos_niveles_reg.Enabled = True
Me.chk_todos_niveles_reg.Value = 0
modalidad = devuelvecampo("codigos_ensenanza", "", "cod_ens", "des_ens = '" & Me.cmb_mod_reg.Text & "'", conn)
rs.CursorLocation = adUseClient
rs.Open "SELECT * FROM codigos_ensenanza where cod_ens ='" & modalidad & "'", conn
If rs.RecordCount > 0 Then
    Me.lst_niveles_reg.Clear
    For t = 1 To Val(rs("num_gra_max"))
        lst_niveles_reg.AddItem t
    Next t
    Me.chk_todos_niveles_reg.Enabled = True
Else
    Me.chk_todos_niveles_reg.Enabled = False
End If
rs.Close
Call cmb_anho_reg_Click
End Sub

Private Sub cmb_mod_reg_KeyPress(KeyAscii As Integer)
KeyAscii = 0
End Sub

Private Sub Command1_Click()
Unload Me
End Sub

Private Sub Form_Load()
If Respos2 = "masivo" Then
    Set rs = New ADODB.Recordset
    'Call Form_main.hideframeimpresion2
    Me.Height = 7750
    Me.Width = 11745
    Me.Frame_postulantes.Top = 120
    Me.Frame_postulantes.Left = 129
    Me.Frame_postulantes.Visible = True
    Me.Grd_res_pos.FixedCols = 0
    Me.Grd_res_pos.FixedRows = 1
    Me.Grd_res_pos.FormatString = "R.U.N          |Apellido Paterno  |Apellido Materno  |Nombres                              |Nivel |Fecha evaluación|Fecha postulac.|Calificación|Situación final"
    CentrarForma Me
    Me.Show
    Call llenacombo(cmb_mod_reg, "codigos_ensenanza", "des_ens", "order by ord_ens", conn)
    'If CuentaReg("jornadas", "") > 0 Then
        'Me.cmb_jor_reg.AddItem "Todas"
        Call llenacombo(cmb_jor_reg, "jornadas", "des_jor", "", conn)
    'End If
    rs.CursorLocation = adUseClient
    rs.Open "select distinct anno_pos_alu from postulaciones order by anno_pos_alu", conn
    If rs.RecordCount > 0 Then
        While Not rs.EOF
            Me.cmb_anho_reg.AddItem rs("anno_pos_alu")
            rs.MoveNext
        Wend
    End If
    rs.Close
    Me.Opt_tipopostulante(5).Value = True
    Me.chk_todos_niveles_reg.Enabled = False
    'Me.Frame_tipobusqueda_reg.Enabled = False
    Me.opt_orden(0).Value = True
    'For t = 0 To Me.Frame_fechas_reg.Count - 1
    '    Me.Frame_fechas_reg(t).Enabled = False
    'Next t
    'Me.chk_fecha_reg.Enabled = False
    'Me.opt_tipobusqueda_reg(0).Value = True
End If
End Sub

Private Sub Form_Unload(Cancel As Integer)
Call menuhabilitado(True)
End Sub

Private Sub Grd_res_pos_KeyDown(KeyCode As Integer, Shift As Integer)
fila = Me.Grd_res_pos.Row
Columna = Me.Grd_res_pos.Col
If Editargrilla Then
    If Me.Grd_res_pos.Col = 7 And Me.Grd_res_pos.Row > 0 Then
        If KeyCode = 46 And Me.Grd_res_pos.Text <> "" Then
            Me.Grd_res_pos.Text = "": Me.Grd_res_pos.TextMatrix(fila, Columna + 1) = ""
            Call Grabasituacion(fila)
        ElseIf KeyCode = 8 And Len(Me.Grd_res_pos.Text) <> 0 Then
            If Len(Me.Grd_res_pos.Text) = 3 Then
                Me.Grd_res_pos.Text = Mid(Me.Grd_res_pos.Text, 1, Len(Me.Grd_res_pos.Text) - 2)
            Else
                Me.Grd_res_pos.Text = Mid(Me.Grd_res_pos.Text, 1, Len(Me.Grd_res_pos.Text) - 1)
            End If
            Me.Grd_res_pos.TextMatrix(fila, Columna + 1) = ""
            Call Grabasituacion(fila)
        End If
    
    ElseIf Me.Grd_res_pos.Col = 8 And Me.Grd_res_pos.Row > 0 Then
        If (KeyCode = 46 Or KeyCode = 8) And Me.Grd_res_pos.Text <> "" Then
            Me.Grd_res_pos.Text = "": Me.Grd_res_pos.TextMatrix(fila, Columna - 1) = ""
            Call Grabasituacion(fila)
        End If
    End If
End If
End Sub
Private Sub Grd_res_pos_KeyPress(KeyAscii As Integer)
Dim Escribaestado As Boolean
Escribaestado = False
If Editargrilla Then
    KeyAscii = Asc(UCase(Chr(KeyAscii)))
    If Me.Grd_res_pos.Row > 0 And Me.Grd_res_pos.Col = 7 Then
        If KeyAscii = 13 And (Me.Grd_res_pos.Row <> Me.Grd_res_pos.Rows - 1) Then
            Me.Grd_res_pos.Row = Me.Grd_res_pos.Row + 1
            Call Grd_res_pos_SelChange
        End If
        
        If Len(Me.Grd_res_pos.Text) = 0 Then
            If KeyAscii >= Asc("1") And KeyAscii <= Asc("7") Then
                Me.Grd_res_pos.Text = Me.Grd_res_pos.Text & Chr(KeyAscii)
                Me.Grd_res_pos.CellAlignment = 4
            End If
        ElseIf Len(Me.Grd_res_pos.Text) = 1 Then
            
            If Val(Me.Grd_res_pos.Text) >= 1 And Val(Me.Grd_res_pos.Text) <= 6 Then
                If KeyAscii >= Asc("0") And KeyAscii <= Asc("9") Then
                    Me.Grd_res_pos.Text = Me.Grd_res_pos.Text & Chr(KeyAscii)
                    Me.Grd_res_pos.CellAlignment = 4
                End If
            ElseIf Val(Me.Grd_res_pos.Text) = 7 Then
                If KeyAscii = Asc("0") Then
                    Me.Grd_res_pos.Text = Me.Grd_res_pos.Text & Chr(KeyAscii)
                    Me.Grd_res_pos.CellAlignment = 4
                End If
            End If
        ElseIf Len(Me.Grd_res_pos.Text) = 3 Then
            If KeyAscii >= Asc("1") And KeyAscii <= Asc("7") Then
                Me.Grd_res_pos.Text = ""
                Me.Grd_res_pos.Text = Me.Grd_res_pos.Text & Chr(KeyAscii)
                Me.Grd_res_pos.CellAlignment = 4
            End If
        End If
    
    ElseIf Me.Grd_res_pos.Row > 0 And Me.Grd_res_pos.Col = 8 Then
        'MsgBox ("se escribio " & Me.Grd_res_pos.Text)
        If KeyAscii = 13 And (Me.Grd_res_pos.Row <> Me.Grd_res_pos.Rows - 1) Then
            Me.Grd_res_pos.Row = Me.Grd_res_pos.Row + 1
            Call Grd_res_pos_SelChange
        End If
        If Me.Grd_res_pos.TextMatrix(fila, Columna - 1) <> "" Then
           
        If KeyAscii = Asc("A") Then
            If CInt(Mid(Me.Grd_res_pos.TextMatrix(fila, Columna - 1), 1, 1) & Mid(Me.Grd_res_pos.TextMatrix(fila, Columna - 1), 3, 1)) < 40 Then
                If MsgBox("El resultado de la evaluación es menor a 4,0." & Chr(13) & "¿Desea aceptar a alumno?", vbYesNo + vbQuestion) = vbYes Then
                    Escribaestado = True
                Else
                    Escribaestado = False
                End If
            Else
                Escribaestado = True
            End If
        ElseIf KeyAscii = Asc("R") Then
            If CInt(Mid(Me.Grd_res_pos.TextMatrix(fila, Columna - 1), 1, 1) & Mid(Me.Grd_res_pos.TextMatrix(fila, Columna - 1), 3, 1)) >= 40 Then
                If MsgBox("El resultado de la evaluación es mayor a 4,0." & Chr(13) & "¿Desea reprobar al alumno?", vbYesNo + vbQuestion) = vbYes Then
                    Escribaestado = True
                Else
                    Escribaestado = False
                End If
            Else
                Escribaestado = True
            End If
       ElseIf KeyAscii = Asc("P") Then
            Escribaestado = True
       End If
    Else
        If KeyAscii = Asc("F") Then
            Escribaestado = True
        End If
    End If
    
    If Escribaestado = True Then
        Me.Grd_res_pos.Text = ""
        Me.Grd_res_pos.Text = Chr(KeyAscii)
        Call Grabasituacion(fila)
        Me.Grd_res_pos.SetFocus
        Me.Grd_res_pos.Row = fila: Me.Grd_res_pos.Col = Columna
        Me.Grd_res_pos.CellAlignment = 4
    End If
    End If
End If
End Sub


Private Sub Grd_res_pos_RowColChange()
'Fila = Me.Grd_res_pos.Row
'Columna = Me.Grd_res_pos.Col
End Sub

Private Sub Grd_res_pos_SelChange()
If Editargrilla Then
    If fila > 0 And Columna = 7 Then
        FilaAnt = fila: ColAnt = Columna
        fila = Me.Grd_res_pos.Row: Columna = Me.Grd_res_pos.Col
        If fila > 0 And (Columna = 7 Or Columna = 8 Or Columna = 6) Then
            If Len(Me.Grd_res_pos.TextMatrix(FilaAnt, ColAnt)) >= 1 And Len(Me.Grd_res_pos.TextMatrix(FilaAnt, ColAnt)) < 3 Then
                If Len(Me.Grd_res_pos.TextMatrix(FilaAnt, ColAnt)) = 1 Then Me.Grd_res_pos.TextMatrix(FilaAnt, ColAnt) = Me.Grd_res_pos.TextMatrix(FilaAnt, ColAnt) & "0"
                Me.Grd_res_pos.Row = FilaAnt: Me.Grd_res_pos.Col = ColAnt
                Me.Grd_res_pos.CellAlignment = 4
                Select Case CInt(Me.Grd_res_pos.TextMatrix(FilaAnt, ColAnt))
                    Case 40 To 70
                        Colorcel = &HFF0000
                        Me.Grd_res_pos.TextMatrix(FilaAnt, ColAnt + 1) = "A"
                    Case Else
                        Colorcel = &HFF&
                        Me.Grd_res_pos.TextMatrix(FilaAnt, ColAnt + 1) = "R"
                End Select
                If Len(Me.Grd_res_pos.TextMatrix(FilaAnt, ColAnt)) = 2 Then
                    Call Grabasituacion(FilaAnt)
                End If
                Me.Grd_res_pos.Row = FilaAnt: Me.Grd_res_pos.Col = ColAnt: Me.Grd_res_pos.CellForeColor = Colorcel
                Me.Grd_res_pos.TextMatrix(FilaAnt, ColAnt) = Mid(Me.Grd_res_pos.TextMatrix(FilaAnt, ColAnt), 1, 1) & "," & Mid(Me.Grd_res_pos.TextMatrix(FilaAnt, ColAnt), 2, 1)
            End If
            Me.Grd_res_pos.SetFocus
            Me.Grd_res_pos.Row = fila: Me.Grd_res_pos.Col = Columna
            'Me.Grd_res_pos.CellAlignment = 4

        End If
    End If
End If
End Sub

