VERSION 5.00
Object = "{5E9E78A0-531B-11CF-91F6-C2863C385E30}#1.0#0"; "MSFLXGRD.OCX"
Begin VB.Form Form_fichabeca 
   BorderStyle     =   1  'Fixed Single
   Caption         =   "Ingreso de Postulacion a Beca"
   ClientHeight    =   8190
   ClientLeft      =   1185
   ClientTop       =   2130
   ClientWidth     =   13335
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MDIChild        =   -1  'True
   MinButton       =   0   'False
   ScaleHeight     =   8190
   ScaleWidth      =   13335
   Begin VB.TextBox TxtPnttotal1 
      BeginProperty Font 
         Name            =   "Arial"
         Size            =   8.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   285
      Left            =   4560
      Locked          =   -1  'True
      TabIndex        =   70
      Top             =   7200
      Width           =   735
   End
   Begin VB.Frame Frame2 
      Caption         =   "Hermanos"
      Enabled         =   0   'False
      BeginProperty Font 
         Name            =   "Arial"
         Size            =   8.25
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H00C00000&
      Height          =   1215
      Left            =   2880
      TabIndex        =   63
      Top             =   4560
      Width           =   2745
      Begin VB.TextBox Txtestudio 
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   285
         Left            =   1440
         TabIndex        =   66
         Top             =   360
         Width           =   1095
      End
      Begin VB.TextBox Txtestudioptj 
         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          =   285
         Left            =   1680
         Locked          =   -1  'True
         TabIndex        =   64
         Top             =   720
         Width           =   855
      End
      Begin VB.Label Label7 
         Caption         =   "Gasto Estudios"
         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        =   67
         Top             =   360
         Width           =   1335
      End
      Begin VB.Label Label5 
         Caption         =   "Puntaje Obtenido"
         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        =   65
         Top             =   720
         Width           =   1575
      End
   End
   Begin VB.ListBox List1 
      BeginProperty Font 
         Name            =   "Arial"
         Size            =   8.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   1530
      Left            =   3960
      TabIndex        =   9
      Top             =   720
      Visible         =   0   'False
      Width           =   3975
   End
   Begin VB.ListBox List2 
      BeginProperty Font 
         Name            =   "Arial"
         Size            =   8.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   1530
      Left            =   8520
      TabIndex        =   8
      Top             =   720
      Visible         =   0   'False
      Width           =   1455
   End
   Begin VB.Frame Frame1 
      Caption         =   "Informe de Mensualidades"
      Enabled         =   0   'False
      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            =   5760
      TabIndex        =   59
      Top             =   1320
      Width           =   7455
      Begin MSFlexGridLib.MSFlexGrid GrillaDtll 
         Height          =   1695
         Left            =   120
         TabIndex        =   60
         Top             =   240
         Width           =   7215
         _ExtentX        =   12726
         _ExtentY        =   2990
         _Version        =   393216
         Cols            =   5
         FixedCols       =   0
         AllowBigSelection=   0   'False
         FormatString    =   "Folio|^Mes|^Total a pagar|^Total abonado|^Estado"
         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
   End
   Begin VB.Frame FrmAnteconomicos 
      Caption         =   "Antecedentes económicos"
      Enabled         =   0   'False
      BeginProperty Font 
         Name            =   "Arial"
         Size            =   8.25
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H00C00000&
      Height          =   1215
      Left            =   120
      TabIndex        =   15
      Top             =   5880
      Width           =   13095
      Begin VB.TextBox TxtPntingreso 
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   285
         Left            =   11760
         Locked          =   -1  'True
         TabIndex        =   68
         Top             =   720
         Width           =   1095
      End
      Begin VB.TextBox TxtPnteconomicos 
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   285
         Left            =   4440
         Locked          =   -1  'True
         TabIndex        =   51
         Top             =   600
         Width           =   855
      End
      Begin VB.TextBox TxtIntegrantes 
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   285
         Left            =   8640
         MaxLength       =   2
         TabIndex        =   18
         TabStop         =   0   'False
         Top             =   600
         Width           =   855
      End
      Begin VB.ComboBox CmbSitlaboral 
         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
         Style           =   2  'Dropdown List
         TabIndex        =   17
         TabStop         =   0   'False
         Top             =   600
         Width           =   2535
      End
      Begin VB.TextBox TxtIngresos 
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   285
         Left            =   11760
         MaxLength       =   8
         TabIndex        =   16
         TabStop         =   0   'False
         Top             =   360
         Width           =   1095
      End
      Begin VB.Label Label8 
         Caption         =   "Puntaje Obtenido"
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   255
         Left            =   10200
         TabIndex        =   69
         Top             =   720
         Width           =   1575
      End
      Begin VB.Label LblPntEconomicos 
         Caption         =   "Puntaje Obtenido"
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   255
         Left            =   2880
         TabIndex        =   52
         Top             =   600
         Width           =   1455
      End
      Begin VB.Label LblSituacionlaboral 
         Caption         =   "Situación laboral del jefe de hogar"
         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        =   22
         Top             =   360
         Width           =   2535
      End
      Begin VB.Label LblGrupofamiliar 
         Caption         =   "Del Grupo Familiar"
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   255
         Left            =   5760
         TabIndex        =   21
         Top             =   240
         Width           =   1455
      End
      Begin VB.Label LblIntegrantes 
         Caption         =   "Número de integrantes grupo familiar"
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   255
         Left            =   5760
         TabIndex        =   20
         Top             =   600
         Width           =   2655
      End
      Begin VB.Label LblIngresos 
         Caption         =   "Ingresos de la familia $"
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   255
         Left            =   9960
         TabIndex        =   19
         Top             =   360
         Width           =   1695
      End
      Begin VB.Line Line1 
         BorderColor     =   &H8000000C&
         X1              =   5520
         X2              =   5520
         Y1              =   105
         Y2              =   1200
      End
   End
   Begin VB.Frame FrmCalificaciones 
      Caption         =   "De las Calificaciones"
      Enabled         =   0   'False
      BeginProperty Font 
         Name            =   "Arial"
         Size            =   8.25
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H00C00000&
      Height          =   2655
      Left            =   120
      TabIndex        =   53
      Top             =   3120
      Width           =   2655
      Begin VB.TextBox TxtPntNotas 
         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          =   285
         Left            =   1680
         Locked          =   -1  'True
         TabIndex        =   55
         Top             =   1440
         Width           =   855
      End
      Begin VB.CommandButton btnactualizanotas 
         Caption         =   "Actualizar 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            =   600
         TabIndex        =   54
         Top             =   2040
         Visible         =   0   'False
         Width           =   1335
      End
      Begin MSFlexGridLib.MSFlexGrid GrdNotas 
         Height          =   735
         Left            =   120
         TabIndex        =   56
         Top             =   480
         Width           =   2415
         _ExtentX        =   4260
         _ExtentY        =   1296
         _Version        =   393216
         Cols            =   3
         FixedCols       =   0
         AllowBigSelection=   0   'False
         FormatString    =   "^ 1 Sem.|^ 2 Sem.|^ General"
         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.Line Line5 
         BorderColor     =   &H8000000C&
         X1              =   0
         X2              =   2610
         Y1              =   1320
         Y2              =   1320
      End
      Begin VB.Label LblPntNotas 
         Caption         =   "Puntaje Obtenido"
         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        =   58
         Top             =   1440
         Width           =   1575
      End
      Begin VB.Label Label6 
         Caption         =   "Promedio del Alumno"
         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        =   57
         Top             =   240
         Width           =   1695
      End
   End
   Begin VB.CommandButton BtnCalcular 
      Caption         =   "Guardar Ficha"
      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          =   855
      Left            =   11760
      Picture         =   "Form_fichabeca.frx":0000
      Style           =   1  'Graphical
      TabIndex        =   49
      Top             =   7200
      Width           =   1455
   End
   Begin VB.Frame Frame_individual 
      Enabled         =   0   'False
      Height          =   1335
      Left            =   120
      TabIndex        =   40
      Top             =   1680
      Width           =   5535
      Begin VB.TextBox txt_nivel_alu 
         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          =   285
         Left            =   960
         TabIndex        =   45
         Top             =   240
         Width           =   255
      End
      Begin VB.TextBox txt_apo_alu 
         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          =   285
         Left            =   960
         TabIndex        =   44
         Top             =   600
         Width           =   4455
      End
      Begin VB.TextBox txt_estado_alu 
         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          =   285
         Left            =   960
         TabIndex        =   43
         Top             =   960
         Width           =   4455
      End
      Begin VB.TextBox txt_letra_alu 
         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          =   285
         Left            =   1200
         TabIndex        =   42
         Top             =   240
         Width           =   255
      End
      Begin VB.TextBox txt_mod_alu 
         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          =   285
         Left            =   1440
         TabIndex        =   41
         Top             =   240
         Width           =   3975
      End
      Begin VB.Label Label14 
         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            =   120
         TabIndex        =   48
         Top             =   240
         Width           =   495
      End
      Begin VB.Label Label15 
         Caption         =   "Apoderado"
         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        =   47
         Top             =   600
         Width           =   855
      End
      Begin VB.Label Label17 
         Caption         =   "Estado"
         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        =   46
         Top             =   960
         Width           =   855
      End
   End
   Begin VB.TextBox TxtPnttotal 
      BeginProperty Font 
         Name            =   "Arial"
         Size            =   8.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   285
      Left            =   1800
      Locked          =   -1  'True
      TabIndex        =   37
      Top             =   7200
      Width           =   735
   End
   Begin VB.Frame FrmEnfermedades 
      Caption         =   "Enfermedad Grave o Catastrófica"
      Enabled         =   0   'False
      BeginProperty Font 
         Name            =   "Arial"
         Size            =   8.25
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H00C00000&
      Height          =   1095
      Left            =   5760
      TabIndex        =   29
      Top             =   4680
      Width           =   7455
      Begin VB.TextBox Txtgastoenfermedad 
         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
         TabIndex        =   61
         Top             =   240
         Width           =   1095
      End
      Begin VB.TextBox TxtPntEnfermedad 
         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        =   34
         Top             =   600
         Width           =   1095
      End
      Begin VB.CheckBox ChkEnfermedades 
         Caption         =   "Madre"
         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            =   240
         TabIndex        =   33
         Top             =   600
         Width           =   1935
      End
      Begin VB.CheckBox ChkEnfermedades 
         Caption         =   "Hermanos"
         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            =   2280
         TabIndex        =   32
         Top             =   285
         Width           =   1695
      End
      Begin VB.CheckBox ChkEnfermedades 
         Caption         =   "Alumno"
         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            =   2280
         TabIndex        =   31
         Top             =   555
         Width           =   1935
      End
      Begin VB.CheckBox ChkEnfermedades 
         Caption         =   "Padre"
         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            =   240
         TabIndex        =   30
         Top             =   285
         Width           =   1935
      End
      Begin VB.Label Label4 
         Caption         =   "Gasto Enfermedad"
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   255
         Left            =   4560
         TabIndex        =   62
         Top             =   240
         Width           =   1455
      End
      Begin VB.Label LblPntEnfermedad 
         Caption         =   "Puntaje Obtenido"
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   255
         Left            =   4560
         TabIndex        =   35
         Top             =   600
         Width           =   1575
      End
   End
   Begin VB.Frame FrmAntvivienda 
      Caption         =   "Antecedentes de la Vivienda"
      Enabled         =   0   'False
      BeginProperty Font 
         Name            =   "Arial"
         Size            =   8.25
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H00C00000&
      Height          =   1095
      Left            =   5760
      TabIndex        =   23
      Top             =   3480
      Width           =   7455
      Begin VB.TextBox TxtPntvivienda 
         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        =   26
         Top             =   600
         Width           =   1095
      End
      Begin VB.TextBox TxtMontovivienda 
         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
         MaxLength       =   6
         TabIndex        =   25
         TabStop         =   0   'False
         Top             =   240
         Width           =   1095
      End
      Begin VB.ComboBox CmbVivienda 
         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
         Style           =   2  'Dropdown List
         TabIndex        =   24
         TabStop         =   0   'False
         Top             =   360
         Width           =   3375
      End
      Begin VB.Label LblPntVivienda 
         Caption         =   "Puntaje Obtenido"
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   255
         Left            =   4560
         TabIndex        =   28
         Top             =   600
         Width           =   1455
      End
      Begin VB.Label LblMontovivienda 
         Caption         =   "Monto arriendo o dividendo"
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   255
         Left            =   3960
         TabIndex        =   27
         Top             =   240
         Width           =   2415
      End
   End
   Begin VB.Frame FrmJefehogar 
      Caption         =   "¿Quien es el Jefe de Hogar?"
      Enabled         =   0   'False
      BeginProperty Font 
         Name            =   "Arial"
         Size            =   8.25
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H00C00000&
      Height          =   1455
      Left            =   2880
      TabIndex        =   11
      Top             =   3120
      Width           =   2745
      Begin VB.TextBox Txtpntjefehogar 
         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          =   285
         Left            =   1680
         Locked          =   -1  'True
         TabIndex        =   13
         Top             =   960
         Width           =   855
      End
      Begin VB.ComboBox CmbJefehogar 
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   330
         ItemData        =   "Form_fichabeca.frx":04AF
         Left            =   120
         List            =   "Form_fichabeca.frx":04B1
         Style           =   2  'Dropdown List
         TabIndex        =   12
         TabStop         =   0   'False
         Top             =   360
         Width           =   2535
      End
      Begin VB.Label LblPntJefehogar 
         Caption         =   "Puntaje Obtenido"
         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        =   14
         Top             =   960
         Width           =   1455
      End
   End
   Begin VB.Frame Frame_Alu 
      Caption         =   "Alumno"
      Enabled         =   0   'False
      BeginProperty Font 
         Name            =   "Arial"
         Size            =   8.25
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H00C00000&
      Height          =   1095
      Left            =   3120
      TabIndex        =   0
      Top             =   120
      Width           =   10095
      Begin VB.CommandButton Btn_Cancelar 
         Caption         =   "Cambiar 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            =   8520
         Picture         =   "Form_fichabeca.frx":04B3
         Style           =   1  'Graphical
         TabIndex        =   39
         Top             =   240
         Width           =   1455
      End
      Begin VB.TextBox Text1 
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   285
         Left            =   840
         TabIndex        =   2
         Text            =   "Text1"
         Top             =   360
         Width           =   3975
      End
      Begin VB.TextBox Text2 
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   285
         Left            =   5400
         TabIndex        =   3
         Text            =   "Text2"
         Top             =   360
         Width           =   1455
      End
      Begin VB.ComboBox Cmb_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            =   7440
         Style           =   2  'Dropdown List
         TabIndex        =   4
         Top             =   360
         Width           =   855
      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        =   7
         Top             =   360
         Width           =   735
      End
      Begin VB.Label Label2 
         Caption         =   "Run:"
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   255
         Left            =   5040
         TabIndex        =   6
         Top             =   360
         Width           =   495
      End
      Begin VB.Label Label3 
         Caption         =   "Año:"
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   255
         Left            =   6960
         TabIndex        =   5
         Top             =   360
         Width           =   375
      End
   End
   Begin VB.Frame FrmTipobeca 
      Caption         =   "Tipo Beca"
      BeginProperty Font 
         Name            =   "Arial"
         Size            =   8.25
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H00C00000&
      Height          =   1455
      Left            =   120
      TabIndex        =   10
      Top             =   120
      Width           =   2880
      Begin VB.ComboBox Combo1 
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   330
         ItemData        =   "Form_fichabeca.frx":0AD9
         Left            =   120
         List            =   "Form_fichabeca.frx":0AE3
         TabIndex        =   73
         Text            =   "Seleccione Socioeconomica"
         Top             =   960
         Visible         =   0   'False
         Width           =   2535
      End
      Begin VB.ComboBox ComLibredisp 
         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        =   72
         Text            =   "Seleccione Libre Disponibilidad"
         Top             =   600
         Visible         =   0   'False
         Width           =   2535
      End
      Begin VB.ComboBox CmbTipobecas 
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   330
         ItemData        =   "Form_fichabeca.frx":0B04
         Left            =   120
         List            =   "Form_fichabeca.frx":0B06
         TabIndex        =   1
         Text            =   "Seleccione tipo de Beca"
         Top             =   240
         Width           =   2535
      End
   End
   Begin VB.CommandButton BtnGuardar 
      Caption         =   "Guardar Ficha"
      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          =   495
      Left            =   120
      Picture         =   "Form_fichabeca.frx":0B08
      Style           =   1  'Graphical
      TabIndex        =   36
      Top             =   7560
      Visible         =   0   'False
      Width           =   1575
   End
   Begin VB.Label LblPnttotal 
      Caption         =   "PUNTAJE TOTAL"
      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        =   38
      Top             =   7200
      Width           =   1575
   End
   Begin VB.Label lbbeca 
      BeginProperty Font 
         Name            =   "Arial"
         Size            =   8.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H000000FF&
      Height          =   855
      Left            =   5400
      TabIndex        =   50
      Top             =   7200
      Visible         =   0   'False
      Width           =   6135
   End
   Begin VB.Label Label9 
      Caption         =   "SUMA PUNTAJES"
      BeginProperty Font 
         Name            =   "Arial"
         Size            =   8.25
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   255
      Left            =   2760
      TabIndex        =   71
      Top             =   7200
      Width           =   1575
   End
End
Attribute VB_Name = "Form_fichabeca"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
' Variables Generales
Dim Flag_sub As Boolean
Dim swliq  As Boolean

Private Sub Btn_Cancelar_Click()
    Flag_sub = True
    Text1.Locked = False
    Text1.Text = ""
    Text2.Locked = False
    Text2.Text = ""
    lbbeca.Visible = False
    lbbeca.Caption = ""
    Me.txt_nivel_alu.Text = ""
    Me.txt_letra_alu.Text = ""
    Me.txt_mod_alu.Text = ""
    Me.txt_apo_alu.Text = ""
    Me.txt_estado_alu.Text = ""
    GrdNotas.TextMatrix(1, 0) = ""
    GrdNotas.TextMatrix(1, 1) = ""
    GrdNotas.TextMatrix(1, 2) = ""
    TxtPntNotas.Text = ""
    TxtPnteconomicos.Text = ""
    Txtpntjefehogar.Text = ""
    TxtPntEnfermedad.Text = ""
    TxtPntvivienda.Text = ""
    TxtPnttotal = ""
    TxtIntegrantes.Text = ""
    TxtMontovivienda.Text = ""
    TxtIngresos.Text = ""
    TxtPntingreso.Text = ""
    Txtestudio.Text = ""
    Txtestudioptj.Text = ""
    CmbSitlaboral.ListIndex = -1
    CmbJefehogar.ListIndex = -1
    CmbVivienda.ListIndex = -1
    TxtPnttotal1.Text = ""
    GrillaDtll.Rows = 1
    'GrillaDtll.Visible = False
    btnactualizanotas.Visible = False
    For t = 0 To 3
        Me.ChkEnfermedades(t).Value = 0
    Next t
    Flag_sub = False
End Sub

Private Sub btnactualizanotas_Click()
    TraeNotas
End Sub

Private Sub BtnCalcular_Click()
    cant = 0
    If Text2.Text = "" Then Call validatexto(Text1, "Seleccione Alumno"): Exit Sub
    If Me.CmbTipobecas.ListIndex = -1 Then MsgBox ("Seleccione Tipo de Beca"): Me.CmbTipobecas.SetFocus: Exit Sub
    If Me.CmbJefehogar.ListIndex = -1 Then MsgBox ("Seleccione Jefe de Hogar"): Me.CmbJefehogar.SetFocus: Exit Sub
    If Me.CmbVivienda.ListIndex = -1 Then MsgBox ("Seleccione Tipo Vivienda"): Me.CmbVivienda.SetFocus: Exit Sub
    If Me.CmbSitlaboral.ListIndex = -1 Then MsgBox ("Seleccione Situación Laboral del Jefe de Hogar"): Me.CmbSitlaboral.SetFocus: Exit Sub
    If Len(Trim(Me.TxtIngresos)) = 0 Then Call validatexto(TxtIngresos, "Ingrese Monto de Ingreso"): Exit Sub
    If Len(Trim(Me.TxtIntegrantes)) = 0 Then Call validatexto(TxtIntegrantes, "Ingrese Nº de integrantes de la familia"): Exit Sub
    If Len(Trim(Me.TxtMontovivienda)) = 0 Then Call validatexto(TxtMontovivienda, "Ingrese Monto de Vivienda"): Exit Sub
    
    
    Dim ptjjefehogar, ptjpromedio, ptjvivienda, ptjsituacionlaboral, ptjarrdiv, ptjenfermedad, ptjingresofamiliar As Long
    ptjjefehogar = Puntaje_JefeHogar(CmbJefehogar.Text, val(Cmb_Agno.Text), conn)
    ptjpromedio = Puntaje_Notas(val(Replace(GrdNotas.TextMatrix(1, 2), ",", "")), val(Cmb_Agno.Text), conn)
    ptjvivienda = Puntaje_Vivienda(CmbVivienda.Text, val(Cmb_Agno.Text), conn)
    ptjsituacionlaboral = Puntaje_SituacionLaboral(CmbSitlaboral.Text, val(Cmb_Agno.Text), conn)
    ptjarrdiv = Puntaje_ArrDiv(val(TxtIngresos.Text), val(TxtMontovivienda.Text), val(Cmb_Agno.Text), conn)
    
    'Aquí calculo la tabla enfermedades
    ptjenfermedad = 0
    ptjvalcatastrofica = Puntaje_EnfCatGasto(val(TxtIngresos.Text), val(Txtgastoenfermedad.Text), val(Cmb_Agno.Text), conn)
    ptjesthermanos = Puntaje_EstudiosHermanos(val(TxtIngresos.Text), val(TxtIntegrantes.Text), val(Txtestudio.Text), val(Cmb_Agno.Text), conn)
    
    For t = 0 To 3
        If Me.ChkEnfermedades(t).Value = 1 Then
            ptjenfermedad = ptjenfermedad + Puntaje_EnfermedadCatastrofica(ChkEnfermedades(t).Caption, Cmb_Agno.Text, conn)
            cant = cant + 1
        End If
    Next t
    ptjingresofamiliar = Puntaje_IngresoFamiliar(TxtIngresos.Text, TxtIntegrantes.Text, Cmb_Agno.Text, conn)
    If cant > 0 Then
        ptjenfermedad = ptjenfermedad / cant
    End If
    TxtPntNotas.Text = ptjpromedio
    
    Txtpntjefehogar.Text = ptjjefehogar
    TxtPnteconomicos.Text = ptjsituacionlaboral
    TxtPntingreso.Text = ptjingresofamiliar
    TxtPntvivienda.Text = (ptjvivienda * 0.7) + (ptjarrdiv * 0.3)
    TxtPntEnfermedad.Text = (ptjenfermedad * 0.5) + (ptjvalcatastrofica * 0.5)
    Txtestudioptj.Text = ptjesthermanos
    
    
    
    TxtPnttotal.Text = (val(Txtpntjefehogar.Text) * 0.05) + (val(TxtPnteconomicos.Text) * 0.15) + (val(TxtPntingreso.Text) * 0.45) + (val(TxtPntvivienda.Text) * 0.15) + (val(TxtPntEnfermedad.Text) * 0.15) + (val(Txtestudioptj.Text) * 0.05)
    TxtPnttotal1.Text = val(Txtpntjefehogar.Text) + val(TxtPnteconomicos.Text) + val(TxtPntingreso.Text) + val(TxtPntvivienda.Text) + val(TxtPntEnfermedad.Text) + val(Txtestudioptj.Text)
    
    
    Call BtnGuardar_Click
    
    MsgBox "La postulación a beca ha sido guardada exitosamente", vbInformation
        
End Sub

Private Sub BtnGuardar_Click()

    If Text2.Text = "" Then Call validatexto(Text1, "Seleccione Alumno"): Exit Sub
    If Me.CmbTipobecas.ListIndex = -1 Then MsgBox ("Seleccione tipo de Beca"): Me.CmbTipobecas.SetFocus: Exit Sub
    If Me.CmbTipobecas.ListIndex = 0 Or Me.CmbTipobecas.ListIndex = 1 Then
        If Me.Combo1.ListIndex <> 0 Then
    
        If Me.CmbJefehogar.ListIndex = -1 Then MsgBox ("Seleccione Jefe de Hogar"): Me.CmbJefehogar.SetFocus: Exit Sub
        If Me.CmbSitlaboral.ListIndex = -1 Then MsgBox ("Seleccione Situación Laboral"): Me.CmbSitlaboral.SetFocus: Exit Sub
        If Len(Trim(Me.TxtIntegrantes)) = 0 Then Call validatexto(TxtIntegrantes, "Ingrese Nº de integrantes"): Exit Sub
        If Len(Trim(Me.TxtIngresos)) = 0 Then Call validatexto(TxtIngresos, "Ingrese Monto de Ingreso"): Exit Sub
        If Me.CmbVivienda.ListIndex = -1 Then MsgBox ("Seleccione Tipo Vivienda"): Me.CmbVivienda.SetFocus: Exit Sub
        If Len(Trim(Me.TxtMontovivienda)) = 0 Then Call validatexto(TxtMontovivienda, "Ingrese Monto de Vivienda"): Exit Sub
        'BtnCalcular_Click
        If swliq Then
            If (MsgBox("El alumno se encuentra con cuotas impagas, Esta seguro de guardar los cambios?", vbYesNo, "Becas") <> 6) Then
                Exit Sub
            End If
        End If
    End If
    End If
    If (MsgBox("Esta seguro de guardar los cambios?", vbYesNo, "Becas") = 6) Then
        Dim RsAux As ADODB.Recordset
        Set RsAux = New ADODB.Recordset
        RsAux.Open "select * from becas_fichas where ci_alumno = '" & Text2.Text & "';", conn
        conn.Execute "UPDATE becas_fichas SET asignada = 0 WHERE ci_alumno = '" & Text2.Text & "'"
        If RsAux.RecordCount > 0 Then
            'update
            If Me.CmbTipobecas.ListIndex = 0 Then
            Query = "UPDATE becas_fichas SET agno=" & Cmb_Agno.Text & ",promedio1s='" & GrdNotas.TextMatrix(1, 0) & "',promedio2s='" & GrdNotas.TextMatrix(1, 1) & "',promediog='" & GrdNotas.TextMatrix(1, 2) & "',ptj_promedio=" & TxtPntNotas.Text & ",jefehogar='" & CmbJefehogar.Text & "',ptj_jefehogar=" & Txtpntjefehogar.Text & "," & _
            "situacionlab='" & CmbSitlaboral.Text & "',ptj_situacionlab=" & TxtPnteconomicos.Text & ",vivienda='" & CmbVivienda.Text & "',ingresofamiliar=" & TxtIngresos.Text & ",ptj_anteco=" & TxtPnteconomicos.Text & ",cantidadfamilia=" & _
            TxtIntegrantes & ",montoarriendodiv=" & TxtMontovivienda.Text & ",ptj_antvivienda=" & Replace(TxtPntvivienda.Text, ",", ".") & ",enfcatpad=" & ChkEnfermedades(0).Value & ",enfcatmad=" & ChkEnfermedades(1).Value & ",enfcather=" & ChkEnfermedades(2).Value & _
            ",enfcatotro=" & ChkEnfermedades(3).Value & ",ptj_enfcat=" & Replace(TxtPntEnfermedad.Text, ",", ".") & ",puntaje=" & Replace(TxtPnttotal.Text, ",", ".") & ",becapostula='" & CmbTipobecas.Text & "'" & ",becapostula2='" & Combo1.Text & "',valorenfcat=" & Txtgastoenfermedad.Text & ",valorestuherma=" & Txtestudio.Text & ",ptj_esthermano=" & Replace(Txtestudioptj.Text, ",", ".") & ",ptj_ingresofam=" & Replace(TxtPntingreso.Text, ",", ".") & " WHERE ci_alumno ='" & Text2.Text & "'"
            ElseIf Me.CmbTipobecas.ListIndex = 1 Then
            Query = "UPDATE becas_fichas SET agno=" & Cmb_Agno.Text & ",promedio1s='" & GrdNotas.TextMatrix(1, 0) & "',promedio2s='" & GrdNotas.TextMatrix(1, 1) & "',promediog='" & GrdNotas.TextMatrix(1, 2) & "',ptj_promedio=" & TxtPntNotas.Text & ",jefehogar='" & CmbJefehogar.Text & "',ptj_jefehogar=" & Txtpntjefehogar.Text & "," & _
            "situacionlab='" & CmbSitlaboral.Text & "',ptj_situacionlab=" & TxtPnteconomicos.Text & ",vivienda='" & CmbVivienda.Text & "',ingresofamiliar=" & TxtIngresos.Text & ",ptj_anteco=" & TxtPnteconomicos.Text & ",cantidadfamilia=" & _
            TxtIntegrantes & ",montoarriendodiv=" & TxtMontovivienda.Text & ",ptj_antvivienda=" & Replace(TxtPntvivienda.Text, ",", ".") & ",enfcatpad=" & ChkEnfermedades(0).Value & ",enfcatmad=" & ChkEnfermedades(1).Value & ",enfcather=" & ChkEnfermedades(2).Value & _
            ",enfcatotro=" & ChkEnfermedades(3).Value & ",ptj_enfcat=" & Replace(TxtPntEnfermedad.Text, ",", ".") & ",puntaje=" & Replace(TxtPnttotal.Text, ",", ".") & ",becapostula='" & CmbTipobecas.Text & "'" & ",becapostula2=" & "' '" & ",valorenfcat=" & Txtgastoenfermedad.Text & ",valorestuherma=" & Txtestudio.Text & ",ptj_esthermano=" & Replace(Txtestudioptj.Text, ",", ".") & ",ptj_ingresofam=" & Replace(TxtPntingreso.Text, ",", ".") & " WHERE ci_alumno ='" & Text2.Text & "'"
            ElseIf Me.CmbTipobecas.ListIndex = 2 Then
            Query = "UPDATE becas_fichas SET agno=" & Cmb_Agno.Text & ",promedio1s='" & GrdNotas.TextMatrix(1, 0) & "',promedio2s='" & GrdNotas.TextMatrix(1, 1) & "',promediog='" & GrdNotas.TextMatrix(1, 2) & "',ptj_promedio=" & TxtPntNotas.Text & ",jefehogar='" & CmbJefehogar.Text & "',ptj_jefehogar=" & Txtpntjefehogar.Text & "," & _
            "situacionlab='" & CmbSitlaboral.Text & "',ptj_situacionlab=" & TxtPnteconomicos.Text & ",vivienda='" & CmbVivienda.Text & "',ingresofamiliar=" & TxtIngresos.Text & ",ptj_anteco=" & TxtPnteconomicos.Text & ",cantidadfamilia=" & _
            TxtIntegrantes & ",montoarriendodiv=" & TxtMontovivienda.Text & ",ptj_antvivienda=" & Replace(TxtPntvivienda.Text, ",", ".") & ",enfcatpad=" & ChkEnfermedades(0).Value & ",enfcatmad=" & ChkEnfermedades(1).Value & ",enfcather=" & ChkEnfermedades(2).Value & _
            ",enfcatotro=" & ChkEnfermedades(3).Value & ",ptj_enfcat=" & Replace(TxtPntEnfermedad.Text, ",", ".") & ",puntaje=" & Replace(TxtPnttotal.Text, ",", ".") & ",becapostula='" & CmbTipobecas.Text & "'" & ",becapostula2='" & ComLibredisp.Text & "',valorenfcat=" & Txtgastoenfermedad.Text & ",valorestuherma=" & Txtestudio.Text & ",ptj_esthermano=" & Replace(Txtestudioptj.Text, ",", ".") & ",ptj_ingresofam=" & Replace(TxtPntingreso.Text, ",", ".") & " WHERE ci_alumno ='" & Text2.Text & "'"

            End If
            
        Else
            'insert
            If Me.CmbTipobecas.ListIndex = 0 Then
                Query = "INSERT INTO becas_fichas (ci_alumno,agno,promedio1s,promedio2s,promediog,ptj_promedio,jefehogar,ptj_jefehogar,situacionlab,ptj_situacionlab,vivienda,ingresofamiliar,ptj_anteco,cantidadfamilia,montoarriendodiv,ptj_antvivienda,enfcatpad,enfcatmad,enfcather,enfcatotro,ptj_enfcat,puntaje,becapostula,becapostula2,valorenfcat,valorestuherma,ptj_esthermano,ptj_ingresofam) VALUES (" & _
                    "'" & Text2.Text & "'," & Cmb_Agno.Text & ",'" & GrdNotas.TextMatrix(1, 0) & "','" & GrdNotas.TextMatrix(1, 1) & "','" & GrdNotas.TextMatrix(1, 2) & "'," & TxtPntNotas.Text & ",'" & CmbJefehogar.Text & "'," & Txtpntjefehogar.Text & ",'" & CmbSitlaboral.Text & "'," & TxtPnteconomicos.Text & _
                    ",'" & CmbVivienda.Text & "'," & TxtIngresos.Text & "," & TxtPnteconomicos.Text & "," & TxtIntegrantes & "," & TxtMontovivienda.Text & "," & Replace(TxtPntvivienda.Text, ",", ".") & "," & ChkEnfermedades(0).Value & "," & ChkEnfermedades(1).Value & "," & ChkEnfermedades(2).Value & "," & ChkEnfermedades(3).Value & "," & _
                    Replace(TxtPntEnfermedad.Text, ",", ".") & "," & Replace(TxtPnttotal, ",", ".") & ",'" & CmbTipobecas.Text & "'," & "'" & Combo1.Text & "'," & Txtgastoenfermedad.Text & "," & Txtestudio.Text & "," & Replace(Txtestudioptj.Text, ",", ".") & "," & Replace(TxtPntingreso.Text, ",", ".") & ");"
             ElseIf Me.CmbTipobecas.ListIndex = 1 Then
                             Query = "INSERT INTO becas_fichas (ci_alumno,agno,promedio1s,promedio2s,promediog,ptj_promedio,jefehogar,ptj_jefehogar,situacionlab,ptj_situacionlab,vivienda,ingresofamiliar,ptj_anteco,cantidadfamilia,montoarriendodiv,ptj_antvivienda,enfcatpad,enfcatmad,enfcather,enfcatotro,ptj_enfcat,puntaje,becapostula,valorenfcat,valorestuherma,ptj_esthermano,ptj_ingresofam) VALUES (" & _
                    "'" & Text2.Text & "'," & Cmb_Agno.Text & ",'" & GrdNotas.TextMatrix(1, 0) & "','" & GrdNotas.TextMatrix(1, 1) & "','" & GrdNotas.TextMatrix(1, 2) & "'," & TxtPntNotas.Text & ",'" & CmbJefehogar.Text & "'," & Txtpntjefehogar.Text & ",'" & CmbSitlaboral.Text & "'," & TxtPnteconomicos.Text & _
                    ",'" & CmbVivienda.Text & "'," & TxtIngresos.Text & "," & TxtPnteconomicos.Text & "," & TxtIntegrantes & "," & TxtMontovivienda.Text & "," & Replace(TxtPntvivienda.Text, ",", ".") & "," & ChkEnfermedades(0).Value & "," & ChkEnfermedades(1).Value & "," & ChkEnfermedades(2).Value & "," & ChkEnfermedades(3).Value & "," & _
                    Replace(TxtPntEnfermedad.Text, ",", ".") & "," & Replace(TxtPnttotal, ",", ".") & ",'" & CmbTipobecas.Text & "'," & Txtgastoenfermedad.Text & "," & Txtestudio.Text & "," & Replace(Txtestudioptj.Text, ",", ".") & "," & Replace(TxtPntingreso.Text, ",", ".") & ");"
             ElseIf Me.CmbTipobecas.ListIndex = 2 Then
                             Query = "INSERT INTO becas_fichas (ci_alumno,agno,promedio1s,promedio2s,promediog,ptj_promedio,jefehogar,ptj_jefehogar,situacionlab,ptj_situacionlab,vivienda,ingresofamiliar,ptj_anteco,cantidadfamilia,montoarriendodiv,ptj_antvivienda,enfcatpad,enfcatmad,enfcather,enfcatotro,ptj_enfcat,puntaje,becapostula,becapostula2,valorenfcat,valorestuherma,ptj_esthermano,ptj_ingresofam) VALUES (" & _
                    "'" & Text2.Text & "'," & Cmb_Agno.Text & ",'" & GrdNotas.TextMatrix(1, 0) & "','" & GrdNotas.TextMatrix(1, 1) & "','" & GrdNotas.TextMatrix(1, 2) & "'," & TxtPntNotas.Text & ",'" & CmbJefehogar.Text & "'," & Txtpntjefehogar.Text & ",'" & CmbSitlaboral.Text & "'," & TxtPnteconomicos.Text & _
                    ",'" & CmbVivienda.Text & "'," & TxtIngresos.Text & "," & TxtPnteconomicos.Text & "," & TxtIntegrantes & "," & TxtMontovivienda.Text & "," & Replace(TxtPntvivienda.Text, ",", ".") & "," & ChkEnfermedades(0).Value & "," & ChkEnfermedades(1).Value & "," & ChkEnfermedades(2).Value & "," & ChkEnfermedades(3).Value & "," & _
                    Replace(TxtPntEnfermedad.Text, ",", ".") & "," & Replace(TxtPnttotal, ",", ".") & ",'" & CmbTipobecas.Text & "'," & "'" & ComLibredisp.Text & "'," & Txtgastoenfermedad.Text & "," & Txtestudio.Text & "," & Replace(Txtestudioptj.Text, ",", ".") & "," & Replace(TxtPntingreso.Text, ",", ".") & ");"
             End If
        End If
        RsAux.Close
        conn.Execute Query, Affected
        sql = "CREATE TABLE IF NOT EXISTS `becas_log`(`id` bigint(20) NOT NULL auto_increment,`LOGIN_USUARIO` varchar(100) NOT NULL default '',`NOMBRE_USUARIO` varchar(100) NOT NULL default '',`RUN_ALU` varchar(10) NOT NULL default '',`AGNO` int(11) NOT NULL default '0',`ASIGNADO` decimal(10,0) NOT NULL default '0',`ACCION` varchar(100) NOT NULL default '',`FECHA_MODIFICACION` datetime NOT NULL default '0000-00-00 00:00:00',PRIMARY KEY  (`id`),UNIQUE KEY `becas_log_sec_key` (`FECHA_MODIFICACION`,`LOGIN_USUARIO`),KEY `becas_log_index_one` (`RUN_ALU`,`AGNO`)) ENGINE=MyISAM;"
        conn.Execute sql
        sql = "INSERT INTO becas_log(LOGIN_USUARIO,NOMBRE_USUARIO,AGNO,FECHA_MODIFICACION,ACCION,RUN_ALU) VALUES ('" & Nom_usu_ses & "','" & Nom_com_usu_ses & "','" & Cmb_Agno.Text & "',concat(current_date,' ',current_time),'CREAR FICHA','" & Text2.Text & "');"
        conn.Execute sql
        
    End If
    
End Sub

Private Sub BtnSalir_Click()
    Unload Me
End Sub



Private Sub Chk_VerPagos_Click()
    If Chk_VerPagos.Caption = "Ver Pagos" Then
        GrillaDtll.Visible = True
        Chk_VerPagos.Caption = "Ocultar Pagos"
    Else
        GrillaDtll.Visible = False
        Chk_VerPagos.Caption = "Ver Pagos"
    End If
End Sub

Private Sub cmb_agno_Click()
    llena_cmb_jefehogar (val(Cmb_Agno.Text))
    llena_cmb_vivienda (val(Cmb_Agno.Text))
    llena_cmb_sitlaboral (val(Cmb_Agno.Text))
    If Text1.Text <> "" And Text2.Text <> "" Then
        llena_info_adicional
    End If
End Sub

Private Sub CmbTipobecas_Click()
If CmbTipobecas.Text = "Socioeconómica" Then
    ComLibredisp.Visible = False
    Combo1.Visible = True
    'socioeco
    Call activar_campos
End If
If CmbTipobecas.Text = "Socioeconómica Vulnerable" Then
    ComLibredisp.Visible = False
    Combo1.Visible = False
    Call activar_campos
    
End If
If CmbTipobecas.Text = "Libre Disponibilidad" Then
    'libredispo
    ComLibredisp.Visible = True
    Combo1.Visible = False
    Call activar_campos
End If
End Sub
Private Sub socioeco()
    ComLibredisp.Visible = False
    FrmJefehogar.Enabled = True
    CmbJefehogar.Enabled = True
    Txtpntjefehogar.Enabled = True
    LblPntJefehogar.Enabled = True
    FrmEnfermedades.Enabled = True
    FrmCalificaciones.Enabled = True
    Label6.Enabled = True
    GrdNotas.Enabled = True
    LblPntNotas.Enabled = True
    TxtPntNotas.Enabled = True
    btnactualizanotas.Enabled = True
    FrmAntvivienda.Enabled = True
    CmbVivienda.Enabled = True
    LblMontovivienda.Enabled = True
    TxtMontovivienda.Enabled = True
    LblPntVivienda.Enabled = True
    TxtPntvivienda.Enabled = True
    Frame2.Enabled = True
    Label7.Enabled = True
    Txtestudio.Enabled = True
    Label5.Enabled = True
    Txtestudioptj.Enabled = True
    FrmEnfermedades.Enabled = True
    ChkEnfermedades(0).Enabled = True
    ChkEnfermedades(1).Enabled = True
    ChkEnfermedades(2).Enabled = True
    ChkEnfermedades(3).Enabled = True
    Label4.Enabled = True
    Txtgastoenfermedad.Enabled = True
    LblPntEnfermedad.Enabled = True
    TxtPntEnfermedad.Enabled = True
    FrmAnteconomicos.Enabled = True
    LblSituacionlaboral.Enabled = True
    CmbSitlaboral.Enabled = True
    LblPntEconomicos.Enabled = True
    TxtPnteconomicos.Enabled = True
    LblGrupofamiliar.Enabled = True
    LblIntegrantes.Enabled = True
    TxtIntegrantes.Enabled = True
    LblIngresos.Enabled = True
    TxtIngresos.Enabled = True
    Label8.Enabled = True
    TxtPntingreso.Enabled = True
    LblPnttotal.Enabled = True
    TxtPnttotal.Enabled = True
    Label9.Enabled = True
    TxtPnttotal1.Enabled = True
    BtnCalcular.Enabled = True
    
    

End Sub
Private Sub libredispo()

    Txtpntjefehogar.Text = 0
    TxtPntNotas.Text = 0
    TxtPntvivienda.Text = 0
    Txtestudioptj.Text = 0
    TxtPntEnfermedad.Text = 0
    TxtPnteconomicos.Text = 0
    TxtPntingreso.Text = 0
    TxtPnttotal.Text = 0
    Txtpntjefehogar.Text = 0
    TxtIntegrantes = 0
    TxtPnttotal = 0
    Txtestudioptj.Text = 0
    
'    FrmJefehogar.Enabled = False
'    CmbJefehogar.Enabled = False
'    Txtpntjefehogar.Enabled = False
'    LblPntJefehogar.Enabled = False
'    FrmEnfermedades.Enabled = False
'    FrmCalificaciones.Enabled = False
'    Label6.Enabled = False
'    GrdNotas.Enabled = False
'    LblPntNotas.Enabled = False
'    TxtPntNotas.Enabled = False
'    btnactualizanotas.Enabled = False
'    FrmAntvivienda.Enabled = False
'    CmbVivienda.Enabled = False
'    LblMontovivienda.Enabled = False
'    TxtMontovivienda.Enabled = False
'    LblPntVivienda.Enabled = False
'    TxtPntvivienda.Enabled = False
'    Frame2.Enabled = False
'    Label7.Enabled = False
'    Txtestudio.Enabled = False
'    Label5.Enabled = False
'    Txtestudioptj.Enabled = False
'    FrmEnfermedades.Enabled = False
'    ChkEnfermedades(0).Enabled = False
'    ChkEnfermedades(1).Enabled = False
'    ChkEnfermedades(2).Enabled = False
'    ChkEnfermedades(3).Enabled = False
'    Label4.Enabled = False
'    Txtgastoenfermedad.Enabled = False
'    LblPntEnfermedad.Enabled = False
'    TxtPntEnfermedad.Enabled = False
'    FrmAnteconomicos.Enabled = False
'    LblSituacionlaboral.Enabled = False
'    CmbSitlaboral.Enabled = False
'    LblPntEconomicos.Enabled = False
'    TxtPnteconomicos.Enabled = False
'    LblGrupofamiliar.Enabled = False
'    LblIntegrantes.Enabled = False
'    TxtIntegrantes.Enabled = False
'    LblIngresos.Enabled = False
'    TxtIngresos.Enabled = False
'    Label8.Enabled = False
'    TxtPntingreso.Enabled = False
'    LblPnttotal.Enabled = False
'    TxtPnttotal.Enabled = False
'    Label9.Enabled = False
'    TxtPnttotal1.Enabled = False
'    BtnCalcular.Enabled = False
    
    ComLibredisp.Visible = False
    FrmJefehogar.Enabled = True
    CmbJefehogar.Enabled = True
    Txtpntjefehogar.Enabled = True
    LblPntJefehogar.Enabled = True
    FrmEnfermedades.Enabled = True
    FrmCalificaciones.Enabled = True
    Label6.Enabled = True
    GrdNotas.Enabled = True
    LblPntNotas.Enabled = True
    TxtPntNotas.Enabled = True
    btnactualizanotas.Enabled = True
    FrmAntvivienda.Enabled = True
    CmbVivienda.Enabled = True
    LblMontovivienda.Enabled = True
    TxtMontovivienda.Enabled = True
    LblPntVivienda.Enabled = True
    TxtPntvivienda.Enabled = True
    Frame2.Enabled = True
    Label7.Enabled = True
    Txtestudio.Enabled = True
    Label5.Enabled = True
    Txtestudioptj.Enabled = True
    FrmEnfermedades.Enabled = True
    ChkEnfermedades(0).Enabled = True
    ChkEnfermedades(1).Enabled = True
    ChkEnfermedades(2).Enabled = True
    ChkEnfermedades(3).Enabled = True
    Label4.Enabled = True
    Txtgastoenfermedad.Enabled = True
    LblPntEnfermedad.Enabled = True
    TxtPntEnfermedad.Enabled = True
    FrmAnteconomicos.Enabled = True
    LblSituacionlaboral.Enabled = True
    CmbSitlaboral.Enabled = True
    LblPntEconomicos.Enabled = True
    TxtPnteconomicos.Enabled = True
    LblGrupofamiliar.Enabled = True
    LblIntegrantes.Enabled = True
    TxtIntegrantes.Enabled = True
    LblIngresos.Enabled = True
    TxtIngresos.Enabled = True
    Label8.Enabled = True
    TxtPntingreso.Enabled = True
    LblPnttotal.Enabled = True
    TxtPnttotal.Enabled = True
    Label9.Enabled = True
    TxtPnttotal1.Enabled = True
    BtnCalcular.Enabled = True
       
End Sub


Private Sub Combo1_Click()

    Call activar_campos
    
End Sub

Private Sub ComLibredisp_Click()

  Call activar_campos
  
End Sub
Private Sub activar_campos()

    If (ComLibredisp.Text <> "Seleccione Libre Disponibilidad" And ComLibredisp.Visible = True) _
    Or (Combo1.Text <> "Seleccione Socioeconomica" And Combo1.Visible = True) _
    Or (CmbTipobecas.Text = "Socioeconómica Vulnerable") _
    Then
        Frame_individual.Enabled = True
        Frame_Alu.Enabled = True
        FrmCalificaciones.Enabled = True
        Frame1.Enabled = True
        FrmJefehogar.Enabled = True
        Frame2.Enabled = True
        FrmEnfermedades.Enabled = True
        FrmAnteconomicos.Enabled = True
        FrmAntvivienda.Enabled = True
        BtnCalcular.Enabled = True
        BtnGuardar.Enabled = True
        'BtnSalir.Enabled = True
    Else
        Frame_individual.Enabled = False
        Frame_Alu.Enabled = False
        FrmCalificaciones.Enabled = False
        Frame1.Enabled = False
        FrmJefehogar.Enabled = False
        Frame2.Enabled = False
        FrmEnfermedades.Enabled = False
        FrmAnteconomicos.Enabled = False
        FrmAntvivienda.Enabled = False
        BtnCalcular.Enabled = False
        BtnGuardar.Enabled = False
        'BtnSalir.Enabled = False
    End If
    
End Sub

Private Sub Form_Activate()
    If ManTab = "listaficha" Then
        llena_info_adicional
        ManTab = "fichapost"
    End If
End Sub

'######################
Private Sub Form_Load()
    CmbTipobecas.AddItem "Socioeconómica"
    CmbTipobecas.AddItem "Socioeconómica Vulnerable"
    CmbTipobecas.AddItem "Libre Disponibilidad"
    ComLibredisp.AddItem "Exelencia Academica"
    ComLibredisp.AddItem "Deportiva"
    ComLibredisp.AddItem "Funcionario"
  
    
    
    
    Btn_Cancelar_Click
    Flag_sub = True
    Text1.Text = ""
    Text2.Text = ""
    llena_cmb_jefehogar (Anno)
    llena_cmb_vivienda (Anno)
    llena_cmb_sitlaboral (Anno)
    Flag_sub = False
    Llena_Cmb_Agno
    Me.Left = 0
    Me.Top = 0
    ComLibredisp.Visible = False
    
    'Cmb_Agno.Text = Anno + 1

End Sub

Private Sub List1_Click()
    Dim RC As ADODB.Recordset
    Set RC = New ADODB.Recordset
    
    Text1.Text = List1.Text
    List1.Visible = False
    List2.Visible = False
    RC.Open "SELECT ci_alu FROM postulantes WHERE left(CONCAT(ape_Pat_alu,' ',ape_Mat_alu,' ',nom_alu)," & Len(Text1.Text) & ")='" & Text1.Text & "' ORDER BY ape_pat_alu, ape_mat_alu, nom_alu;", conn
    RC.MoveFirst
    Flag_sub = True
    Text2.Text = RC("ci_alu")
    RC.Close
    Flag_sub = False
    Text1.Locked = True
    Text2.Locked = True
    llena_info_adicional
End Sub

Private Sub List2_Click()
    Dim RC As ADODB.Recordset
    Set RC = New ADODB.Recordset
    
    Text2.Text = List2.Text
    List2.Visible = False
    List1.Visible = False
    RC.Open "SELECT CONCAT(ape_pat_alu,' ',ape_mat_alu,' ',nom_alu) as nombre_alu FROM postulantes WHERE ci_alu='" & Text2.Text & "' ORDER BY ci_alu;", conn
    RC.MoveFirst
    Flag_sub = True
    Text1.Text = RC("nombre_alu")
    RC.Close
    Flag_sub = False
    Text1.Locked = True
    Text2.Locked = True
    llena_info_adicional
End Sub

Private Sub Text1_Change()
    Dim RC As ADODB.Recordset
    ' Si el cambio lo hace un Sub no hacer nada
    If Flag_sub Then Exit Sub
    If Text1.Text = "" Then Exit Sub
    Set RC = New ADODB.Recordset
    RC.Open "SELECT DISTINCT a.ape_pat_alu, a.ape_mat_alu, a.nom_alu FROM postulantes a, matriculas m WHERE left(CONCAT(a.ape_pat_alu,' ',a.ape_mat_alu,' ',a.nom_alu)," & Len(Text1.Text) & ")='" & Text1.Text & "' AND a.ci_alu=m.ci_alu ORDER BY a.ape_pat_alu, a.ape_mat_alu, a.nom_alu;", conn
    List1.Clear
    If RC.RecordCount > 0 Then
        While Not (RC.EOF)
            List1.AddItem RC("ape_pat_alu") & " " & RC("ape_mat_alu") & " " & RC("nom_alu")
            RC.MoveNext
        Wend
        List1.Visible = True
        List2.Visible = False
    End If
    RC.Close
End Sub

Private Sub Text1_KeyPress(KeyAscii As Integer)
    KeyAscii = Asc(UCase(Chr(KeyAscii)))
End Sub

Private Sub Text2_Change()
    Dim RC As ADODB.Recordset
    ' Si el cambio lo hace un Sub no hacer nada
    If Flag_sub Then Exit Sub
    If Text2.Text = "" Then Exit Sub
    Set RC = New ADODB.Recordset
    
    RC.Open "SELECT DISTINCT a.ci_alu FROM postulantes a, matriculas m WHERE left(a.ci_alu," & Len(Text2.Text) & ")='" & Text2.Text & "' AND a.ci_alu=m.ci_alu ORDER BY a.ci_alu;", conn
    List2.Clear
    If RC.RecordCount > 0 Then
        While Not (RC.EOF)
            List2.AddItem RC("ci_alu")
            RC.MoveNext
        Wend
        List1.Visible = False
        List2.Visible = True
    End If
    RC.Close
End Sub

Private Sub Llena_Cmb_Agno()
    Dim AgnoFin As Integer
    'Cmb_Agno.Text = ""
    AgnoFin = IIf(Year(Date) < 2005, 2005, Year(Date) + 1)
    For i = AgnoFin To 2005 Step -1
        Cmb_Agno.AddItem str(i)
    Next i
    Cmb_Agno.ListIndex = Cmb_Agno.ListCount - (AgnoFin - 2004)
    'Cmb_Agno.ListIndex = Cmb_Agno.ListCount
End Sub

Private Sub llena_cmb_jefehogar(ByVal agno As Integer)
    Dim RsAux As ADODB.Recordset
    
    CmbJefehogar.Clear
    Set RsAux = New ADODB.Recordset
    RsAux.Open "SELECT jefehogar FROM becas_jefehogar WHERE agno=" & agno & ";", conn
    If RsAux.RecordCount > 0 Then
        While Not (RsAux.EOF)
            CmbJefehogar.AddItem RsAux("jefehogar")
            RsAux.MoveNext
        Wend
    End If
End Sub

Private Sub llena_cmb_vivienda(ByVal agno As Integer)
    Dim RsAux As ADODB.Recordset
    
    CmbVivienda.Clear
    Set RsAux = New ADODB.Recordset
    RsAux.Open "SELECT vivienda FROM becas_vivienda WHERE agno=" & agno & ";", conn
    If RsAux.RecordCount > 0 Then
        While Not (RsAux.EOF)
            CmbVivienda.AddItem RsAux("vivienda")
            RsAux.MoveNext
        Wend
    End If
End Sub

Private Sub llena_cmb_sitlaboral(ByVal agno As Integer)
    Dim RsAux As ADODB.Recordset
    
    CmbSitlaboral.Clear
    Set RsAux = New ADODB.Recordset
    RsAux.Open "SELECT situacion FROM becas_situacionlaboral WHERE agno=" & agno & ";", conn
    If RsAux.RecordCount > 0 Then
        While Not (RsAux.EOF)
            CmbSitlaboral.AddItem RsAux("situacion")
            RsAux.MoveNext
        Wend
    End If
End Sub

Private Sub llena_info_adicional()
Dim rutalumno As String
Dim CodModalidad, NumGra As String
Dim modalidad As String
Dim RC As ADODB.Recordset
Set RC = New ADODB.Recordset

RC.CursorLocation = adUseClient
rutalumno = Text2.Text
Nombrealumno = Text1.Text
TxtMontovivienda.Text = "0"
Txtgastoenfermedad.Text = "0"
Txtestudio.Text = "0"
TxtIngresos.Text = "0"
If ExistReg("becas_fichas", "ci_alumno = '" & rutalumno & "' and agno=" & Cmb_Agno.Text, conn) Then
    RC.Open "select * from becas_fichas where ci_alumno = '" & rutalumno & "' and agno=" & Cmb_Agno.Text, conn
    TxtPntNotas.Text = RC("ptj_promedio")
    TxtPnteconomicos.Text = RC("ptj_anteco")
    Txtpntjefehogar.Text = RC("ptj_jefehogar")
    TxtPntEnfermedad.Text = RC("ptj_enfcat")
    TxtPntvivienda.Text = RC("ptj_antvivienda")
    TxtPnttotal.Text = RC("puntaje")
    CmbTipobecas.Text = RC("becapostula")
    ChkEnfermedades(0).Value = RC("enfcatpad")
    ChkEnfermedades(1).Value = RC("enfcatmad")
    ChkEnfermedades(2).Value = RC("enfcather")
    ChkEnfermedades(3).Value = RC("enfcatotro")
    Txtestudio.Text = RC("valorestuherma")
    Txtestudioptj.Text = RC("ptj_esthermano")
    Txtgastoenfermedad.Text = RC("ptj_esthermano")
    TxtPntingreso.Text = RC("ptj_ingresofam")
    TxtIntegrantes.Text = RC("cantidadfamilia")
    TxtIngresos.Text = RC("ingresofamiliar")
    TxtMontovivienda.Text = RC("montoarriendodiv")
    If RC("situacionlab") <> Null Then
        CmbSitlaboral.Text = RC("situacionlab")
    End If
    If RC("jefehogar") <> Null Then
        CmbJefehogar.Text = RC("jefehogar")
    End If
    If RC("vivienda") <> Null Then
        CmbVivienda.Text = RC("vivienda")
    End If
    GrdNotas.TextMatrix(1, 0) = RC("promedio1s")
    GrdNotas.TextMatrix(1, 1) = RC("promedio2s")
    GrdNotas.TextMatrix(1, 2) = RC("promediog")
    If Len(RC("asignada")) > 1 Then
        lbbeca.Caption = "Este alumno esta becado con un " & RC("asignada") & "%"
        lbbeca.Visible = True
    End If
    RC.Close
    btnactualizanotas.Visible = True
Else
    TraeNotas
End If
Indi = 0
Busqueda = 0
Busqueapo = 0
RutApo = DevuelveCampo("apo_x_alu", "", "rut_apo", "ci_alu ='" & rutalumno & "'", conn)
nombreapo = DevuelveCampo("apoderados", "", "noms_apo", "rut_apo ='" & RutApo & "'", conn)
ape1apo = DevuelveCampo("apoderados", "", "ape1_apo", "rut_apo ='" & RutApo & "'", conn)
ape2apo = DevuelveCampo("apoderados", "", "ape2_apo", "rut_apo ='" & RutApo & "'", conn)
    
If ExistReg("alu_x_cur", "ci_alu = '" & rutalumno & "' and ucase(activo_alu)='SI' and agno=" & val(Cmb_Agno.Text) - 1 & " ", conn) Then
    RC.Open "select ci_alu, cod_ens, num_gra, let_cur from alu_x_cur where ci_alu = '" & rutalumno & "' and ucase(activo_alu)='SI' and agno=" & val(Cmb_Agno.Text) - 1 & ";", conn
    Me.txt_nivel_alu.Text = RC("num_gra")
    Me.txt_letra_alu.Text = RC("let_cur")
    Me.txt_mod_alu.Text = DevuelveCampo("codigos_ensenanza", "", "Des_ens", "cod_ens = '" & RC("cod_ens") & "'", conn)
    Me.txt_apo_alu.Text = nombreapo & " " & ape1apo & " " & ape2apo
    Me.txt_estado_alu.Text = "ACTIVO"
    RC.Close
Else
    RC.Open "select ci_alu, cod_ens, num_gra, let_cur from alu_x_cur where ci_alu = '" & rutalumno & "' and ucase(activo_alu)='NO' and fec_cam ='1111-11-11' and agno=" & val(Cmb_Agno.Text) - 1 & ";", conn
    If RC.RecordCount > 0 Then
        Me.txt_nivel_alu.Text = RC("num_gra")
        Me.txt_letra_alu.Text = RC("let_cur")
        Me.txt_mod_alu.Text = DevuelveCampo("codigos_ensenanza", "", "Des_ens", "cod_ens = '" & RC("cod_ens") & "'", conn)
        Me.txt_apo_alu.Text = nombreapo & " " & ape1apo & " " & ape2apo
        Me.txt_estado_alu.Text = "RETIRADO"
    End If
    RC.Close
End If
    modalidad = DevuelveCampo("codigos_ensenanza", "", "cod_ens", "des_ens = '" & Me.txt_mod_alu.Text & "'", conn)
    SeteaGrillaDtll
    LlenaGrillaDtll
End Sub

Private Sub TraeNotas()

Dim Promedio1s, Promedio2s, Promediog As Single
Set rsGESCOL = New ADODB.Recordset
rsGESCOL.CursorLocation = adUseClient
'rsgescol.Open "select * from promedios where ci_alu= '" & rut_alu & "' and cod_ens = '" & codens & "'and num_gra ='" & ngradogescol & "' and letra_curso ='" & letragescol & "'", conn
rsGESCOL.Open "select avg(p1),avg(p2),avg(pg) from promedios where ci_alu= '" & Text2.Text & "' and cod_asi <> '13' and agno=" & val(Cmb_Agno.Text) - 1 & " ;", conn
If Not IsNull(rsGESCOL(0)) Then
    Promedio1s = IIf(Len(CStr(rsGESCOL(0))) = 1, Format(rsGESCOL(0), ".0"), Mid(CStr(rsGESCOL(0)), 1, 3))
Else
    Promedio1s = 0
End If
If Not IsNull(rsGESCOL(1)) Then
    Promedio2s = IIf(Len(CStr(rsGESCOL(1))) = 1, Format(rsGESCOL(1), ".0"), Mid(CStr(rsGESCOL(1)), 1, 3))
Else
    Promedio2s = 0
End If
If Not IsNull(rsGESCOL(2)) Then
    Promediog = IIf(Len(CStr(rsGESCOL(2))) = 1, Format(rsGESCOL(2), ".0"), Mid(CStr(rsGESCOL(2)), 1, 3))
Else
    Promediog = 0
End If
Promedio1s = IIf(Len(Promedio1s) = 2, "0", Promedio1s)
Promedio2s = IIf(Len(Promedio2s) = 2, "0", Promedio2s)
Promediog = IIf(Len(Promediog) = 2, "0", Promediog)

rsGESCOL.Close
Set rsGESCOL = Nothing
Me.GrdNotas.TextMatrix(1, 0) = Format(Promedio1s, "0.0")
Me.GrdNotas.TextMatrix(1, 1) = Format(Promedio2s, "0.0")
Me.GrdNotas.TextMatrix(1, 2) = Format(Promediog, "0.0")

End Sub

Private Sub SeteaGrillaDtll()

    GrillaDtll.Rows = 2
    GrillaDtll.ColWidth(0) = 0      ' folio
    GrillaDtll.ColWidth(1) = 1000   '  Mes en palabras
    GrillaDtll.ColWidth(2) = 1500   ' total
    GrillaDtll.ColWidth(3) = 1500   ' abonado
    GrillaDtll.ColWidth(4) = 1000   ' estado
    GrillaDtll.ColAlignment(1) = 0
    GrillaDtll.ColAlignment(2) = 1
    GrillaDtll.ColAlignment(3) = 1
    GrillaDtll.ColAlignment(4) = 1
    
    
End Sub

Private Sub LlenaGrillaDtll()
    Dim QR As String
    Dim RunAlu As String
    Dim ColeG  As String
    Dim i As Integer
    Dim RC As ADODB.Recordset
    Set RC = New ADODB.Recordset
    Dim TxtEstado As String
    
    Query = "SELECT HCC.COLEGIO FROM (SELECT RDB FROM ESTABLECIMIENTOS) AS E, HIST_COD_COLEGIO AS HCC WHERE COD_RBD=RDB;"
    RC.Open Query, conn
    ColeG = colegio
    ColeG = RC("colegio")
    If InStr(1, Me.txt_mod_alu.Text, "Pre Kinder") > 0 Then
        ColeG = ColeG & "MMC"
    End If
    RunAlu = Text2.Text
    swliq = False
    For i = 2 To Month(Date)
        GrillaDtll.Rows = i
        mesalu = DtllMesAlu(RunAlu, ColeG, i, val(Cmb_Agno.Text) - 1, conn)
        GrillaDtll.TextMatrix(i - 1, 0) = IIf(IsNull(mesalu(1, 1)), "", mesalu(1, 1))
        GrillaDtll.TextMatrix(i - 1, 1) = MesATexto(i)
        GrillaDtll.TextMatrix(i - 1, 2) = IIf(IsNull(mesalu(9, 1)), "", mesalu(9, 1))
        GrillaDtll.TextMatrix(i - 1, 3) = IIf(IsNull(mesalu(10, 1)), "", mesalu(10, 1))
        TxtEstado = "CANCELADO"
        If mesalu(12, 1) = "impg" Then
            swliq = True
            TxtEstado = "PENDIENTE"
        Else
            TxtEstado = IIf(IsNull(mesalu(12, 1)), "", "CANCELADO")
        End If
        GrillaDtll.TextMatrix(i - 1, 4) = TxtEstado
        
    Next i

End Sub

Private Sub Text2_KeyPress(KeyAscii As Integer)
    KeyAscii = Asc(UCase(Chr(KeyAscii)))
End Sub

