VERSION 5.00
Object = "{5E9E78A0-531B-11CF-91F6-C2863C385E30}#1.0#0"; "MSFLXGRD.OCX"
Object = "{86CF1D34-0C5F-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCT2.OCX"
Begin VB.Form Form_Res_Pos 
   BorderStyle     =   1  'Fixed Single
   Caption         =   "Resultados de postulaciones"
   ClientHeight    =   8100
   ClientLeft      =   45
   ClientTop       =   330
   ClientWidth     =   12615
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MDIChild        =   -1  'True
   ScaleHeight     =   8100
   ScaleWidth      =   12615
   Begin VB.CommandButton btn_can_sec 
      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            =   4080
      TabIndex        =   47
      Top             =   7560
      Visible         =   0   'False
      Width           =   1215
   End
   Begin VB.CommandButton btn_eli_sec 
      Caption         =   "Eliminar"
      BeginProperty Font 
         Name            =   "Arial"
         Size            =   8.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   375
      Left            =   2760
      TabIndex        =   48
      Top             =   7560
      Visible         =   0   'False
      Width           =   1215
   End
   Begin VB.CommandButton btn_ace_sec 
      Caption         =   "Aceptar"
      BeginProperty Font 
         Name            =   "Arial"
         Size            =   8.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   375
      Left            =   120
      TabIndex        =   49
      Top             =   7560
      Visible         =   0   'False
      Width           =   1215
   End
   Begin VB.CommandButton btn_ace_subsec 
      Caption         =   "Aceptar"
      BeginProperty Font 
         Name            =   "Arial"
         Size            =   8.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   375
      Left            =   5400
      TabIndex        =   55
      Top             =   7560
      Visible         =   0   'False
      Width           =   1215
   End
   Begin VB.CommandButton btn_can_subsec 
      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            =   1440
      TabIndex        =   56
      Top             =   7560
      Visible         =   0   'False
      Width           =   1215
   End
   Begin VB.Frame Frame_res_pos 
      Height          =   7215
      Left            =   600
      TabIndex        =   61
      Top             =   360
      Width           =   8655
      Begin VB.CommandButton btnRechazar 
         Caption         =   "&Renunciar"
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   855
         Left            =   6840
         Style           =   1  'Graphical
         TabIndex        =   103
         Top             =   360
         Width           =   1215
      End
      Begin VB.TextBox txt_fec_pos 
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   285
         Left            =   1920
         TabIndex        =   73
         Top             =   1440
         Width           =   1935
      End
      Begin VB.TextBox txt_fecha_eval 
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   285
         Left            =   1920
         TabIndex        =   72
         Top             =   1800
         Width           =   1935
      End
      Begin VB.TextBox Txt_res_eval 
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   285
         Left            =   1920
         MaxLength       =   2
         TabIndex        =   71
         Top             =   2520
         Width           =   375
      End
      Begin VB.TextBox Txt_rut_alu_res_pos 
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   285
         Left            =   1920
         MaxLength       =   8
         TabIndex        =   70
         Top             =   720
         Width           =   1095
      End
      Begin VB.CommandButton Btn_Can_Res_Pos 
         Caption         =   "Cancelar"
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   855
         Left            =   6840
         Style           =   1  'Graphical
         TabIndex        =   69
         Top             =   2280
         Width           =   1215
      End
      Begin VB.CommandButton Btn_Ace_res_pos 
         Caption         =   "Aceptar"
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   855
         Left            =   6840
         Style           =   1  'Graphical
         TabIndex        =   68
         Top             =   1320
         Width           =   1215
      End
      Begin VB.TextBox Txt_Dig_alu_res_pos 
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   285
         Left            =   3120
         MaxLength       =   1
         TabIndex        =   67
         Top             =   720
         Width           =   255
      End
      Begin VB.TextBox Txt_nom_alu 
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   285
         Left            =   1920
         MaxLength       =   95
         TabIndex        =   66
         Top             =   360
         Width           =   3375
      End
      Begin VB.TextBox txt_hora_eval 
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   285
         Left            =   1920
         TabIndex        =   65
         Top             =   2160
         Width           =   1935
      End
      Begin VB.TextBox txt_curso_res_pos 
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   285
         Left            =   1920
         TabIndex        =   64
         Top             =   1080
         Width           =   3375
      End
      Begin VB.ComboBox Combo_sit_fin_alu 
         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_Res_Pos.frx":0000
         Left            =   1920
         List            =   "Form_Res_Pos.frx":0010
         Style           =   2  'Dropdown List
         TabIndex        =   63
         Top             =   2880
         Width           =   2055
      End
      Begin VB.CheckBox chk_busqaprox_respos 
         Caption         =   "Buscar por frase"
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   375
         Left            =   5400
         TabIndex        =   62
         Top             =   360
         Width           =   1455
      End
      Begin MSFlexGridLib.MSFlexGrid Grd_res_pos 
         Height          =   3615
         Left            =   120
         TabIndex        =   74
         Top             =   3480
         Width           =   8055
         _ExtentX        =   14208
         _ExtentY        =   6376
         _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_porcentaje 
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   9.75
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   255
         Left            =   2350
         TabIndex        =   102
         Top             =   2520
         Width           =   135
      End
      Begin VB.Label Label11 
         Caption         =   "Estado final 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            =   240
         TabIndex        =   82
         Top             =   2880
         Width           =   1455
      End
      Begin VB.Label Label4 
         Caption         =   "Rut"
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   255
         Left            =   240
         TabIndex        =   81
         Top             =   720
         Width           =   1215
      End
      Begin VB.Label Label1 
         Caption         =   "Resultado 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
         Left            =   240
         TabIndex        =   80
         Top             =   2520
         Width           =   1575
      End
      Begin VB.Label Label3 
         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
         Left            =   240
         TabIndex        =   79
         Top             =   1800
         Width           =   1455
      End
      Begin VB.Label Label5 
         Caption         =   "Hora 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
         Left            =   240
         TabIndex        =   78
         Top             =   2160
         Width           =   1455
      End
      Begin VB.Label Label6 
         Caption         =   "Fecha 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            =   240
         TabIndex        =   77
         Top             =   1440
         Width           =   1455
      End
      Begin VB.Label Label7 
         Caption         =   "Postulando a"
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   255
         Left            =   240
         TabIndex        =   76
         Top             =   1080
         Width           =   1455
      End
      Begin VB.Label Label2 
         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            =   240
         TabIndex        =   75
         Top             =   360
         Width           =   1215
      End
      Begin VB.Line Line3 
         BorderColor     =   &H80000005&
         X1              =   120
         X2              =   8160
         Y1              =   3375
         Y2              =   3375
      End
      Begin VB.Line Line5 
         BorderColor     =   &H8000000C&
         X1              =   120
         X2              =   8160
         Y1              =   3360
         Y2              =   3360
      End
   End
   Begin VB.Frame frame_PlanEstudio 
      Height          =   7455
      Left            =   120
      TabIndex        =   34
      Top             =   0
      Width           =   11055
      Begin VB.Frame Frame_Sectores 
         Height          =   5415
         Left            =   120
         TabIndex        =   59
         Top             =   1680
         Visible         =   0   'False
         Width           =   10815
         Begin VB.CommandButton Command2 
            Caption         =   "Cerrar Ventana"
            BeginProperty Font 
               Name            =   "Arial"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   435
            Left            =   9240
            TabIndex        =   101
            Top             =   240
            Width           =   1455
         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          =   735
            Left            =   5520
            Style           =   1  'Graphical
            TabIndex        =   100
            Top             =   4440
            Width           =   1215
         End
         Begin VB.Frame Subsector 
            Caption         =   "Informacion de SubSector"
            BeginProperty Font 
               Name            =   "Arial"
               Size            =   8.25
               Charset         =   0
               Weight          =   700
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            ForeColor       =   &H00C00000&
            Height          =   3495
            Left            =   5520
            TabIndex        =   90
            Top             =   720
            Width           =   5175
            Begin VB.OptionButton OptNo 
               Caption         =   "No "
               BeginProperty Font 
                  Name            =   "Arial"
                  Size            =   8.25
                  Charset         =   0
                  Weight          =   400
                  Underline       =   0   'False
                  Italic          =   0   'False
                  Strikethrough   =   0   'False
               EndProperty
               Height          =   375
               Left            =   2640
               TabIndex        =   106
               Top             =   1920
               Width           =   855
            End
            Begin VB.OptionButton OptSi 
               Caption         =   "Si "
               BeginProperty Font 
                  Name            =   "Arial"
                  Size            =   8.25
                  Charset         =   0
                  Weight          =   400
                  Underline       =   0   'False
                  Italic          =   0   'False
                  Strikethrough   =   0   'False
               EndProperty
               Height          =   375
               Left            =   1800
               TabIndex        =   105
               Top             =   1920
               Width           =   735
            End
            Begin VB.ListBox lst_sub_sec 
               BeginProperty Font 
                  Name            =   "Arial"
                  Size            =   8.25
                  Charset         =   0
                  Weight          =   400
                  Underline       =   0   'False
                  Italic          =   0   'False
                  Strikethrough   =   0   'False
               EndProperty
               Height          =   690
               Left            =   1200
               TabIndex        =   97
               Top             =   1080
               Visible         =   0   'False
               Width           =   3855
            End
            Begin VB.TextBox txt_nom_subsec 
               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
               MaxLength       =   35
               TabIndex        =   93
               Top             =   795
               Width           =   3855
            End
            Begin VB.TextBox txt_cod_subsec 
               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
               MaxLength       =   6
               TabIndex        =   92
               Top             =   360
               Width           =   1095
            End
            Begin VB.CheckBox ChkPnivel 
               Caption         =   "Prueba Coeficiente 2"
               BeginProperty Font 
                  Name            =   "Arial"
                  Size            =   8.25
                  Charset         =   0
                  Weight          =   400
                  Underline       =   0   'False
                  Italic          =   0   'False
                  Strikethrough   =   0   'False
               EndProperty
               Height          =   255
               Left            =   3000
               TabIndex        =   91
               Top             =   3120
               Width           =   1935
            End
            Begin VB.Label Label10 
               Caption         =   "Asig. Electiva"
               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
               TabIndex        =   104
               Top             =   1920
               Width           =   855
            End
            Begin VB.Label Label15 
               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        =   95
               Top             =   840
               Width           =   855
            End
            Begin VB.Label Label14 
               Caption         =   "Código Sub-Sector"
               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
               TabIndex        =   94
               Top             =   360
               Width           =   975
            End
         End
         Begin VB.CommandButton cmdAceptaSectores 
            Caption         =   "Ace&ptar"
            BeginProperty Font 
               Name            =   "Arial"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   735
            Left            =   4200
            Style           =   1  'Graphical
            TabIndex        =   89
            Top             =   4440
            Width           =   1215
         End
         Begin VB.Frame Frame3 
            Caption         =   "Informacion de Sector"
            BeginProperty Font 
               Name            =   "Arial"
               Size            =   8.25
               Charset         =   0
               Weight          =   700
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            ForeColor       =   &H00C00000&
            Height          =   3495
            Left            =   120
            TabIndex        =   83
            Top             =   720
            Width           =   5295
            Begin VB.TextBox txt_cod_sec 
               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            =   1140
               MaxLength       =   6
               TabIndex        =   86
               Top             =   360
               Width           =   1095
            End
            Begin VB.ListBox lst_nom_sec 
               BeginProperty Font 
                  Name            =   "Arial"
                  Size            =   8.25
                  Charset         =   0
                  Weight          =   400
                  Underline       =   0   'False
                  Italic          =   0   'False
                  Strikethrough   =   0   'False
               EndProperty
               Height          =   690
               Left            =   1140
               TabIndex        =   85
               Top             =   1080
               Visible         =   0   'False
               Width           =   3975
            End
            Begin VB.TextBox txt_nom_sec 
               BeginProperty Font 
                  Name            =   "Arial"
                  Size            =   8.25
                  Charset         =   0
                  Weight          =   400
                  Underline       =   0   'False
                  Italic          =   0   'False
                  Strikethrough   =   0   'False
               EndProperty
               Height          =   285
               Left            =   1140
               MaxLength       =   35
               TabIndex        =   84
               Top             =   840
               Width           =   3975
            End
            Begin VB.Label Label9 
               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        =   88
               Top             =   840
               Width           =   855
            End
            Begin VB.Label Label8 
               Caption         =   "Código"
               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        =   87
               Top             =   360
               Width           =   855
            End
         End
         Begin VB.Label lblCerrar 
            Alignment       =   2  'Center
            BackColor       =   &H00FFFFFF&
            BorderStyle     =   1  'Fixed Single
            Caption         =   "X"
            BeginProperty Font 
               Name            =   "Arial"
               Size            =   8.25
               Charset         =   0
               Weight          =   700
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   255
            Left            =   10440
            TabIndex        =   60
            Top             =   240
            Width           =   255
         End
      End
      Begin VB.CommandButton cmdPlanEst 
         Caption         =   "&Cancelar"
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   855
         Index           =   1
         Left            =   5640
         Style           =   1  'Graphical
         TabIndex        =   58
         Top             =   6120
         Width           =   1215
      End
      Begin VB.CommandButton cmdPlanEst 
         Caption         =   "&Aceptar"
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   855
         Index           =   0
         Left            =   4320
         Style           =   1  'Graphical
         TabIndex        =   57
         Top             =   6120
         Width           =   1215
      End
      Begin VB.TextBox txtPlan_Est 
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   285
         Index           =   3
         Left            =   9960
         TabIndex        =   46
         Top             =   1320
         Width           =   855
      End
      Begin VB.ComboBox cmb_des_ens_subsec 
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   330
         Left            =   2400
         TabIndex        =   41
         Top             =   240
         Width           =   3615
      End
      Begin VB.ComboBox cmb_num_gra_subsec 
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   330
         Left            =   7080
         TabIndex        =   42
         Top             =   240
         Width           =   1215
      End
      Begin VB.TextBox txtPlan_Est 
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   285
         Index           =   2
         Left            =   2400
         TabIndex        =   45
         Top             =   1320
         Width           =   1215
      End
      Begin VB.TextBox txtPlan_Est 
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   285
         Index           =   1
         Left            =   9960
         TabIndex        =   44
         Top             =   960
         Width           =   855
      End
      Begin VB.TextBox txtPlan_Est 
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   285
         Index           =   0
         Left            =   2400
         TabIndex        =   43
         Top             =   960
         Width           =   1215
      End
      Begin VB.Frame Frame2 
         Height          =   4215
         Left            =   120
         TabIndex        =   51
         Top             =   1680
         Width           =   10815
         Begin VB.CommandButton cmdEdSectores 
            Caption         =   "Eliminar"
            BeginProperty Font 
               Name            =   "Arial"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   795
            Index           =   4
            Left            =   9840
            Style           =   1  'Graphical
            TabIndex        =   99
            Top             =   240
            Width           =   855
         End
         Begin VB.CommandButton cmdEdSectores 
            Caption         =   "Nuevo"
            BeginProperty Font 
               Name            =   "Arial"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   795
            Index           =   3
            Left            =   8880
            Style           =   1  'Graphical
            TabIndex        =   98
            Top             =   240
            Width           =   855
         End
         Begin VB.CommandButton cmdEdSectores 
            Caption         =   "Subir"
            BeginProperty Font 
               Name            =   "Arial"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   795
            Index           =   2
            Left            =   6000
            Style           =   1  'Graphical
            TabIndex        =   54
            Top             =   240
            Width           =   855
         End
         Begin VB.CommandButton cmdEdSectores 
            Caption         =   "&Editar"
            BeginProperty Font 
               Name            =   "Arial"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   795
            Index           =   1
            Left            =   7920
            Style           =   1  'Graphical
            TabIndex        =   53
            Top             =   240
            Width           =   855
         End
         Begin VB.CommandButton cmdEdSectores 
            Caption         =   "Bajar"
            BeginProperty Font 
               Name            =   "Arial"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   795
            Index           =   0
            Left            =   6960
            Style           =   1  'Graphical
            TabIndex        =   52
            Top             =   240
            Width           =   855
         End
         Begin MSFlexGridLib.MSFlexGrid grSectores 
            Height          =   2865
            Left            =   120
            TabIndex        =   96
            Top             =   1200
            Width           =   10575
            _ExtentX        =   18653
            _ExtentY        =   5054
            _Version        =   393216
            Cols            =   6
            FixedCols       =   0
            BackColor       =   16777215
            ForeColorSel    =   16777215
            AllowBigSelection=   0   'False
            FocusRect       =   0
            SelectionMode   =   1
            FormatString    =   "^Orden|>Cod_Sec|<Sector Apendizaje|>Cod Sub|<Sub Sector|^Prueba Nivel"
            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.Label lblPlan_est 
         Caption         =   "Año de Promulgació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           =   5
         Left            =   8160
         TabIndex        =   50
         Top             =   1320
         Width           =   1695
      End
      Begin VB.Label lblPlan_est 
         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
         Index           =   4
         Left            =   240
         TabIndex        =   40
         Top             =   240
         Width           =   2055
      End
      Begin VB.Label Label38 
         BeginProperty Font 
            Name            =   "MS Sans Serif"
            Size            =   8.25
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   -1  'True
            Strikethrough   =   0   'False
         EndProperty
         Height          =   255
         Left            =   240
         TabIndex        =   39
         Top             =   2280
         Width           =   4395
      End
      Begin VB.Label lblPlan_est 
         Caption         =   "Plan de Estudio"
         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        =   38
         Top             =   1320
         Width           =   1815
      End
      Begin VB.Label lblPlan_est 
         Caption         =   "Nº de Decreto Resolució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            =   240
         TabIndex        =   37
         Top             =   960
         Width           =   1935
      End
      Begin VB.Label lblPlan_est 
         Caption         =   "Año de Promulgació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           =   2
         Left            =   8160
         TabIndex        =   36
         Top             =   960
         Width           =   1695
      End
      Begin VB.Label lblPlan_est 
         Caption         =   "Nivel"
         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            =   6480
         TabIndex        =   35
         Top             =   240
         Width           =   1815
      End
   End
   Begin VB.Frame Frame_Ret 
      Caption         =   "Retiros de Alumnos"
      BeginProperty Font 
         Name            =   "Arial"
         Size            =   8.25
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H00C00000&
      Height          =   7215
      Left            =   120
      TabIndex        =   0
      Top             =   120
      Width           =   11055
      Begin VB.Frame Frame1 
         Height          =   615
         Left            =   120
         TabIndex        =   31
         Top             =   240
         Width           =   10815
         Begin VB.OptionButton Opt_retiro 
            Caption         =   "Alumnos Retirados"
            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            =   7080
            TabIndex        =   33
            Top             =   240
            Width           =   1815
         End
         Begin VB.OptionButton Opt_retiro 
            Caption         =   "Alumnos del Colegio"
            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        =   32
            Top             =   240
            Width           =   1815
         End
      End
      Begin VB.CheckBox chk_busqaprox_ret 
         Caption         =   "  Buscar por frase"
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   255
         Left            =   5520
         TabIndex        =   20
         Top             =   1200
         Width           =   2175
      End
      Begin VB.TextBox txt_seg_ret 
         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            =   7440
         MaxLength       =   30
         TabIndex        =   15
         Top             =   2640
         Width           =   3375
      End
      Begin VB.TextBox txt_causa_ret 
         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          =   525
         Left            =   7440
         MaxLength       =   255
         MultiLine       =   -1  'True
         TabIndex        =   14
         Top             =   2040
         Width           =   3375
      End
      Begin VB.TextBox txt_cur_ret 
         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            =   1800
         TabIndex        =   13
         Top             =   2280
         Width           =   3495
      End
      Begin VB.TextBox txt_fec_mat 
         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            =   1800
         MaxLength       =   10
         TabIndex        =   11
         Top             =   1920
         Width           =   1455
      End
      Begin VB.TextBox Txt_nom_alu_ret 
         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
         MaxLength       =   95
         TabIndex        =   5
         Top             =   1200
         Width           =   3495
      End
      Begin VB.TextBox Txt_Dig_alu_ret 
         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            =   3000
         MaxLength       =   1
         TabIndex        =   4
         Top             =   1560
         Width           =   255
      End
      Begin VB.TextBox Txt_rut_alu_ret 
         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            =   1800
         MaxLength       =   8
         TabIndex        =   3
         Top             =   1560
         Width           =   1095
      End
      Begin VB.TextBox Txt_num_mat_ret 
         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            =   4440
         TabIndex        =   2
         Top             =   2640
         Width           =   855
      End
      Begin VB.TextBox Txt_jor_alu_ret 
         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            =   1800
         TabIndex        =   1
         Top             =   2640
         Width           =   1455
      End
      Begin MSComCtl2.DTPicker dtp_fec_ret 
         Height          =   375
         Left            =   7440
         TabIndex        =   16
         Top             =   1560
         Width           =   1335
         _ExtentX        =   2355
         _ExtentY        =   661
         _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
         Format          =   51773441
         CurrentDate     =   37725
      End
      Begin VB.Frame frame_noretirados 
         Caption         =   "Alumnos del Colegio"
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H00C00000&
         Height          =   3855
         Left            =   120
         TabIndex        =   21
         Top             =   3240
         Width           =   10815
         Begin MSFlexGridLib.MSFlexGrid grd_retiro 
            Height          =   3375
            Left            =   120
            TabIndex        =   23
            Top             =   360
            Width           =   9015
            _ExtentX        =   15901
            _ExtentY        =   5953
            _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.CommandButton Btn_ace_ret 
            Caption         =   "Retirar Alumno"
            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            =   9360
            Style           =   1  'Graphical
            TabIndex        =   25
            Top             =   360
            Width           =   1215
         End
         Begin VB.CommandButton Btn_Can_ret 
            Caption         =   "Cancelar"
            BeginProperty Font 
               Name            =   "Arial"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   855
            Left            =   9360
            Style           =   1  'Graphical
            TabIndex        =   24
            Top             =   2520
            Width           =   1215
         End
         Begin VB.CommandButton Btn_otro_ret 
            Caption         =   "Otro Alumno"
            BeginProperty Font 
               Name            =   "Arial"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   855
            Left            =   9360
            Style           =   1  'Graphical
            TabIndex        =   22
            Top             =   1440
            Width           =   1215
         End
      End
      Begin VB.Frame Frame_retirados 
         Caption         =   "Alumnos Retirados"
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H00C00000&
         Height          =   3855
         Left            =   120
         TabIndex        =   26
         Top             =   3240
         Width           =   10815
         Begin VB.CommandButton btn_anular_retiro 
            Caption         =   "Anular Retiro"
            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            =   9360
            Style           =   1  'Graphical
            TabIndex        =   29
            Top             =   360
            Width           =   1215
         End
         Begin VB.CommandButton btn_can_retirados 
            Caption         =   "Cancelar"
            BeginProperty Font 
               Name            =   "Arial"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   855
            Left            =   9360
            Style           =   1  'Graphical
            TabIndex        =   28
            Top             =   2520
            Width           =   1215
         End
         Begin VB.CommandButton btn_otro_retirados 
            Caption         =   "Otro Alumno"
            BeginProperty Font 
               Name            =   "Arial"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   855
            Left            =   9360
            Style           =   1  'Graphical
            TabIndex        =   27
            Top             =   1440
            Width           =   1215
         End
         Begin MSFlexGridLib.MSFlexGrid grd_retirados 
            Height          =   3375
            Left            =   120
            TabIndex        =   30
            Top             =   360
            Width           =   9015
            _ExtentX        =   15901
            _ExtentY        =   5953
            _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
      End
      Begin VB.Line Line6 
         BorderColor     =   &H8000000C&
         X1              =   15
         X2              =   11010
         Y1              =   960
         Y2              =   960
      End
      Begin VB.Label Label31 
         Caption         =   "Seguirá en"
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   255
         Left            =   5880
         TabIndex        =   19
         Top             =   2640
         Width           =   1455
      End
      Begin VB.Label Label32 
         Caption         =   "Causa del retiro"
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   255
         Left            =   5880
         TabIndex        =   18
         Top             =   2160
         Width           =   1455
      End
      Begin VB.Label Label23 
         Caption         =   "Fecha de retiro"
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   255
         Left            =   5880
         TabIndex        =   17
         Top             =   1560
         Width           =   1455
      End
      Begin VB.Label Label33 
         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            =   240
         TabIndex        =   12
         Top             =   2280
         Width           =   1455
      End
      Begin VB.Line Line1 
         BorderColor     =   &H8000000C&
         X1              =   0
         X2              =   10995
         Y1              =   3120
         Y2              =   3120
      End
      Begin VB.Label Label29 
         Caption         =   "Fecha de matrícula"
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   255
         Left            =   240
         TabIndex        =   10
         Top             =   1920
         Width           =   1455
      End
      Begin VB.Label Label28 
         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            =   240
         TabIndex        =   9
         Top             =   1200
         Width           =   1215
      End
      Begin VB.Label Label27 
         Caption         =   "Rut"
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   255
         Left            =   240
         TabIndex        =   8
         Top             =   1560
         Width           =   1215
      End
      Begin VB.Label Label26 
         Caption         =   "Nro.Matrícula"
         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        =   7
         Top             =   2640
         Width           =   1215
      End
      Begin VB.Label Label24 
         Caption         =   "Jornada"
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   255
         Left            =   240
         TabIndex        =   6
         Top             =   2640
         Width           =   1455
      End
   End
   Begin VB.Menu mnuManejaGrilla 
      Caption         =   "Maneja Grilla"
      Visible         =   0   'False
      Begin VB.Menu mnuAgreSec 
         Caption         =   "Ag&rega Sector"
      End
      Begin VB.Menu mnuAgreSub 
         Caption         =   "Agreg&a Sub Sector"
      End
      Begin VB.Menu skip 
         Caption         =   "-"
      End
      Begin VB.Menu mnuModSec 
         Caption         =   "&Modificar Sector"
      End
      Begin VB.Menu mnuModSub 
         Caption         =   "Mo&dificar Sub Sector"
      End
      Begin VB.Menu skip2 
         Caption         =   "-"
      End
      Begin VB.Menu mnuQuitaSec 
         Caption         =   "&Quita Sector"
      End
      Begin VB.Menu mnuQuitSub 
         Caption         =   "Qui&ta Sub Sector"
      End
   End
End
Attribute VB_Name = "Form_Res_Pos"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim enPantalla As Boolean
Dim rs As ADODB.Recordset
Dim RsAux As ADODB.Recordset
Dim bModific As Boolean
Dim strMantAsig() As String
Dim nNumMant As Integer
Dim Flag_sub As Boolean
Dim flag_new As Boolean

Private Sub Btn_Ace_res_pos_Click()
Dim objRS As ADODB.Recordset
Set objRS = New ADODB.Recordset
Dim var_sql As String
Dim sw, rut, descripcion As String, Fecha As Variant
Dim sit_ant, res_ant As String
Dim Codens As String
Dim NumGra As String
Dim curso As String
Dim accion_realizada As String
Dim log As Boolean
sw = 1
rut = RutGlobal
descripcion = txt_nom_alu.Text
Resultado = val(Me.Txt_res_eval.Text)
Situacion = Left(Me.Combo_sit_fin_alu.Text, 1)
Fecha = Format(Me.txt_fec_pos.Text, "yyyy/mm/dd")

If Combo_sit_fin_alu.Text = "" Then
    MsgBox "Debe seleccionar Estado final alumno", vbInformation
    Exit Sub
End If

'Obtengo datos para el log
    NumGra = Mid(txt_curso_res_pos.Text, 1, 2)
    Codens = Mid(txt_curso_res_pos.Text, 4)
    
    If Form_NFicha_PRoceso.run_actual <> "" Then
        var_sql = "select * from postulaciones" _
            & " where ci_alu= '" & Form_NFicha_PRoceso.run_actual & "' And fec_pos = '" & Fecha & "'"
    Else
        var_sql = "select * from postulaciones" _
            & " where ci_alu= '" & rut & "' And fec_pos = '" & Fecha & "'"
    End If
    
    objRS.Open var_sql, conn
    If IsNull(objRS("VIII_RES_EVAL")) Then
        res_ant = 0
    Else
        res_ant = objRS("VIII_RES_EVAL")
    End If
    sit_ant = objRS("VIII_SIT_FIN_ALU")
    objRS.Close
'Fin

If Len(Trim(Me.Txt_res_eval.Text)) <> 0 Then

    cole = DevuelveCampo("cfg", "", "valor", "param = 'CODBC'", conn)
    
   If cole = "HUE001" Or cole = "ALT001" Then
    If Resultado > 100 Then
        MsgBox ("Error en nota de evaluación, valor máximo permitido 100")
        sw = 0
    Else
        If Resultado < 60 And Situacion = "A" Then
            If MsgBox("Advertencia, la nota de evaluación es inferior a 60" & Chr(13) & Chr(13) & "  ¿Desea Aceptar alumno?", vbYesNo + vbQuestion) = vbYes Then
                sw = 1
            Else
                sw = 0
            End If
        ElseIf Resultado >= 60 And Situacion = "R" Then
            If MsgBox("Advertencia, la nota de evaluación es superior a 60" & Chr(13) & Chr(13) & "  ¿Desea Reprobar alumno?", vbYesNo + vbQuestion) = vbYes Then
                sw = 1
            Else
                sw = 0
            End If
        End If
    End If
    
        
   Else

    If Resultado > 70 Then
        MsgBox ("Error en nota de evaluación, valor máximo permitido 70")
        sw = 0
    Else
        If Resultado < 40 And Situacion = "A" Then
            If MsgBox("Advertencia, la nota de evaluación es inferior a 40" & Chr(13) & Chr(13) & "  ¿Desea Aceptar alumno?", vbYesNo + vbQuestion) = vbYes Then
                sw = 1
            Else
                sw = 0
            End If
        ElseIf Resultado >= 40 And Situacion = "R" Then
            If MsgBox("Advertencia, la nota de evaluación es superior a 40" & Chr(13) & Chr(13) & "  ¿Desea Reprobar alumno?", vbYesNo + vbQuestion) = vbYes Then
                sw = 1
            Else
                sw = 0
            End If
        End If
    End If
    
  End If
    If sw = 1 Then
        
    If Form_NFicha_PRoceso.proceso <> 0 And Form_NFicha_PRoceso.run_actual <> "" Then
            conn.Execute "UPDATE postulaciones Set VIII_res_eval = " & Resultado & ", VIII_sit_fin_alu = '" & Situacion & "'" & " where ci_alu= '" & Form_NFicha_PRoceso.run_actual & "' And fec_pos = '" & Fecha & "'"
    Else
            'conn.Execute "UPDATE postulaciones Set VIII_res_eval = " & Resultado & ", VIII_sit_fin_alu = '" & Situacion & "'" & " where ci_alu= '" & rut & "' And fec_pos = '" & Fecha & "'"
    End If
    
            
            '********** Registro de operaciones ***********
             Call RegOpe("RES_POS", Trim(Left("POSTULACIONES@" & Me.Grd_res_pos.TextMatrix(1, 0) & "@" & Me.txt_nom_alu & String(100, " "), 100)), conn)
            '********** FIN Registro de operaciones ***********
            'MsgBox ("OK")
            
            'Insercion de log
                Select Case Codens
                    Case "Otros Tipos (Pre Kinder)"
                        grado = "PK"
                    Case "Educación Parvularia"
                        grado = "K"
                    Case "Educación General Básica"
                        grado = "EB"
                    Case "Educación Media H/C niños y jóvenes"
                        grado = "EM"
                End Select
                curso = NumGra & " " & grado
                If res_ant <> Resultado Then
                    accion_realizada = "El resultado de la postulación para el alumno que " _
                                     & "que postula a " & curso & ", fue modificado a " _
                                     & Resultado
                    log = Inserta_Vitacora_Alumno(CStr(rut), accion_realizada)
                End If
                If sit_ant <> Situacion Then
                    accion_realizada = "El estado final de la postulación para el alumno que " _
                                     & "que postula a " & curso & ", fue modificado a " _
                                     & Situacion
                    log = Inserta_Vitacora_Alumno(CStr(rut), accion_realizada)
                End If
                
            'Fin de logs
            MsgBox "Se ha asignado nota de exámen a alumno", vbInformation
            
            RutGlobal = ""
            Me.txt_nom_alu.Text = ""
            Me.Txt_rut_alu_res_pos.Text = ""
            Me.Txt_Dig_alu_res_pos.Text = ""
            Me.txt_curso_res_pos.Text = ""
            Me.txt_fec_pos.Text = ""
            Me.txt_fecha_eval.Text = ""
            Me.txt_hora_eval.Text = ""
            Me.Txt_res_eval.Text = ""
            Me.txt_nom_alu.Locked = False
            Me.txt_nom_alu.SetFocus
            Me.Txt_res_eval.Enabled = False
          '  Me.Combo_sit_fin_alu.Enabled = False
            Me.Btn_Ace_res_pos.Enabled = False
            Busqueda = 1
    Else
            Me.Txt_res_eval.Enabled = True
            Me.Txt_res_eval.SetFocus
            SendKeys "{home}+{end}"
    End If
Else
    MsgBox ("Ingrese Calificación")
    Me.Txt_res_eval.SetFocus
    SendKeys "{home}+{end}"
End If

If Form_NFicha_PRoceso.run_actual <> "" Then
    Unload Me
End If

End Sub

Private Sub Btn_ace_ret_Click()
Dim log As Boolean
Dim grado, curso, accion_realizada As String
Dim CodRegOpe As String
Dim RcFec As ADODB.Recordset
Set RcFec = New ADODB.Recordset
If Len(Trim(Me.txt_causa_ret.Text)) <> 0 Or Len(Trim(Me.txt_seg_ret.Text)) <> 0 Then
    Fila = Me.grd_retiro.Row
    rutalumno = Me.Txt_rut_alu_ret + "-" + Me.Txt_Dig_alu_ret.Text
    nombre = Me.Txt_nom_alu_ret.Text
    Cod_Ens = arraygrilla(Fila, 7)
    Num_Gra = Trim(arraygrilla(Fila, 5))
    Let_Cur = Trim(arraygrilla(Fila, 6))
    Sql = "select * from alu_x_cur where  ci_alu = '" & rutalumno & "' and cod_ens = '" & Cod_Ens & "' and num_gra = '" & Num_Gra & "' and let_cur ='" & Let_Cur & "' AND agno=" & Anno & " and fec_ing_curso > '" & Format(Me.dtp_fec_ret.Value, "yyyy-mm-dd") & "' and activo_alu = 'SI';"
    RcFec.Open Sql, conn
    If RcFec.RecordCount > 0 Then
        MsgBox "la fecha de retiro es invalida, ya que se registra antes a la fecha de ingreso del alumno"
        RcFec.Close
        Exit Sub
    End If
    RcFec.Close
    jornada = DevuelveCampo("jornadas", "", "cod_jor", "des_jor = '" & Me.Txt_jor_alu_ret.Text & "'", conn)
    modalidad = DevuelveCampo("codigos_ensenanza", "", "des_ens", "cod_ens='" & Cod_Ens & "'", conn)
    If MsgBox("Nombre Alumno : " & Me.Txt_nom_alu_ret.Text & Chr(13) & "Curso                 : " & Num_Gra & "º" & Let_Cur & " " & modalidad & " " & Me.Txt_jor_alu_ret.Text & Chr(13) & Chr(13) & "                   ¿ Desea continuar ?", vbYesNo + vbQuestion, "Retirar alumno(a)") = vbYes Then
        'conn.BeginTrans
        conn.Execute "UPDATE matriculas Set activo_alu = 'NO', fec_retiro = '" & Format(Me.dtp_fec_ret.Value, "yyyy-mm-dd") & "' , destino_retiro = '" & Me.txt_seg_ret.Text & "', obs_retiro = '" & Me.txt_causa_ret.Text & "' where ci_alu = '" & rutalumno & "' and fec_mat ='" & Format(Me.txt_fec_mat.Text, "yyyy-mm-dd") & "' and anno_mat='" & Anno & "';"
        conn.Execute "UPDATE alu_x_cur Set activo_alu = 'NO' where ci_alu = '" & rutalumno & "' and cod_ens = '" & Cod_Ens & "' and num_gra = '" & Num_Gra & "' and let_cur ='" & Let_Cur & "' AND agno=" & Anno & ";"
        
        If ExistReg("asistencia", "ci_alu = '" & rutalumno & "' and cod_ens = '" & Cod_Ens & "' and num_gra = '" & Num_Gra & "' and let_cur = '" & Let_Cur & "' and fec_mat = '" & InvierteFecha(Me.txt_fec_mat.Text, "R") & "'", conn) Then
            conn.Execute "UPDATE asistencia Set activo_alu = 'NO' where ci_alu = '" & rutalumno & "' and cod_ens = '" & Cod_Ens & "' and num_gra = '" & Num_Gra & "' and let_cur = '" & Let_Cur & "' and activo_alu = 'SI' and fec_mat = '" & InvierteFecha(Me.txt_fec_mat.Text, "R") & "' and agno=" & Anno & ";"
        End If
        'conn.Execute "UPDATE cursos Set vacantes_cur = vacantes_cur-1  where cod_ens = '" & Cod_Ens & "' and num_gra = '" & Num_Gra & "' and let_cur ='" & let_cur & "'"
        'OMITI ESTA LINEA PORQUE LOS VACANTES DEL CURSO NO SE TOCAN
        'SOLO SE CALCULAN CUANDO SE MUESTRAN
        conn.Execute "UPDATE postulantes Set matriculado_alu = 0 where ci_alu = '" & rutalumno & "'"
        conn.Execute "UPDATE vac_x_nivel Set ocu_vac =ocu_vac - 1, DIS_VAC = dis_vac + 1 where COD_ENS = '" & Cod_Ens & "' AND NUM_GRA ='" & Num_Gra & "' AND cod_jor ='" & jornada & "' and Agno=" & Anno
        
        '********** Registro de operaciones ***********
         CodRegOpe = "RET"
         Call RegOpe(CodRegOpe, Trim(Left("MATRICULAS-ALU_X_CUR-POSTULANTES-VAC_X_NIVEL@" & rutalumno & "@" & Txt_nom_alu_ret & String(100, " "), 100)), conn)
        '********** FIN Registro de operaciones ***********
        'conn.CommitTrans
        '
        
        'Inserta log
        Select Case Cod_Ens
            Case "996"
                grado = "PK"
            Case "010"
                grado = "K"
            Case "110"
                grado = "EB"
            Case "310"
                grado = "EM"
        End Select
                    curso = CStr(Num_Gra) & "º " & Let_Cur & " " & grado
                    accion_realizada = "El alumno fue dado de baja, en el curso " & curso
                    log = Inserta_Vitacora_Alumno(CStr(rutalumno), accion_realizada)
        'Fin de log
        
        RecalculaCuota_Alu_Retiro rutalumno, Me.dtp_fec_ret.Value, conn
        '
        Call Btn_otro_ret_Click
    Else
        Me.Btn_Can_ret.SetFocus
    End If
Else
    MsgBox ("Faltan campos esenciales por llenar")
    Me.txt_causa_ret.Enabled = True
    Me.txt_causa_ret.SetFocus
    Exit Sub
End If

If MsgBox("¿Desea agregar la observación del retiro?", vbQuestion + vbYesNo) = vbYes Then
'If MsgBox("¿Desea agregar la observación del retiro?") = vbYes Then

    Form_observacion_retiro.txt_NombreCompleto = nombre 'Me.Txt_nom_alu_ret.Text
    Form_observacion_retiro.txt_RutBusqueda.Text = rutalumno 'Form_Res_Pos.Txt_rut_alu_ret.Text & Form_Res_Pos.Txt_Dig_alu_ret.Text
    Load Form_observacion_retiro
    Unload Form_Res_Pos
End If
'txt_NombreCompleto Txt_nom_alu_ret
'txt_RutBusqueda   Txt_rut_alu_ret Txt_Dig_alu_ret
'Form_observacion_retiro.txt_NombreCompleto = Form_Res_Pos.Txt_nom_alu_ret.Text
'Form_observacion_retiro.txt_RutBusqueda.Text = Form_Res_Pos.Txt_rut_alu_ret.Text & Form_Res_Pos.Txt_Dig_alu_ret.Text
'Form_Res_Pos

End Sub


Private Sub btn_ace_sec_Click()
Dim Codigo, cod, codigofinal, a, descripcion As String
Codigo = Trim(txt_cod_sec.Text)
descripcion = Trim(txt_nom_sec.Text)
If Len(Trim(Me.txt_cod_sec.Text)) <> 0 And Len(Trim(Me.txt_nom_sec.Text)) <> 0 Then
If Busqueda = 1 And Len(Trim(txt_nom_sec.Text)) <> 0 Then
    rs.CursorLocation = adUseClient
    rs.Open "SELECT * FROM sectores where nom_sec=" & "'" & descripcion & "'"
    If rs.RecordCount > 0 Then
        rs.MoveLast
        rs.MoveFirst
        txt_cod_sec.Text = rs("cod_sec")
        txt_nom_sec.Text = rs("nom_sec")
        Codigo = rs("cod_sec")
        'Me.Label19.Caption = "Editando Sector Existente"
        Me.btn_eli_sec.Enabled = True
        Me.lst_nom_sec.Visible = False
        Busqueda = 0
        Indi = 0
        Me.txt_nom_sec.SetFocus
        SendKeys "{end}"
        rs.Close
    Else
        rs.Close
        If MsgBox("El registro no existe. ¿Desea crearlo?", vbYesNo + vbQuestion) = vbYes Then
            'Insertando Registro en tabla
            'codigofinal = agregacodigo("codigos_ensenanza", "cod_ens")
            'Marqué como comentario la línea anterior, porque el código se debe ingresar manual
            Me.txt_cod_sec.Enabled = True
            Me.txt_cod_sec.SetFocus
            conn.Execute "INSERT INTO sectores(cod_sec, nom_sec) values(" & "'" & Codigo & "'" & "," & "'" & descripcion & "'" & ")"
            MsgBox ("Registro Agregado")
            Me.txt_cod_sec = ""
            Me.txt_nom_sec = ""
            Me.txt_nom_sec.SetFocus
            'Me.Label19.Caption = ""
        Else
            Me.txt_nom_sec.SetFocus
            SendKeys "{home}+{end}"
        End If
        'Else
        '    MsgBox ("No debe quedar ningún campo vacío")
        'End If
    End If
ElseIf Len(Trim(Me.txt_nom_sec.Text)) <> 0 Then
            'rs.Open "SELECT * FROM codigos_ensenanza where des_ens=" & "'" & Me.txt_des_mod.Text & "'"
            'If rs.recordcount > 0 Then
            '    MsgBox ("Descripción ya existe")
            '    Me.txt_des_mod.SetFocus
            '    SendKeys "{home}+{end}"
            '    rs.Close
            'Else
            '   rs.Close
                If ingxcodigo = 1 Then
                    conn.Execute "INSERT INTO sectores(cod_sec, nom_sec) values(" & "'" & Codigo & "'" & "," & "'" & descripcion & "'" & "," & "'" & gradomaximo & "'" & ")"
                    MsgBox ("Registro Agregado")
                    Me.btn_eli_sec.Enabled = False
                    ingxcodigo = 0
                Else
                    conn.Execute "UPDATE sectores Set cod_sec = " & "'" & Codigo & "'" & ", nom_sec = " & "'" & descripcion & "'" & " where cod_sec=" & "'" & Codigo & "'"
                    MsgBox ("Registro Modificado")
                    Me.btn_eli_sec.Enabled = False
                End If
                Me.txt_cod_sec.Enabled = True
                'Me.Label19.Caption = ""
                Me.txt_cod_sec.Text = ""
                Me.txt_nom_sec.Text = ""
                Me.txt_nom_sec.SetFocus
                Busqueda = 1
            'End If
End If
Else
    MsgBox ("No deben haber campos vacíos")
End If
Me.txt_nom_sec.SetFocus

End Sub

Private Sub btn_ace_subsec_Click()
Dim Codigo, cod, codigofinal, a, descripcion As String
'modalidad = devuelvecampo("codigos_ensenanza", "", "cod_ens", "des_ens = '" & Me.cmb_des_ens_subsec.Text & "'", conn)
'Sector = devuelvecampo("sectores", "", "cod_sec", "nom_sec = '" & Me.cmb_nom_sec.Text & "'", conn)
'nivelsubsec = Me.cmb_num_gra_subsec.Text
'codigo = txt_cod_subsec.Text
'descripcion = txt_nom_subsec.Text
'If Len(Trim(Me.txt_cod_subsec.Text)) <> 0 And Len(Trim(Me.txt_nom_subsec.Text)) <> 0 Then
'If busqueda = 1 And Len(Trim(txt_nom_subsec.Text)) <> 0 Then
'    RS.CursorLocation = adUseClient
'    RS.Open "SELECT * FROM subsectores where nom_asi=" & "'" & descripcion & "'and cod_asi= '" & Trim(txt_cod_subsec) & "' and cod_sec = '" & Sector & "' and cod_ens = '" & modalidad & "' and num_gra = '" & nivelsubsec & "'"
'    If RS.RecordCount > 0 Then
'        RS.MoveLast
'        RS.MoveFirst
'        txt_cod_subsec.Text = RS("cod_asi")
'        txt_nom_subsec.Text = RS("nom_asi")
'        codigo = RS("cod_asi")
'        Me.Label16.Caption = "Editando Subsector Existente"
'        Me.btn_eli_subsec.Enabled = True
'        Me.lst_nom_subsec.Visible = False
'        busqueda = 0
'        Indi = 0
'        Me.txt_nom_subsec.SetFocus
'        SendKeys "{end}"
'        RS.Close
'        ingxcoduigo = 1
'    Else
'        RS.Close
'        'If Len(Me.txt_des_mod.Text) <> 0 And Len(Me.Txt_cod_mod.Text) <> 0 And Len(Me.Txt_Num_Gra_Max.Text) <> 0 Then
'        If MsgBox("El registro no existe. ¿Desea crearlo?", vbYesNo + vbQuestion) = vbYes Then
'            'Insertando Registro en tabla
'            'codigofinal = agregacodigo("codigos_ensenanza", "cod_ens")
'            'Marqué como comentario la línea anterior, porque el código se debe ingresar manual
'            Me.txt_cod_subsec.Enabled = True
'            Me.txt_cod_subsec.SetFocus
'            conn.Execute "INSERT INTO subsectores (cod_sec, cod_asi, cod_ens, nom_asi, num_gra, pn) values('" & Sector & "' , '" & codigo & "' , '" & modalidad & "' , '" & descripcion & "' , '" & nivelsubsec & "', " & Me.ChkPnivel & ")"
 '           MsgBox ("Registro Agregado")
'            Me.txt_cod_subsec = ""
'            Me.txt_nom_subsec = ""
'            Me.txt_nom_subsec.SetFocus
'            Me.Label20.Caption = ""
'        Else
'            Me.txt_nom_subsec.SetFocus
'            SendKeys "{home}+{end}"
'        End If
'        'Else
'        '    MsgBox ("No debe quedar ningún campo vacío")
'        'End If
'    End If
'ElseIf Len(Trim(Me.txt_nom_subsec.Text)) <> 0 Then
'            'rs.Open "SELECT * FROM codigos_ensenanza where des_ens=" & "'" & Me.txt_des_mod.Text & "'"
'            'If rs.recordcount > 0 Then
'            '    MsgBox ("Descripción ya existe")
'            '    Me.txt_des_mod.SetFocus
'            '    SendKeys "{home}+{end}"
'            '    rs.Close
'            'Else
'            '   rs.Close
'                If ingxcodigo = 1 Then
'                    conn.Execute "INSERT INTO subsectores (cod_sec, cod_asi, cod_ens, nom_asi, num_gra, pn) values('" & Sector & "' , '" & codigo & "' , '" & modalidad & "' , '" & descripcion & "' , '" & nivelsubsec & "', " & Me.ChkPnivel & ")"
'                    MsgBox ("Registro Agregado")
'                    ingxcodigo = 0
'                Else
'                    conn.Execute "UPDATE subsectores Set nom_asi = '" & descripcion & "', pn = " & Me.ChkPnivel & " where cod_sec = '" & Sector & "' and cod_asi = '" & codigo & "' and cod_ens = '" & modalidad & "' and  num_gra = '" & nivelsubsec & "'"
'                    MsgBox ("Registro Modificado")
'
'                End If
'                Me.txt_cod_subsec.Enabled = True
'                Me.Label20.Caption = ""
'                Me.txt_cod_subsec.Text = ""
'                Me.txt_nom_subsec.Text = ""
'                Me.txt_nom_subsec.SetFocus
'                Me.ChkPnivel.Value = 0
'                busqueda = 1
'            'End If
'End If
'Else
'    MsgBox ("No deben haber campos vacíos")
'End If
'Me.txt_nom_subsec.SetFocus

End Sub

Private Sub btn_anular_retiro_Click()
Dim log As Boolean
Dim curso, grado, accion_realizada As String
If Len(Trim(Me.txt_causa_ret.Text)) <> 0 Or Len(Trim(Me.txt_seg_ret.Text)) <> 0 Then
    Fila = Me.grd_retirados.Row
    rutalumno = Me.Txt_rut_alu_ret + "-" + Me.Txt_Dig_alu_ret.Text
    Cod_Ens = arraygrilla(Fila, 7)
    Num_Gra = Trim(arraygrilla(Fila, 5))
    Let_Cur = Trim(arraygrilla(Fila, 6))
    jornada = DevuelveCampo("jornadas", "", "cod_jor", "des_jor = '" & Me.Txt_jor_alu_ret.Text & "'", conn)
    modalidad = DevuelveCampo("codigos_ensenanza", "", "des_ens", "cod_ens='" & Cod_Ens & "'", conn)
    fec_ret = arraygrilla(Fila, 10)
    If MsgBox("Nombre Alumno : " & Me.Txt_nom_alu_ret.Text & Chr(13) & "Curso                 : " & Num_Gra & "º" & Let_Cur & " " & modalidad & " " & Me.Txt_jor_alu_ret.Text & Chr(13) & "Retirado el día   : " & fec_ret & Chr(13) & Chr(13) & "                   ¿ Desea continuar ?", vbYesNo + vbQuestion, "Anular Retiro de alumno(a)") = vbYes Then
        'conn.BeginTrans
        On Error GoTo controler
        conn.Execute "UPDATE matriculas Set activo_alu = 'SI', fec_retiro = '1111-11-11' , destino_retiro = '', obs_retiro = '' where ci_alu = '" & rutalumno & "' and fec_mat ='" & InvierteFecha(Me.txt_fec_mat.Text, "R") & "'"
        conn.Execute "UPDATE alu_x_cur Set activo_alu = 'SI' where ci_alu = '" & rutalumno & "' and cod_ens = '" & Cod_Ens & "' and num_gra = '" & Num_Gra & "' and let_cur ='" & Let_Cur & "' and fec_cam ='1111-11-11' and agno = " & Anno
        'conn.Execute "UPDATE cursos Set vacantes_cur = vacantes_cur-1  where cod_ens = '" & Cod_Ens & "' and num_gra = '" & Num_Gra & "' and let_cur ='" & let_cur & "'"
        'OMITI ESTA LINEA PORQUE LOS VACANTES DEL CURSO NO SE TOCAN
        'SOLO SE CALCULAN CUANDO SE MUESTRAN
        conn.Execute "UPDATE postulantes Set matriculado_alu = 1 where ci_alu = '" & rutalumno & "'"
        conn.Execute "UPDATE vac_x_nivel Set ocu_vac =ocu_vac + 1, DIS_VAC = dis_vac - 1 where COD_ENS = '" & Cod_Ens & "' AND NUM_GRA ='" & Num_Gra & "' AND cod_jor ='" & jornada & "' AND agno=" & Anno
        'conn.CommitTrans
        
        'Insertar log
        Select Case Cod_Ens
            Case "996"
                grado = "PK"
            Case "010"
                grado = "K"
            Case "110"
                grado = "EB"
            Case "310"
                grado = "EM"
        End Select
        curso = Num_Gra & "º " & Let_Cur & " " & grado
        accion_realizada = "La baja realizada para el alumno el " & dtp_fec_ret.Value _
                         & " desde el " & curso & ", fue anulada"
        log = Inserta_Vitacora_Alumno(CStr(rutalumno), accion_realizada)
        'Fin de log
        
        Call btn_otro_retirados_Click
    Else
        Me.btn_can_retirados.SetFocus
    End If
Else
    MsgBox ("Faltan campos esenciales por llenar")
    Me.txt_causa_ret.Enabled = True
    Me.txt_causa_ret.SetFocus
    Exit Sub
End If
Exit Sub
controler:
'conn.RollbackTrans
End Sub


Private Sub Btn_Can_Res_Pos_Click()
Unload Me
End Sub

Private Sub Btn_Can_ret_Click()
Unload Me
End Sub

Private Sub btn_can_retirados_Click()
Unload Me
End Sub

Private Sub btn_can_sec_Click()
Unload Me
End Sub

Private Sub btn_can_subsec_Click()
Unload Me
End Sub




Private Sub btn_eli_sec_Click()
If ExistReg("subsectores", "cod_sec ='" & txt_cod_sec & "'", conn) Then
    MsgBox ("No es posible eliminar registro. Existen registros asociados")
Else
    If MsgBox("El registro y TODOS los datos asociados en otras tablas serán eliminados. ¿Desea continuar?", vbYesNo + vbQuestion) = vbYes Then
        conn.Execute "DELETE FROM SECTORES WHERE COD_SEC ='" & txt_cod_sec & "'"
        txt_cod_sec = ""
        txt_nom_sec = ""
        Busqueda = 1
        Me.btn_eli_sec.Enabled = False
    End If
End If
'Me.Label19.Caption = ""
Me.txt_nom_sec.SetFocus
End Sub







Private Sub Btn_otro_ret_Click()
Busqueda = 1
Me.chk_busqaprox_ret.Enabled = True
Me.Txt_nom_alu_ret.Text = ""
Me.Txt_rut_alu_ret.Text = ""
Me.Txt_Dig_alu_ret.Text = ""
Me.txt_fec_mat.Text = ""
Me.txt_cur_ret.Text = ""
Me.Txt_jor_alu_ret.Text = ""
Me.Txt_num_mat_ret.Text = ""
'Me.dtp_fec_ret.Value = fec_ret
Me.txt_causa_ret.Text = ""
Me.txt_seg_ret.Text = ""
Me.grd_retiro.Rows = 2
Me.grd_retiro.Clear
Me.grd_retiro.FormatString = "R.U.N          |Apellido Paterno  |Apellido Materno  |Nombres                              |Nivel |Letra|Enseñanza|Fecha Matrícula | Nº Matrícula"
Me.Txt_nom_alu_ret.Enabled = True
Me.Txt_nom_alu_ret.SetFocus
End Sub

Private Sub btn_otro_retirados_Click()
Busqueda = 1
Me.chk_busqaprox_ret.Enabled = True
Me.Txt_nom_alu_ret.Text = ""
Me.Txt_rut_alu_ret.Text = ""
Me.Txt_Dig_alu_ret.Text = ""
Me.txt_fec_mat.Text = ""
Me.txt_cur_ret.Text = ""
Me.Txt_jor_alu_ret.Text = ""
Me.Txt_num_mat_ret.Text = ""
'Me.dtp_fec_ret.Value = fec_ret
Me.txt_causa_ret.Text = ""
Me.txt_seg_ret.Text = ""
Me.grd_retirados.Rows = 2
Me.grd_retirados.Clear
Me.grd_retirados.FormatString = "R.U.N          |Apellido Paterno  |Apellido Materno  |Nombres                              |Nivel |Letra|Enseñanza|Fecha Matrícula |Fecha Retiro | Causa                   |Siguió en        "
Me.Txt_nom_alu_ret.Enabled = True
Me.Txt_nom_alu_ret.SetFocus
End Sub



Private Sub btnRechazar_Click()
    Form_NFicha_Rechazar.Show
  
End Sub

Private Sub chk_busqaprox_respos_Click()
Me.txt_nom_alu.SetFocus
End Sub

Private Sub chk_busqaprox_ret_Click()
Me.Txt_nom_alu_ret.SetFocus
End Sub

Private Sub cmb_des_ens_subsec_Click()
    Dim nivel As String
    If bModific Then
        MsgBox "No Guardo los cambios"
    End If
    If Len(Me.cmb_des_ens_subsec.Text) <> 0 Then
        nivel = DevuelveCampo("codigos_ensenanza", "des_ens", "num_gra_max", "COD_ens = '" & Left(Me.cmb_des_ens_subsec.Text, 3) & "'", conn)
        Me.cmb_num_gra_subsec.Enabled = True
        Me.cmb_num_gra_subsec.Clear
        For t = 1 To val(nivel)
            Me.cmb_num_gra_subsec.AddItem t
        Next t
    End If
    Me.cmdEdSectores.Item(0).Enabled = False
    Me.cmdEdSectores.Item(1).Enabled = False
    Me.cmdEdSectores.Item(2).Enabled = False
    Me.cmdEdSectores.Item(3).Enabled = False
    Me.cmdEdSectores.Item(4).Enabled = False
    
    Me.txtPlan_Est.Item(0).Enabled = False
    Me.txtPlan_Est.Item(1).Enabled = False
    Me.txtPlan_Est.Item(2).Enabled = False
    Me.txtPlan_Est.Item(3).Enabled = False
    Me.txtPlan_Est.Item(0).Text = ""
    Me.txtPlan_Est.Item(1).Text = ""
    Me.txtPlan_Est.Item(2).Text = ""
    Me.txtPlan_Est.Item(3).Text = ""
    Me.grSectores.Rows = 1
End Sub










Private Sub cmb_num_gra_subsec_Click()
    Dim rsServ As ADODB.Recordset
    Dim strCodEns As String
    Dim strNumGra As String
    
    If bModific Then
        MsgBox "No se guardo"
        bModific = False
    End If
    nNumMant = 0
    ReDim Preserve strMantAsig(nNumMant)
    strCodEns = Left(Me.cmb_des_ens_subsec.Text, 3)
    strNumGra = Me.cmb_num_gra_subsec.Text
    Set rsServ = conn.Execute("SELECT * FROM PLAN_ESTUDIO WHERE AGNO='" & Anno & "' AND COD_ENS='" & strCodEns & "' AND NUM_GRA='" & strNumGra & "'")
    If rsServ.EOF Then
        rsServ.Close
        Me.txtPlan_Est.Item(0).Text = ""
        Me.txtPlan_Est.Item(1).Text = ""
        Me.txtPlan_Est.Item(2).Text = ""
        Me.txtPlan_Est.Item(3).Text = ""
    Else
        Me.txtPlan_Est.Item(0).Text = rsServ("DecRes_Plan")
        Me.txtPlan_Est.Item(1).Text = rsServ("Agno_DecRes")
        Me.txtPlan_Est.Item(2).Text = rsServ("Plan_Est")
        Me.txtPlan_Est.Item(3).Text = rsServ("Agno_Plan")
        rsServ.Close
    End If
    Me.txtPlan_Est.Item(0).Enabled = True
    Me.txtPlan_Est.Item(1).Enabled = True
    Me.txtPlan_Est.Item(2).Enabled = True
    Me.txtPlan_Est.Item(3).Enabled = True
    
    Llena_Tabla

    Me.cmdEdSectores.Item(0).Enabled = True
    Me.cmdEdSectores.Item(1).Enabled = True
    Me.cmdEdSectores.Item(2).Enabled = True
    Me.cmdEdSectores.Item(3).Enabled = True
    Me.cmdEdSectores.Item(4).Enabled = True
    Me.grSectores.Enabled = True
    enPantalla = True
End Sub
Private Sub Llena_Tabla()
    Me.grSectores.Rows = 1
    strEns = Left(Me.cmb_des_ens_subsec.Text, 3)
    strGra = Me.cmb_num_gra_subsec.Text
    verifica_orden CStr(strEns), CStr(strGra)
    'se modifica por jvv 09-03-2022
    Set rsServ = conn.Execute("SELECT s.cod_sec, s.nom_sec, su.cod_asi, su.nom_asi, su.pn, su.ord_asi, su.asi_elec FROM sectores s, subsectores su WHERE s.cod_sec=su.cod_sec AND su.cod_ens='" & strEns & "' AND su.num_gra='" & strGra & "' ORDER BY su.ord_asi")
    If rsServ.EOF Then
        rsServ.Close
    Else
        While Not rsServ.EOF
            Me.grSectores.AddItem rsServ("ord_asi") & Chr(9) & rsServ("cod_sec") & Chr(9) & rsServ("nom_sec") & Chr(9) & rsServ("cod_asi") & Chr(9) & rsServ("nom_asi") & Chr(9) & IIf(rsServ("pn") = "1", "Si", "No") & Chr(9) & IIf(rsServ("asi_elec") = "S", "Si", "No")
            rsServ.MoveNext
        Wend
        rsServ.Close
        Me.grSectores.FixedRows = 1
    End If
End Sub

Private Sub verifica_orden(Codens As String, NumGra As String)
    Set RsAux = conn.Execute("SELECT ord_asi, count(ord_asi) as cuenta FROM  subsectores  WHERE cod_ens='" & Codens & "' AND num_gra='" & NumGra & "'  group by ord_asi")
    Dim swmalo As Boolean
    Dim i As Integer
    swmalo = False
    While Not RsAux.EOF And Not swmalo
        If RsAux("cuenta") > 1 Then
            swmalo = True
        End If
        RsAux.MoveNext
    Wend
    RsAux.Close
    If Not nwmalo Then
        Set rsServ = conn.Execute("SELECT s.cod_sec, s.nom_sec, su.cod_asi, su.nom_asi, su.pn, su.ord_asi FROM sectores s, subsectores su WHERE s.cod_sec=su.cod_sec AND su.cod_ens='" & Codens & "' AND su.num_gra='" & NumGra & "' ORDER BY su.ord_asi")
        If rsServ.RecordCount > 0 Then
            rsServ.MoveFirst
            i = rsServ("ord_asi")
            While Not rsServ.EOF
                conn.Execute "UPDATE subsectores SET ord_asi = " & i & " WHERE cod_ens = '" & Codens & "' AND num_gra = '" & NumGra & "' AND cod_asi = '" & rsServ("cod_asi") & "' AND cod_sec = '" & rsServ("cod_sec") & "'"
                rsServ.MoveNext
                i = i + 1
            Wend
        End If
        rsServ.Close
    End If
End Sub

Private Sub cmdAceptaSectores_Click()
    Dim log As Boolean
    Dim var_sql As String
    Dim rut_fun As String
    Dim accion_realizada As String
    Dim objRS As ADODB.Recordset
    Dim AsiElec As String 'SE MODIFICA POR JVV 09-03-2022
    Dim AsigProf As String 'SE MODIFICA POR JVV 04-05-2022
    
    
    var_sql = "SELECT rut_usu FROM usuarios" _
            & " where aut_nombre_usuario = '" & Nom_usu_ses & "'"
    Set objRS = New ADODB.Recordset
    objRS.Open var_sql, conn
    rut_fun = objRS("rut_usu")
    objRS.Close
    
    If flag_new Then
        strord = val(Me.grSectores.TextMatrix(Me.grSectores.Rows - 1, 0)) + 1
        strstr = "agregar"
    Else
        strord = val(Me.grSectores.TextMatrix(Me.grSectores.Row, 0))
        strstr = "modificar"
    End If
    
    'preguntar campos vacios!!
    If (Me.txt_cod_sec.Text = "" Or txt_cod_subsec = "" Or txt_nom_subsec = "") Then
        MsgBox "Faltan campos esenciales", vbExclamation, "Mensaje"
        Exit Sub
    Else
    'fin mio
    
    'SE MODIFICA POR JVV 09-03-2022
    If OptSi.Value Then
        AsiElec = "S"
    Else
        AsiElec = "N"
    End If
    
    'SE MODIFICA POR JVV 04-05-2021
    

    
    If MsgBox("Esta seguro que desea " & strstr & " el sector y subsector?", vbQuestion + vbYesNo) <> 6 Then Exit Sub
    conn.Execute "REPLACE INTO SECTORES (COD_SEC, NOM_SEC) VALUE ('" & Me.txt_cod_sec.Text & "','" & Me.txt_nom_sec.Text & "')", Affected
    Me.Frame_Sectores.Visible = False
    'SE MODIFICA POR JVV 09-03-2022
    'SE MODIFICA POR JVV 04-05-2021
    conn.Execute "REPLACE INTO subsectores (COD_SEC, COD_ASI, COD_ENS, NOM_ASI, NUM_GRA, ORD_ASI, PN, ASI_ELEC) VALUES ('" & Me.txt_cod_sec.Text & "','" & Me.txt_cod_subsec.Text & "','" & Left(Me.cmb_des_ens_subsec.Text, 3) & "','" & Me.txt_nom_subsec.Text & "','" & Me.cmb_num_gra_subsec.Text & "','" & strord & "','" & Me.ChkPnivel.Value & "', '" & AsiElec & "')", Affected
    Llena_Tabla
    
    'Log administracion de subsectores
    If strstr = "agregar" Then
        accion_realizada = "El funcionario a agregado el subsector " & Me.txt_nom_subsec.Text _
                        & " que pertenece al sector " & Me.txt_nom_sec.Text
        log = Inserta_Vitacora_Profesores(rut_fun, "Agregar subsector ", accion_realizada)
    Else
        accion_realizada = "El funcionario a modificado el subsector " & Me.txt_nom_subsec.Text _
                        & " que pertenece al sector " & Me.txt_nom_sec.Text
        log = Inserta_Vitacora_Profesores(rut_fun, "Modificar subsector", accion_realizada)
    End If
    'Fin de log
    
    genera_log strstr, Me.txt_cod_sec.Text, Me.txt_cod_subsec.Text
    cmdPlanEst(1).Enabled = True
    cmdPlanEst(0).Enabled = True
    cmb_des_ens_subsec.Enabled = True
    cmb_num_gra_subsec.Enabled = True
    Me.cmdEdSectores.Item(0).Enabled = True
    Me.cmdEdSectores.Item(1).Enabled = True
    Me.cmdEdSectores.Item(2).Enabled = True
    Me.cmdEdSectores.Item(3).Enabled = True
    Me.cmdEdSectores.Item(4).Enabled = True
    
    End If 'mio
End Sub

Private Sub cmdEdSectores_Click(Index As Integer)
    Dim log As Boolean
    Dim var_sql As String
    Dim rut_fun As String
    Dim accion_realizada As String
    Dim objRS As ADODB.Recordset
    var_sql = "SELECT rut_usu FROM usuarios" _
            & " where aut_nombre_usuario = '" & Nom_usu_ses & "'"
    Set objRS = New ADODB.Recordset
    objRS.Open var_sql, conn
    rut_fun = objRS("rut_usu")
    objRS.Close
    
    flag_new = False
    'bModific = True
    Select Case Index
        Case Is = 0
             If Me.grSectores.Row < Me.grSectores.Rows - 1 Then
                strSec = Me.grSectores.TextMatrix(Me.grSectores.Row, 1)
                strAsi = Me.grSectores.TextMatrix(Me.grSectores.Row, 3)
                strEns = Left(Me.cmb_des_ens_subsec.Text, 3)
                strGra = Me.cmb_num_gra_subsec.Text
                ordold = Me.grSectores.TextMatrix(Me.grSectores.Row, 0)
                ordnew = Me.grSectores.TextMatrix(Me.grSectores.Row + 1, 0)
                Sql = "UPDATE subsectores SET ORD_ASI = " & ordnew & " WHERE cod_sec = '" & strSec & "' AND cod_asi = '" & strAsi & "' AND cod_ens = '" & strEns & "' AND num_gra = '" & strGra & "'"
                conn.Execute Sql
                i = Me.grSectores.Row
                strSec = Me.grSectores.TextMatrix(Me.grSectores.Row + 1, 1)
                strAsi = Me.grSectores.TextMatrix(Me.grSectores.Row + 1, 3)
                Sql = "UPDATE subsectores SET ORD_ASI = " & ordold & " WHERE cod_sec = '" & strSec & "' AND cod_asi = '" & strAsi & "' AND cod_ens = '" & strEns & "' AND num_gra = '" & strGra & "'"
                conn.Execute Sql
                Refresca_Tabla
                
                Me.grSectores.Row = i + 1
                Me.grSectores.RowSel = i + 1
                Me.grSectores.Col = 0
                Me.grSectores.ColSel = Me.grSectores.Cols - 1
                
                'Log administracion de subsectores
                accion_realizada = "El funcionario a bajado el subsector " & Me.grSectores.TextMatrix(Me.grSectores.Row, 4) _
                                 & " que pertenece al sector " & Me.grSectores.TextMatrix(Me.grSectores.Row, 2)
                log = Inserta_Vitacora_Profesores(rut_fun, "Bajar subsector", accion_realizada)
                'Fin de log
                
                genera_log "Bajo curso en lista", strSec, strAsi
            End If
        Case Is = 1
            Me.lst_nom_sec.Visible = False
            Me.lst_sub_sec.Visible = False
            txt_cod_sec.Text = ""
            txt_cod_subsec.Text = ""
            txt_nom_sec.Text = ""
            txt_nom_subsec.Text = ""
            cmdPlanEst(1).Enabled = False
            cmdPlanEst(0).Enabled = False
            cmb_des_ens_subsec.Enabled = False
            cmb_num_gra_subsec.Enabled = False
            Me.cmdEdSectores.Item(0).Enabled = False
            Me.cmdEdSectores.Item(1).Enabled = False
            Me.cmdEdSectores.Item(2).Enabled = False
            Me.cmdEdSectores.Item(3).Enabled = False
            Me.cmdEdSectores.Item(4).Enabled = False
            mnuModSec_Click
        Case Is = 2
             If Me.grSectores.Row > 1 Then
                strSec = Me.grSectores.TextMatrix(Me.grSectores.Row, 1)
                strAsi = Me.grSectores.TextMatrix(Me.grSectores.Row, 3)
                strEns = Left(Me.cmb_des_ens_subsec.Text, 3)
                strGra = Me.cmb_num_gra_subsec.Text
                ordold = Me.grSectores.TextMatrix(Me.grSectores.Row, 0)
                ordnew = Me.grSectores.TextMatrix(Me.grSectores.Row - 1, 0)
                Sql = "UPDATE subsectores SET ORD_ASI = " & ordnew & " WHERE cod_sec = '" & strSec & "' AND cod_asi = '" & strAsi & "' AND cod_ens = '" & strEns & "' AND num_gra = '" & strGra & "'"
                conn.Execute Sql
                i = Me.grSectores.Row
                strSec = Me.grSectores.TextMatrix(Me.grSectores.Row - 1, 1)
                strAsi = Me.grSectores.TextMatrix(Me.grSectores.Row - 1, 3)
                Sql = "UPDATE subsectores SET ORD_ASI = " & ordold & " WHERE cod_sec = '" & strSec & "' AND cod_asi = '" & strAsi & "' AND cod_ens = '" & strEns & "' AND num_gra = '" & strGra & "'"
                conn.Execute Sql
                Refresca_Tabla
                Me.grSectores.Row = i - 1
                Me.grSectores.RowSel = i - 1
                Me.grSectores.Col = 0
                Me.grSectores.ColSel = Me.grSectores.Cols - 1
                
                'Log administracion de subsectores
                accion_realizada = "El funcionario a subido el subsector " & Me.grSectores.TextMatrix(Me.grSectores.Row, 4) _
                                 & " que pertenece al sector " & Me.grSectores.TextMatrix(Me.grSectores.Row, 2)
                log = Inserta_Vitacora_Profesores(rut_fun, "Subir subsector", accion_realizada)
                'Fin de log
                
                genera_log "Subio curso en lista", strSec, strAsi
            End If
        Case 3:
            Frame_Sectores.Visible = True
            Me.lst_nom_sec.Visible = False
            Me.lst_sub_sec.Visible = False
            flag_new = True
            txt_cod_sec.Text = ""
            txt_cod_subsec.Text = ""
            txt_nom_sec.Text = ""
            txt_nom_subsec.Text = ""
            cmdPlanEst(1).Enabled = False
            cmdPlanEst(0).Enabled = False
            cmb_des_ens_subsec.Enabled = False
            cmb_num_gra_subsec.Enabled = False
            Me.cmdEdSectores.Item(0).Enabled = False
            Me.cmdEdSectores.Item(1).Enabled = False
            Me.cmdEdSectores.Item(2).Enabled = False
            Me.cmdEdSectores.Item(3).Enabled = False
            Me.cmdEdSectores.Item(4).Enabled = False
        Case 4:
            If MsgBox("Con esta accion usted eliminara el subsector, esta seguro de realizar esa accion?", vbQuestion + vbYesNo) = vbYes Then
                strSec = Me.grSectores.TextMatrix(Me.grSectores.Row, 1)
                strAsi = Me.grSectores.TextMatrix(Me.grSectores.Row, 3)
                strEns = Left(Me.cmb_des_ens_subsec.Text, 3)
                strGra = Me.cmb_num_gra_subsec.Text
                conn.Execute ("DELETE FROM SUBSECTORES WHERE COD_SEC='" & strSec & "' AND COD_ASI='" & strAsi & "' AND COD_ENS='" & strEns & "' AND NUM_GRA='" & strGra & "'")
                MsgBox "SubSector eliminado"
                
                'Log administracion de subsectores
                accion_realizada = "El funcionario a eliminado el subsector " & Me.grSectores.TextMatrix(Me.grSectores.Row, 4) _
                                 & " que pertenece al sector " & Me.grSectores.TextMatrix(Me.grSectores.Row, 2)
                log = Inserta_Vitacora_Profesores(rut_fun, "Eliminación de subsector", accion_realizada)
                'Fin de log
                
                genera_log "Eliminar", strSec, strAsi
            End If
            Llena_Tabla
    End Select
End Sub

Private Sub cmdPlanEst_Click(Index As Integer)
    Dim i As Integer
    Dim bGraba As Boolean
    Select Case Index
        Case Is = 0
            conn.Execute "REPLACE INTO plan_estudio (agno,cod_ens,num_gra,decres_plan,agno_decres,plan_est,agno_plan) VALUES ('" & Anno & " ','" & Left(Me.cmb_des_ens_subsec.Text, 3) & "','" & Me.cmb_num_gra_subsec.Text & "','" & Me.txtPlan_Est.Item(0).Text & "','" & Me.txtPlan_Est.Item(1).Text & "','" & Me.txtPlan_Est.Item(2).Text & "','" & Me.txtPlan_Est.Item(3).Text & "')"
            For i = 1 To nNumMant
                conn.Execute (strMantAsig(i))
            Next
            GoSub LimpiaPantalla
            enPantalla = False
            bModific = False
        Case Is = 1
            If enPantalla Then
                GoSub LimpiaPantalla
                enPantalla = False
                bModific = False
            Else
                Unload Me
            End If
    End Select
    'EnPantalla = False
    
Exit Sub
    
LimpiaPantalla:
    Me.txtPlan_Est.Item(0).Text = ""
    Me.txtPlan_Est.Item(1).Text = ""
    Me.txtPlan_Est.Item(2).Text = ""
    Me.txtPlan_Est.Item(3).Text = ""
    Me.cmb_des_ens_subsec.Text = ""
    Me.cmb_num_gra_subsec.Text = ""
    Me.cmb_num_gra_subsec.Clear
    Me.grSectores.Rows = 1
    Return
End Sub

Private Sub Combo_sit_fin_alu_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 And Len(Me.Combo_sit_fin_alu.Text) <> 0 Then
    Btn_Ace_res_pos_Click
End If
End Sub


Private Sub Command1_Click()
    cmdPlanEst(1).Enabled = True
    cmdPlanEst(0).Enabled = True
    Frame_Sectores.Visible = False
    cmb_des_ens_subsec.Enabled = True
    cmb_num_gra_subsec.Enabled = True
    Me.cmdEdSectores.Item(0).Enabled = True
    Me.cmdEdSectores.Item(1).Enabled = True
    Me.cmdEdSectores.Item(2).Enabled = True
    Me.cmdEdSectores.Item(3).Enabled = True
    Me.cmdEdSectores.Item(4).Enabled = True
End Sub

Private Sub Command2_Click()
Me.Frame_Sectores.Visible = False
    cmdPlanEst(1).Enabled = True
    cmdPlanEst(0).Enabled = True
    cmb_des_ens_subsec.Enabled = True
    cmb_num_gra_subsec.Enabled = True
    Me.cmdEdSectores.Item(0).Enabled = True
    Me.cmdEdSectores.Item(1).Enabled = True
    Me.cmdEdSectores.Item(2).Enabled = True
    Me.cmdEdSectores.Item(3).Enabled = True
    Me.cmdEdSectores.Item(4).Enabled = True
End Sub

Private Sub dtp_fec_ret_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 And Len(Me.dtp_fec_ret.Value) <> 0 Then
    Me.txt_causa_ret.Enabled = True
    Me.txt_causa_ret.SetFocus
End If
End Sub

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

Private Sub Form_Load()

'Call menuhabilitado(false)
Busqueda = 1
Form_Res_Pos.KeyPreview = True
enPantalla = False
bModific = False
'nNumMant = 0
Flag_sub = False
Set rs = New ADODB.Recordset
Set RsAux = New ADODB.Recordset

If ManTab = "ret" Then
    'Form_Res_Pos.Height = 7400
    'Form_Res_Pos.Width = 11380
    Call Form_main.hideframesectores
    Form_Res_Pos.Caption = "Retiros de Alumnos"
    'Form_Res_Pos.Frame_Ret.Left = 120
    'Form_Res_Pos.Frame_Ret.Top = 120
    'Form_Res_Pos.Frame_Ret.Height = 6735
    'Form_Res_Pos.Frame_Ret.Width = 11055
    Form_Res_Pos.Frame_Ret.Visible = True
    Me.dtp_fec_ret.Value = Date
    Me.grd_retiro.FixedCols = 0
    Me.grd_retiro.FixedRows = 1
    Me.grd_retiro.FormatString = "R.U.N          |Apellido Paterno  |Apellido Materno  |Nombres                              |Nivel |Letra|Enseñanza|Fecha Matrícula | Nº Matrícula"
    Me.grd_retirados.FixedCols = 0
    Me.grd_retirados.FixedRows = 1
    Me.grd_retirados.FormatString = "R.U.N          |Apellido Paterno  |Apellido Materno  |Nombres                              |Nivel |Letra|Enseñanza|Fecha Matrícula |Fecha Retiro | Causa                   |Siguió en        "
    CentrarForma Me
    Form_Res_Pos.Show
    Me.Opt_retiro(0).Value = True
ElseIf ManTab = "asi" Then
    Dim rsRemoto As ADODB.Recordset
    Call Form_main.hideframesectores
    Me.frame_PlanEstudio.Visible = True
    Form_Res_Pos.Caption = "Mantención de Sub Sectores"
    'Me.Height = 6855
    'Me.Width = 9300
    'frame_PlanEstudio.Top = 0
    'frame_PlanEstudio.Left = 100
    CentrarForma Me
    Set rsRemoto = conn.Execute("SELECT * FROM `codigos_ensenanza` ORDER BY ORD_ENS")
    Me.cmb_des_ens_subsec.Clear
    While Not rsRemoto.EOF
        Me.cmb_des_ens_subsec.AddItem rsRemoto("COD_ENS") & " - " & rsRemoto("DES_ENS")
        rsRemoto.MoveNext
    Wend
    rsRemoto.Close
    'modificado por jvv 09-08-2022
    'modificado por jvv 04-05-2022
    Me.grSectores.Cols = 9
    Me.grSectores.ColWidth(0) = 600
    Me.grSectores.ColWidth(1) = 0
    Me.grSectores.ColWidth(2) = 2500
    Me.grSectores.ColWidth(3) = 700
    Me.grSectores.ColWidth(4) = 2600  'tenia 3600
    Me.grSectores.ColWidth(5) = 1000
    'modificado por jvv 09-03-2021
    'Me.grSectores.ColWidth(6) = 0
    Me.grSectores.ColWidth(6) = 1000
    Me.grSectores.ColWidth(7) = 1000
    Me.grSectores.ColWidth(8) = 0
    Me.grSectores.Enabled = True
    Me.grSectores.FormatString = "Orden       |Cod Sector  |Sector Aprendizaje  |Cod Sub|Sub Sector      |Prueba Nivel |Asig Electiva        |Asig Produndización    "
    Me.Show
ElseIf ManTab = "res_pos" Then
    Form_Res_Pos.Caption = "Resultados de postulaciones"
    'Form_Res_Pos.Height = 6850
    Form_Res_Pos.Width = 8620
    Call Form_main.hideframesectores
    'Me.Frame_res_pos.Top = 0
    'Me.Frame_res_pos.Left = 40
    Form_Res_Pos.Frame_res_pos.Visible = True
    'se agrega validacion 23-05-2022
    If Form_Res_Pos.Combo_sit_fin_alu.ListIndex <> -1 Then
        Form_Res_Pos.Combo_sit_fin_alu.ListIndex = 0
    End If
    Me.Grd_res_pos.FixedRows = 1
    Me.Grd_res_pos.FixedCols = 0
    Me.Grd_res_pos.FormatString = "R.U.N          |Apellido Paterno  |Apellido Materno  |Nombres                              |Nivel |Tipo de Enseñanza"
    CentrarForma Me
    
    If Form_NFicha_PRoceso.proceso <> 0 And Form_NFicha_PRoceso.run_actual <> "" Then
    Me.Height = 4035
    Else
    End If
    
    Form_Res_Pos.Show
    'Call menuhabilitado(True)
    
    Me.Btn_Ace_res_pos.Enabled = False
    Me.Txt_rut_alu_res_pos.Locked = True
    Me.Txt_Dig_alu_res_pos.Locked = True
    Me.txt_curso_res_pos.Locked = True
    Me.txt_fec_pos.Locked = True
    Me.txt_fecha_eval.Locked = True
    Me.txt_hora_eval.Locked = True
    Me.Txt_res_eval.Enabled = False
    'Me.Combo_sit_fin_alu.Enabled = False
    Me.lst_nom_sec.Visible = False
    'Me.lst_nom_subsec.Visible = False
    Call LlenaCombo(cmb_des_ens_subsec, "codigos_ensenanza", "des_ens", "order by ord_ens", conn)
    Me.cmb_num_gra_subsec.Enabled = False
    'Me.cmb_nom_sec.Enabled = False
    Me.txt_nom_subsec.Enabled = False
    Me.txt_cod_subsec.Enabled = False
    
    If Form_NFicha_PRoceso.proceso <> 0 And Form_NFicha_PRoceso.run_actual <> "" Then
    Me.Height = 4035
    'Prueba
'Dim rs As ADODB.Recordset
Set rs = New ADODB.Recordset
Set rs2 = New ADODB.Recordset
Dim a, b As String



    a = "SELECT * FROM postulaciones where ci_alu = '" & Form_NFicha_PRoceso.run_actual & "' order by fec_pos DESC"
    b = "SELECT * FROM postulantes p, codigos_ensenanza c WHERE p.cod_ens = c.cod_ens AND p.ci_alu = '" & Form_NFicha_PRoceso.run_actual & "'"
    
    txt_nom_alu.Text = Form_NFicha_PRoceso.cl_nombre
    rs.CursorLocation = adUseClient
    rs.Open a, conn
    rs2.Open b, conn
    
    If rs.RecordCount > 0 Then
    Me.Txt_rut_alu_res_pos.Text = separarut(rs("ci_alu"))
    Me.Txt_Dig_alu_res_pos.Text = separadigito(rs("ci_alu"))
    curso = DevuelveCampo("codigos_ensenanza", "", "des_ens", "cod_ens = '" & Form_NFicha_PRoceso.run_actual & "'", conn)
    Me.txt_curso_res_pos.Text = rs2("NUM_GRA") + "° " + rs2("DES_ENS")
    rs2.Close
    
    Me.txt_fec_pos.Text = rs("fec_pos")
    Me.txt_fecha_eval.Text = Format(rs("VII_hor_eval"), "dd-mm-yyyy")
    Me.txt_hora_eval.Text = IIf(Not IsNull(Format(rs!vii_hor_eval, "HH:mm:ss")), Right(Format(rs("VII_hor_eval"), "HH:mm:ss"), 8), "")
    If Not IsNull(rs("VIII_res_eval")) Then Me.Txt_res_eval.Text = rs("VIII_res_eval")
    Me.Txt_res_eval.Enabled = True
    If Me.Txt_res_eval <> "" Then
        Me.Combo_sit_fin_alu.Enabled = True
    Else
       ' Me.Combo_sit_fin_alu.Enabled = False
    End If
    Select Case rs("VIII_sit_fin_alu")
        Case "A"
            Me.Combo_sit_fin_alu.ListIndex = 0
        Case "R"
            Me.Combo_sit_fin_alu.ListIndex = 1
        Case "P"
            Me.Combo_sit_fin_alu.ListIndex = 2
        Case "F"
            Me.Combo_sit_fin_alu.ListIndex = 3
    End Select
    SendKeys "{end}"
    Me.Txt_res_eval.SetFocus
    Me.Btn_Ace_res_pos.Enabled = True
    End If
    rs.Close
    
    End If
    
End If

End Sub

Private Sub Form_Unload(Cancel As Integer)
    Call menuhabilitado(True)
    
    If Form_NFicha_PRoceso.proceso = 1 Then
    Form_NFicha_PRoceso.Enabled = True
    End If

End Sub

Private Sub Grd_res_pos_DblClick()
'Prueba
Dim rs As ADODB.Recordset
Set rs = New ADODB.Recordset
Dim a As String

cole = DevuelveCampo("cfg", "", "valor", "param = 'CODBC'", conn)
    
If cole = "HUE001" Or cole = "ALT001" Then
    Txt_res_eval.MaxLength = 3
    lbl_porcentaje = "%"
Else
    Txt_res_eval.MaxLength = 2
    lbl_porcentaje = ""
End If

Indi = 0
Busqueda = 0
Fila = Me.Grd_res_pos.Row
rut = arraygrilla(Fila, 1)
Apellido1 = arraygrilla(Fila, 2)
Apellido2 = arraygrilla(Fila, 3)
nombre = arraygrilla(Fila, 4)
curso = arraygrilla(Fila, 5) + "º " + DevuelveCampo("codigos_ensenanza", "", "des_ens", "cod_ens = '" & arraygrilla(Fila, 6) & "'", conn)
RutGlobal = rut
Me.txt_nom_alu.Text = Trim(Apellido1) + " " + Trim(Apellido2) + " " + Trim(nombre)
Me.txt_nom_alu.Locked = True
a = "SELECT ci_alu FROM postulaciones where ci_alu = '" & rut & "' and fec_pos = '0000-00-00'"
rs.Open a, conn
If rs.RecordCount > 0 Then
    var_sql = "update postulaciones set fec_pos = date_format(now(),'%Y-%m-%d') where ci_alu = '" & rut & "'"
    conn.Execute var_sql
End If
rs.Close


    a = "SELECT * FROM postulaciones where ci_alu = '" & rut & "' order by fec_pos DESC"
    
    
    rs.CursorLocation = adUseClient
    rs.Open a, conn
    If rs.RecordCount > 0 Then
    Me.Txt_rut_alu_res_pos.Text = separarut(rs("ci_alu"))
    Me.Txt_Dig_alu_res_pos.Text = separadigito(rs("ci_alu"))
    Me.txt_curso_res_pos.Text = curso
    Me.txt_fec_pos.Text = rs("fec_pos")
    Me.txt_fecha_eval.Text = Format(rs("VII_hor_eval"), "dd-mm-yyyy")
    Me.txt_hora_eval.Text = IIf(Not IsNull(Format(rs!vii_hor_eval, "HH:mm:ss")), Right(Format(rs("VII_hor_eval"), "HH:mm:ss"), 8), "")
    If Not IsNull(rs("VIII_res_eval")) Then Me.Txt_res_eval.Text = val(rs("VIII_res_eval"))
    Me.Txt_res_eval.Enabled = True
    If Me.Txt_res_eval <> "" Then
        Me.Combo_sit_fin_alu.Enabled = True
    Else
       ' Me.Combo_sit_fin_alu.Enabled = False
    End If
    Select Case rs("VIII_sit_fin_alu")
        Case "A"
            Me.Combo_sit_fin_alu.ListIndex = 0
        Case "R"
            Me.Combo_sit_fin_alu.ListIndex = 1
        Case "P"
            Me.Combo_sit_fin_alu.ListIndex = 2
        Case "F"
            Me.Combo_sit_fin_alu.ListIndex = 3
    End Select
    SendKeys "{end}"
    Me.Txt_res_eval.SetFocus
    Me.Btn_Ace_res_pos.Enabled = True
    End If
    rs.Close
    
End Sub



Private Sub grd_retirados_DblClick()
If Len(Trim(Me.grd_retirados.Text)) > 0 And Me.grd_retirados.Row >= 1 Then
    Busqueda = 0
    Fila = Me.grd_retirados.Row
    rut$ = arraygrilla(Fila, 1)
    Apellido1 = arraygrilla(Fila, 2)
    Apellido2 = arraygrilla(Fila, 3)
    nombre = arraygrilla(Fila, 4)
    Num_Gra = Trim(arraygrilla(Fila, 5))
    Let_Cur = Trim(arraygrilla(Fila, 6))
    Cod_Ens = arraygrilla(Fila, 7)
    Num_MAT = arraygrilla(Fila, 8)
    fec_mat = arraygrilla(Fila, 9)
    fec_ret = arraygrilla(Fila, 10)
    causa = arraygrilla(Fila, 11)
    siguioen = arraygrilla(Fila, 12)
    jornada = DevuelveCampo("jornadas", "", "des_jor", "cod_jor = '" & arraygrilla(Fila, 13) & "'", conn)
    Me.Txt_nom_alu_ret.Text = Trim(Apellido1) + " " + Trim(Apellido2) + " " + Trim(nombre)
    Me.Txt_rut_alu_ret.Text = separarut(rut$)
    Me.Txt_Dig_alu_ret.Text = separadigito(rut$)
    Me.txt_fec_mat.Text = fec_mat
    Me.txt_cur_ret.Text = Num_Gra + "-" + Let_Cur + " " + DevuelveCampo("codigos_ensenanza", "", "des_ens", "cod_ens = '" & Cod_Ens & "'", conn)
    Me.Txt_jor_alu_ret.Text = jornada
    Me.Txt_num_mat_ret.Text = Num_MAT
    If Len(Trim(fec_ret)) <> 0 Then
        Me.dtp_fec_ret.Value = fec_ret
    End If
    Me.txt_causa_ret.Text = causa
    Me.txt_seg_ret.Text = siguioen
    Me.chk_busqaprox_ret.Enabled = False
    Txt_nom_alu_ret.Enabled = False
    Txt_rut_alu_ret.Enabled = False
    Txt_Dig_alu_ret.Enabled = False
    Me.txt_fec_mat.Enabled = False
    Me.txt_cur_ret.Enabled = False
    Me.Txt_jor_alu_ret.Enabled = False
    Me.Txt_num_mat_ret.Enabled = False
    Me.dtp_fec_ret.Enabled = False
    Me.txt_causa_ret.Enabled = False
    Me.txt_seg_ret.Enabled = False
    Me.btn_anular_retiro.Enabled = True
    Me.btn_anular_retiro.SetFocus
Else
    MsgBox ("Selección incorrecta")
    If Busqueda = 1 Then
        Me.Txt_nom_alu_ret.SetFocus
    End If
End If
End Sub

Private Sub grd_retiro_DblClick()
Dim RcFec As ADODB.Recordset
Set RcFec = New ADODB.Recordset

If Len(Trim(Me.grd_retiro.Text)) > 0 And Me.grd_retiro.Row >= 1 Then
    Busqueda = 0
    Fila = Me.grd_retiro.Row
    rut$ = arraygrilla(Fila, 1)
    Apellido1 = arraygrilla(Fila, 2)
    Apellido2 = arraygrilla(Fila, 3)
    nombre = arraygrilla(Fila, 4)
    Num_Gra = Trim(arraygrilla(Fila, 5))
    Let_Cur = Trim(arraygrilla(Fila, 6))
    Cod_Ens = arraygrilla(Fila, 7)
    fec_mat = arraygrilla(Fila, 8)
    Num_MAT = arraygrilla(Fila, 9)

    
    jornada = DevuelveCampo("jornadas", "", "des_jor", "cod_jor = '" & arraygrilla(Fila, 10) & "'", conn)
    Me.Txt_nom_alu_ret.Text = Trim(Apellido1) + " " + Trim(Apellido2) + " " + Trim(nombre)
    Me.Txt_rut_alu_ret.Text = separarut(rut$)
    Me.Txt_Dig_alu_ret.Text = separadigito(rut$)
    Me.txt_fec_mat.Text = fec_mat
    Me.txt_cur_ret.Text = Num_Gra + "-" + Let_Cur + " " + DevuelveCampo("codigos_ensenanza", "", "des_ens", "cod_ens = '" & Cod_Ens & "'", conn)
    Me.Txt_jor_alu_ret.Text = jornada
    Me.Txt_num_mat_ret.Text = Num_MAT
    Sql = "select fec_ing_Curso from alu_x_cur where  ci_alu = '" & rut$ & "' and cod_ens = '" & Cod_Ens & "' and num_gra = '" & Num_Gra & "' and let_cur ='" & Let_Cur & "' AND agno=" & Anno & " and activo_alu = 'SI';"
    RcFec.Open Sql, conn
    If RcFec.RecordCount > 0 Then
        Me.dtp_fec_ret.MinDate = RcFec("fec_ing_curso")
    Else
        Me.dtp_fec_ret.MinDate = Me.txt_fec_mat.Text
    End If
    RcFec.Close
    Me.txt_causa_ret.Text = ""
    Me.txt_seg_ret.Text = ""
    Me.chk_busqaprox_ret.Enabled = False
    Txt_nom_alu_ret.Enabled = False
    Txt_rut_alu_ret.Enabled = False
    Txt_Dig_alu_ret.Enabled = False
    Me.txt_fec_mat.Enabled = False
    Me.txt_cur_ret.Enabled = False
    Me.Txt_jor_alu_ret.Enabled = False
    Txt_num_mat_ret.Enabled = False
    Me.dtp_fec_ret.Enabled = True
    Me.txt_causa_ret.Enabled = True
    Me.txt_seg_ret.Enabled = True
    Btn_ace_ret.Enabled = True
    Me.dtp_fec_ret.SetFocus
Else
    MsgBox ("Selección incorrecta")
    If Busqueda = 1 Then
        Me.Txt_nom_alu_ret.SetFocus
    End If
End If
End Sub


Private Sub grSectores_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
    
    Select Case Button
        Case Is = vbLeftButton
            
        Case Is = vbRightButton
            PopupMenu mnuManejaGrilla
    End Select
    
End Sub
Private Sub lblCerrar_Click()
    Me.Frame_Sectores.Visible = False
    cmdPlanEst(1).Enabled = True
    cmdPlanEst(0).Enabled = True
    cmb_des_ens_subsec.Enabled = True
    cmb_num_gra_subsec.Enabled = True
    Me.cmdEdSectores.Item(0).Enabled = True
    Me.cmdEdSectores.Item(1).Enabled = True
    Me.cmdEdSectores.Item(2).Enabled = True
    Me.cmdEdSectores.Item(3).Enabled = True
    Me.cmdEdSectores.Item(4).Enabled = True
End Sub

Private Sub lst_nom_sec_DblClick()
Indi = 0
Busqueda = 0
Me.txt_nom_sec.Text = Me.lst_nom_sec.Text
a = "SELECT * FROM sectores where nom_sec = " & "'" & txt_nom_sec & "'"
rs.CursorLocation = adUseClient
rs.Open a, conn
If rs.RecordCount > 0 Then
    txt_cod_sec.Text = rs(0)
    Me.lst_nom_sec.Visible = False
    Me.lst_sub_sec.Visible = False
    Me.txt_nom_sec.SetFocus
    SendKeys "{end}"
End If
rs.Close

End Sub

Private Sub lst_nom_sec_GotFocus()
Me.btn_ace_sec.Enabled = False
End Sub

Private Sub lst_nom_sec_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
 Call lst_nom_sec_DblClick
 'Me.Txt_des_tipoapo.Text = Me.Lst_des_tipoapo.List(Me.Lst_des_tipoapo.ListIndex)
End If

End Sub

Private Sub lst_nom_sec_LostFocus()
Me.btn_ace_sec.Enabled = True
End Sub







Private Sub lst_sub_sec_DblClick()
Indi = 0
Busqueda = 0
Me.txt_nom_subsec.Text = Me.lst_sub_sec.Text
a = "SELECT * FROM subsectores where nom_asi = " & "'" & txt_nom_subsec & "'"
rs.CursorLocation = adUseClient
rs.Open a, conn
If rs.RecordCount > 0 Then
    txt_cod_sec.Text = rs(1)

    Me.txt_nom_sec.SetFocus
    SendKeys "{end}"
End If
rs.Close
    Me.lst_nom_sec.Visible = False
    Me.lst_sub_sec.Visible = False
End Sub

Private Sub mnuAgreSec_Click()
    MsgBox "Agrega Sector"
End Sub

Private Sub mnuAgreSub_Click()
    MsgBox "Agrega sub sector"
End Sub

Private Sub mnuModSec_Click()
    Flag_sub = True
    Dim rsDatos As ADODB.Recordset
    Set rsDatos = conn.Execute("SELECT * FROM SECTORES WHERE COD_SEC='" & Me.grSectores.TextMatrix(Me.grSectores.Row, 1) & "'")
    If rsDatos.EOF Then
    Else
        Busqueda = 0
        Me.txt_cod_sec = rsDatos("COD_SEC")
        Me.txt_nom_sec = rsDatos("NOM_SEC")
        Me.Frame_Sectores.Visible = True
    End If
    rsDatos.Close
    mnuModSub_Click
End Sub

Private Sub mnuModSub_Click()
    Dim rsServ As ADODB.Recordset
    Dim strSec As String
    Dim strAsi As String
    Dim strEns As String
    Dim strGra As String
    Dim AsiElec As String 'modificado por jvv 10-03-2021
    
    strSec = Me.grSectores.TextMatrix(Me.grSectores.Row, 1)
    strAsi = Me.grSectores.TextMatrix(Me.grSectores.Row, 3)
    strEns = Left(Me.cmb_des_ens_subsec.Text, 3)
    strGra = Me.cmb_num_gra_subsec.Text
    Set rsServ = conn.Execute("SELECT * FROM SUBSECTORES WHERE COD_SEC='" & strSec & "' AND COD_ASI='" & strAsi & "' AND COD_ENS='" & strEns & "' AND NUM_GRA='" & strGra & "'")
    If rsServ.EOF Then
    Else
        Me.txt_cod_subsec.Text = rsServ("cod_asi")
        Me.txt_nom_subsec.Text = rsServ("nom_asi")
        Me.ChkPnivel.Value = rsServ("pn")
        'MODIFICADO POR JVV 10-03-2022
        If rsServ("asi_elec") = "S" Then
            OptSi.Value = True
            OptNo.Value = False
        Else
            OptNo.Value = True
            OptSi.Value = False
        End If
        Me.Frame_Sectores.Visible = True
    End If
    rsServ.Close
    Flag_sub = False
End Sub

Private Sub mnuQuitaSec_Click()
    MsgBox "Quita Sector"
End Sub

Private Sub mnuQuitSub_Click()
    MsgBox "Quita sub Sector"
End Sub

Private Sub Opt_retiro_Click(Index As Integer)
Busqueda = 1
Me.chk_busqaprox_ret.Enabled = True
Me.Txt_nom_alu_ret.Text = ""
Me.Txt_rut_alu_ret.Text = ""
Me.Txt_Dig_alu_ret.Text = ""
Me.txt_fec_mat.Text = ""
Me.txt_cur_ret.Text = ""
Me.Txt_jor_alu_ret.Text = ""
Me.Txt_num_mat_ret.Text = ""
'Me.dtp_fec_ret.Value = fec_ret
Me.txt_causa_ret.Text = ""
Me.txt_seg_ret.Text = ""
Me.grd_retiro.Rows = 2
Me.grd_retiro.Clear
Me.grd_retiro.FormatString = "R.U.N          |Apellido Paterno  |Apellido Materno  |Nombres                              |Nivel |Letra|Enseñanza|Fecha Matrícula | Nº Matrícula"
Me.grd_retirados.Rows = 2
Me.grd_retirados.Clear
Me.grd_retirados.FormatString = "R.U.N          |Apellido Paterno  |Apellido Materno  |Nombres                              |Nivel |Letra|Enseñanza|Fecha Matrícula |Fecha Retiro | Causa                   |Siguió en        "
If Opt_retiro(0) Then
    Me.Frame_retirados.Visible = False
    Me.frame_noretirados.Visible = True
    Me.Btn_ace_ret.Enabled = False
    Me.dtp_fec_ret.Enabled = True
    Me.dtp_fec_ret.Value = Date
    Me.txt_causa_ret.Enabled = True
    Me.txt_seg_ret.Enabled = True
Else
    Me.frame_noretirados.Visible = False
    Me.Frame_retirados.Visible = True
    Me.btn_anular_retiro.Enabled = False
    Me.dtp_fec_ret.Enabled = False
    Me.txt_causa_ret.Enabled = False
    Me.txt_seg_ret.Enabled = False
End If
Me.Txt_nom_alu_ret.Enabled = True
Me.Txt_nom_alu_ret.SetFocus

End Sub


Private Sub txt_causa_ret_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 And Len(Trim(Me.txt_causa_ret.Text)) <> 0 Then
    Me.txt_seg_ret.Enabled = True
    Me.txt_seg_ret.SetFocus
End If
End Sub

Private Sub txt_cod_sec_KeyPress(KeyAscii As Integer)
'RS.CursorLocation = adUseClient
'If KeyAscii = 13 And Len(Trim(Me.txt_cod_sec.Text)) <> 0 Then
'    If Len(Trim(Me.txt_nom_sec.Text)) <> 0 Then
'        If ExistReg("sectores", "cod_sec='" & txt_cod_sec & "'", conn) Then
'            MsgBox ("Código de Sector ya existe")
'            Me.txt_cod_sec.SetFocus
'            SendKeys "{home}+{end}"
'        Else
'            btn_ace_sec_Click
'        End If
'    Else
'        RS.Open "SELECT * FROM sectores where cod_sec = '" & Me.txt_cod_sec.Text & "'", conn
'        If RS.RecordCount > 0 Then
'            busqueda = 0
'            Me.txt_cod_sec.Enabled = False
'            Me.txt_nom_sec.Text = RS("nom_sec")
'            Me.Label19.Caption = "Editando Sector Existente."
'            Me.btn_eli_sec.Enabled = True
'            Me.txt_nom_sec.SetFocus
'        Else
'            busqueda = 0
'            Me.txt_nom_sec.SetFocus
'            Me.Label19.Caption = "Ingresando Nuevo Sector."
'            Me.btn_eli_sec.Enabled = False
'            ingxcodigo = 1
'        End If
'        RS.Close
'    End If
'End If
'
End Sub

Private Sub txt_cod_subsec_KeyPress(KeyAscii As Integer)
'RS.CursorLocation = adUseClient
'modalidad = devuelvecampo("codigos_ensenanza", "", "cod_ens", "des_ens = '" & Me.cmb_des_ens_subsec.Text & "'", conn)
'Sector = devuelvecampo("sectores", "", "cod_sec", "nom_sec = '" & Me.cmb_nom_sec.Text & "'", conn)
'nivelsubsec = Me.cmb_num_gra_subsec.Text
'If KeyAscii = 13 And Len(Trim(Me.txt_cod_subsec.Text)) <> 0 Then
'    If Len(Trim(Me.txt_nom_subsec.Text)) <> 0 Then
'        If ExistReg("subsectores", "cod_asi= '" & Trim(txt_cod_subsec) & "' and cod_sec = '" & Sector & "' and cod_ens = '" & modalidad & "' and num_gra = '" & nivelsubsec & "'", conn) Then
'            MsgBox ("Código de Sub-Sector ya existe")
'            Me.txt_cod_subsec.SetFocus
'            SendKeys "{home}+{end}"
'        Else
'            btn_ace_subsec_Click
'        End If
'    Else
'        RS.Open "SELECT * FROM subsectores where cod_asi='" & txt_cod_subsec & "'and cod_sec = '" & Sector & "' and cod_ens = '" & modalidad & "' and nivel = '" & nivelsubsec & "'", conn
'        If RS.RecordCount > 0 Then
'            busqueda = 0
'            Me.txt_cod_subsec.Enabled = False
'            Me.txt_nom_subsec.Text = RS("nom_asi")
'            Me.Label20.Caption = "Editando Subsector Existente"
'            Me.btn_eli_subsec.Enabled = True
'            Me.txt_nom_subsec.SetFocus
'            ingxcodigo = 0
'        Else
'¡ '            busqueda = 0
'            Me.txt_nom_subsec.SetFocus
'            Me.Label16.Caption = "Ingresando Nuevo Sub-Sector"
'            Me.btn_eli_subsec.Enabled = False
'            ingxcodigo = 1
'        End If
'        RS.Close
'    End If
'End If
End Sub

Private Sub txt_nom_alu_Change()
If Busqueda = 1 And Len(Trim(Me.txt_nom_alu.Text)) > 0 And Me.chk_busqaprox_respos.Value = 0 Then
    Criterio = "'" + Me.txt_nom_alu.Text + "%'"
    Call LlenaGrilla(Grd_res_pos, "R.U.N          ,Apellido Paterno  ,Apellido Materno  ,Nombres                              ,Nivel , Tipo de Enseñanza", "postulantes", " ci_alu; ape_pat_alu; ape_mat_alu; nom_alu; num_gra; cod_ens", "ape_pat_alu like " & Criterio & "and not matriculado_alu order by ape_pat_alu, ape_mat_alu, nom_alu", conn)
ElseIf Busqueda = 1 And Len(Trim(Me.txt_nom_alu.Text)) = 0 Then
    Me.Grd_res_pos.Clear
    Me.Grd_res_pos.FormatString = "R.U.N          |Apellido Paterno  |Apellido Materno  |Nombres                              |Nivel |Tipo de Enseñanza"
    Me.Grd_res_pos.Rows = 2
End If
End Sub

Private Sub txt_nom_alu_KeyPress(KeyAscii As Integer)
If KeyAscii = 27 Then
'    Txt_nom_alu.Text = ""
 '   'lst_nom_alu.Visible = False
    KeyAscii = 0
ElseIf KeyAscii = 13 And Len(Trim(Me.txt_nom_alu.Text)) <> 0 Then
    If Busqueda = 1 And Len(Trim(Me.txt_nom_alu.Text)) > 0 And Me.chk_busqaprox_respos.Value = 1 Then
        Criterio = "'" + Me.txt_nom_alu.Text + "%'"
        Call LlenaGrilla(Grd_res_pos, "R.U.N          ,Apellido Paterno  ,Apellido Materno  ,Nombres                              ,Nivel , Tipo de Enseñanza", "postulantes", " ci_alu; ape_pat_alu; ape_mat_alu; nom_alu; num_gra; cod_ens", "ape_pat_alu like " & Criterio & "and not matriculado_alu order by ape_pat_alu, ape_mat_alu, nom_alu", conn)
    ElseIf Busqueda = 1 And Len(Trim(Me.txt_nom_alu.Text)) = 0 Then
        Me.Grd_res_pos.Clear
        Me.Grd_res_pos.FormatString = "R.U.N          |Apellido Paterno  |Apellido Materno  |Nombres                              |Nivel |Tipo de Enseñanza"
        Me.Grd_res_pos.Rows = 2
    End If
ElseIf ((Chr(KeyAscii) >= "A" And Chr(KeyAscii) <= "Z") Or (Chr(KeyAscii) >= "a" And Chr(KeyAscii) <= "z")) Then Exit Sub
ElseIf (Chr(KeyAscii) >= "0" And Chr(KeyAscii) <= "9") Then Exit Sub
ElseIf KeyAscii = 8 Then Exit Sub
ElseIf KeyAscii = 32 Then Exit Sub
ElseIf Me.txt_nom_alu.Text = "" Then
        If KeyAscii = 37 Then Exit Sub
End If
    KeyAscii = 0: Exit Sub

End Sub


Private Sub Txt_nom_alu_ret_Change()
If Trim(Txt_rut_alu_ret) = "" Then
    Me.Btn_ace_ret.Enabled = False
Else
    Me.Btn_ace_ret.Enabled = True
End If

If Opt_retiro(0) Then ' si marco opcion de alumnos del colegios
    If Busqueda = 1 And Len(Trim(Me.Txt_nom_alu_ret.Text)) > 0 And Me.chk_busqaprox_ret.Value = 0 Then
        Criterio = "'" + Me.Txt_nom_alu_ret.Text + "%'"
        Call LlenaGrilla(grd_retiro, "R.U.N          ,Apellido Paterno  ,Apellido Materno  ,Nombres                              ,Nivel ,Letra,Enseñanza,Fecha Matrícula , Nº Matrícula", "postulantes p, matriculas m, cursos c, alu_x_cur ac", "p.ci_alu; ape_pat_alu; ape_mat_alu; nom_alu;  c.num_gra; c.let_cur; c.cod_ens; m.fec_mat; m.num_mat; c.cod_jor", "p.ci_alu = m.ci_alu and m.ci_alu = ac.ci_alu and m.activo_alu = ac.activo_alu and ac.cod_ens = c.cod_ens and ac.num_gra = c.num_gra and ac.let_cur = c.let_cur and m.activo_alu = 'SI' AND ac.agno=c.agno AND ac.agno=m.anno_mat AND ac.agno=" & Anno & "  and ape_pat_alu like " & Criterio & " order by ape_pat_alu, ape_mat_alu, nom_alu", conn)
    ElseIf Busqueda = 1 And Len(Trim(Me.Txt_nom_alu_ret.Text)) = 0 Then
        Me.grd_retiro.Clear
        Me.grd_retiro.FormatString = "R.U.N          |Apellido Paterno  |Apellido Materno  |Nombres                              |Nivel |Letra|Enseñanza|Fecha Matrícula | Nº Matrícula"
        Me.grd_retiro.Rows = 2
    End If
ElseIf Opt_retiro(1) Then ' si marco opcion de alumnos retirados
    If Busqueda = 1 And Len(Trim(Me.Txt_nom_alu_ret.Text)) > 0 And Me.chk_busqaprox_ret.Value = 0 Then
        Criterio = "'" + Me.Txt_nom_alu_ret.Text + "%'"
        Call LlenaGrilla(grd_retirados, "R.U.N          ,Apellido Paterno  ,Apellido Materno  ,Nombres                              ,Nivel ,Letra,Enseñanza,Nº Matrícula, Fecha Matrícula, Fecha Retiro , Causa                   ,Siguió en        ", "postulantes p, matriculas m, cursos c, alu_x_cur ac", "p.ci_alu; ape_pat_alu; ape_mat_alu; nom_alu;  c.num_gra; c.let_cur; c.cod_ens; m.num_mat; m.fec_mat; m.fec_retiro; m.obs_retiro; m.destino_retiro; c.cod_jor", "p.ci_alu = m.ci_alu AND m.ci_alu = ac.ci_alu AND m.activo_alu = ac.activo_alu AND ac.cod_ens = c.cod_ens AND ac.num_gra = c.num_gra AND ac.let_cur = c.let_cur AND m.activo_alu = 'NO' AND ac.fec_cam ='1111-11-11' AND ac.agno=c.agno AND ac.agno=m.anno_mat AND ac.agno=" & Anno & " AND ape_pat_alu like " & Criterio & " order by ape_pat_alu, ape_mat_alu, nom_alu", conn)
    ElseIf Busqueda = 1 And Len(Trim(Me.Txt_nom_alu_ret.Text)) = 0 Then
        Me.grd_retirados.Clear
        Me.grd_retirados.FormatString = "R.U.N          |Apellido Paterno  |Apellido Materno  |Nombres                              |Nivel |Letra|Enseñanza|Fecha Matrícula |Fecha Retiro | Causa                   |Siguió en        "
        Me.grd_retirados.Rows = 2
    End If
End If

End Sub

Private Sub Txt_nom_alu_ret_KeyPress(KeyAscii As Integer)
If Opt_retiro(0) Then ' si marco opcion de alumnos del colegios
    If Len(Trim(Me.Txt_nom_alu_ret.Text)) > 0 And KeyAscii = 13 Then
        If Busqueda = 1 And Len(Trim(Me.Txt_nom_alu_ret.Text)) > 0 And Me.chk_busqaprox_ret.Value = 1 Then
            Criterio = "'" + Me.Txt_nom_alu_ret.Text + "%'"
            Call LlenaGrilla(grd_retiro, "R.U.N          ,Apellido Paterno  ,Apellido Materno  ,Nombres                              ,Nivel ,Letra,Enseñanza,Fecha Matrícula , Nº Matrícula", "postulantes p, matriculas m, cursos c, alu_x_cur ac", "p.ci_alu; ape_pat_alu; ape_mat_alu; nom_alu; c.num_gra; c.let_cur; c.cod_ens; m.fec_mat; m.num_mat; c.cod_jor", "p.ci_alu = m.ci_alu and m.ci_alu = ac.ci_alu and m.activo_alu = ac.activo_alu and ac.cod_ens = c.cod_ens and ac.num_gra = c.num_gra and ac.let_cur = c.let_cur and m.activo_alu = 'SI' AND ac.agno=c.agno AND ac.agno=m.anno_mat AND ac.agno=" & Anno & "  and ape_pat_alu like " & Criterio & " order by ape_pat_alu, ape_mat_alu, nom_alu", conn)
        ElseIf Busqueda = 1 And Len(Trim(Me.Txt_nom_alu_ret.Text)) = 0 Then
            Me.grd_retiro.Clear
            Me.grd_retiro.FormatString = "R.U.N          |Apellido Paterno  |Apellido Materno  |Nombres                              |Nivel |Letra|Enseñanza|Fecha Matrícula | Nº Matrícula"
            Me.grd_retiro.Rows = 2
        End If
    End If
ElseIf Opt_retiro(1) Then ' si marco opcion de alumnos retirados
    If Len(Trim(Me.Txt_nom_alu_ret.Text)) > 0 And KeyAscii = 13 Then
        If Busqueda = 1 And Len(Trim(Me.Txt_nom_alu_ret.Text)) > 0 And Me.chk_busqaprox_ret.Value = 1 Then
            Criterio = "'" + Me.Txt_nom_alu_ret.Text + "%'"
            Call LlenaGrilla(grd_retirados, "R.U.N          ,Apellido Paterno  ,Apellido Materno  ,Nombres                              ,Nivel ,Letra,Enseñanza,Nº Matrícula, Fecha Matrícula, Fecha Retiro , Causa                   ,Siguió en        ", "postulantes p, matriculas m, cursos c, alu_x_cur ac", "p.ci_alu; ape_pat_alu; ape_mat_alu; nom_alu;  c.num_gra; c.let_cur; c.cod_ens; m.num_mat; m.fec_mat; m.fec_retiro; m.obs_retiro; m.destino_retiro; c.cod_jor", "p.ci_alu = m.ci_alu and m.ci_alu = ac.ci_alu and m.activo_alu = ac.activo_alu and ac.cod_ens = c.cod_ens and ac.num_gra = c.num_gra and ac.let_cur = c.let_cur and m.activo_alu = 'NO' AND ac.agno=c.agno AND ac.agno=m.anno_mat AND ac.agno=" & Anno & "  and ac.fec_cam ='1111-11-11' and ape_pat_alu like " & Criterio & " order by ape_pat_alu, ape_mat_alu, nom_alu", conn)
        ElseIf Busqueda = 1 And Len(Trim(Me.Txt_nom_alu_ret.Text)) = 0 Then
            Me.grd_retirados.Clear
            Me.grd_retirados.FormatString = "R.U.N          |Apellido Paterno  |Apellido Materno  |Nombres                              |Nivel |Letra|Enseñanza|Fecha Matrícula |Fecha Retiro | Causa                   |Siguió en        "
            Me.grd_retirados.Rows = 2
        End If
    End If
End If
End Sub

Private Sub txt_nom_sec_Change()
    Dim RC As ADODB.Recordset
    ' Si el cambio lo hace un Sub no hacer nada
    If Flag_sub Then Exit Sub
    If txt_nom_sec.Text = "" Then Exit Sub
    Set RC = New ADODB.Recordset
    RC.Open "SELECT cod_sec,nom_sec FROM sectores WHERE nom_sec like '" & txt_nom_sec.Text & "%'", conn
    lst_nom_sec.Clear
    If RC.RecordCount > 0 Then
        While Not (RC.EOF)
            lst_nom_sec.AddItem RC("nom_sec")
            RC.MoveNext
        Wend
        lst_nom_sec.Visible = True
        lst_sub_sec.Visible = False
    End If
    RC.Close
End Sub

Private Sub txt_nom_sec_KeyPress(KeyAscii As Integer)
'busqueda = 1

If KeyAscii = 27 Then
    txt_nom_sec.Text = ""
    lst_nom_sec.Visible = False
    KeyAscii = 0
ElseIf KeyAscii = 13 And Len(Trim(Me.txt_nom_sec.Text)) <> 0 And Busqueda = 0 Then
    Me.lst_nom_sec.Visible = False
    btn_ace_sec_Click

ElseIf KeyAscii = 13 And Len(Trim(Me.txt_nom_sec.Text)) <> 0 And Busqueda = 1 And Not valorenlista(Form_Res_Pos.lst_nom_sec, txt_nom_sec.Text) Then
    Me.txt_cod_sec.Enabled = True
    Me.txt_cod_sec.SetFocus
    Me.lst_nom_sec.Visible = False

ElseIf ((Chr(KeyAscii) >= "A" And Chr(KeyAscii) <= "Z") Or (Chr(KeyAscii) >= "a" And Chr(KeyAscii) <= "z")) Then Exit Sub
ElseIf (Chr(KeyAscii) >= "0" And Chr(KeyAscii) <= "9") Then Exit Sub
ElseIf KeyAscii = 8 Then Exit Sub
ElseIf KeyAscii = 32 Then Exit Sub
ElseIf Me.txt_nom_subsec.Text = "" Then
        If KeyAscii = 37 Then Exit Sub
End If
    KeyAscii = 0: Exit Sub
End Sub

Private Sub txt_nom_subsec_Change()
    Dim RC As ADODB.Recordset
    ' Si el cambio lo hace un Sub no hacer nada
    If Flag_sub Then Exit Sub
    If txt_nom_subsec.Text = "" Then Exit Sub
    Set RC = New ADODB.Recordset
    strEns = Left(Me.cmb_des_ens_subsec.Text, 3)
    strGra = Me.cmb_num_gra_subsec.Text
    RC.Open "SELECT nom_asi FROM subsectores WHERE nom_asi like '" & txt_nom_subsec.Text & "%' and cod_sec = '" & txt_cod_sec.Text & "' and cod_ens = '" & strEns & "' and num_gra = '" & strGra & "'", conn
    lst_sub_sec.Clear
    If RC.RecordCount > 0 Then
        While Not (RC.EOF)
            lst_sub_sec.AddItem RC("nom_asi")
            RC.MoveNext
        Wend
        lst_nom_sec.Visible = False
        lst_sub_sec.Visible = True
    End If
    RC.Close
End Sub

Private Sub txt_nom_subsec_KeyPress(KeyAscii As Integer)
'busqueda = 1
If KeyAscii = 27 Then
    txt_nom_subsec.Text = ""
    lst_nom_subsec.Visible = False
    KeyAscii = 0
ElseIf KeyAscii = 13 And Len(Trim(Me.txt_nom_subsec.Text)) <> 0 And Busqueda = 0 Then
    'Me.lst_nom_subsec.Visible = False
    btn_ace_subsec_Click

ElseIf KeyAscii = 13 And Len(Trim(Me.txt_nom_subsec.Text)) <> 0 And Busqueda = 1 Then
    Me.txt_cod_subsec.Enabled = True
    Me.txt_cod_subsec.SetFocus
    'Me.lst_nom_subsec.Visible = False

ElseIf ((Chr(KeyAscii) >= "A" And Chr(KeyAscii) <= "Z") Or (Chr(KeyAscii) >= "a" And Chr(KeyAscii) <= "z")) Then Exit Sub
ElseIf (Chr(KeyAscii) >= "0" And Chr(KeyAscii) <= "9") Then Exit Sub
ElseIf KeyAscii = 8 Then Exit Sub
ElseIf KeyAscii = 32 Then Exit Sub
ElseIf Me.txt_nom_subsec.Text = "" Then
        If KeyAscii = 37 Then Exit Sub
End If
    KeyAscii = 0: Exit Sub

End Sub

Private Sub Txt_res_eval_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 And Len(Trim(Me.Txt_res_eval.Text)) <> 0 Then
    Me.Combo_sit_fin_alu.Enabled = True
    Me.Combo_sit_fin_alu.SetFocus
ElseIf (Chr(KeyAscii) >= "0" And Chr(KeyAscii) <= "9") Then Exit Sub
ElseIf KeyAscii = 8 Then Exit Sub
ElseIf KeyAscii = 32 Then Exit Sub
End If
KeyAscii = 0
End Sub

Private Sub txt_seg_ret_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 And Len(Trim(Me.txt_seg_ret.Text)) <> 0 Then
    Me.Btn_ace_ret.Enabled = True
    Me.Btn_ace_ret.SetFocus
End If
End Sub

Private Sub txtPlan_Est_KeyPress(Index As Integer, KeyAscii As Integer)
    bModific = True
End Sub

Private Sub genera_log(accion As Variant, Cod_Sec As Variant, cod_asi As Variant)
    Sql = "CREATE TABLE IF NOT EXISTS `sectores_subsectores_log`(`id` bigint(20) NOT NULL auto_increment,`LOGIN_USUARIO` varchar(100) NOT NULL default '',`NOMBRE_USUARIO` varchar(100) NOT NULL default '',`cod_sec` varchar(10) NOT NULL default '',`cod_asi` varchar(10)  NOT NULL default '0',`agno` int(11) 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 `sectores_subsectores_log_sec_key` (`FECHA_MODIFICACION`,`LOGIN_USUARIO`),KEY `sectores_subsectores_log_index_one` (`cod_sec`,`AGNO`,`cod_asi`)) ENGINE=MyISAM;"
    conn.Execute Sql
    Sql = "REPLACE sectores_subsectores_log SET LOGIN_USUARIO='" & Nom_usu_ses & "',NOMBRE_USUARIO='" & Nom_com_usu_ses & "',AGNO='" & Year(Date) & "',FECHA_MODIFICACION=concat(current_date,' ',current_time),ACCION='" & accion & "',cod_sec=" & Cod_Sec & ",cod_asi=" & cod_asi
    conn.Execute Sql
End Sub

Private Sub Refresca_Tabla()
    Dim i As Integer
    strEns = Left(Me.cmb_des_ens_subsec.Text, 3)
    strGra = Me.cmb_num_gra_subsec.Text
    Set rsServ = conn.Execute("SELECT s.cod_sec, s.nom_sec, su.cod_asi, su.nom_asi, su.pn, su.ord_asi FROM sectores s, subsectores su WHERE s.cod_sec=su.cod_sec AND su.cod_ens='" & strEns & "' AND su.num_gra='" & strGra & "' ORDER BY su.ord_asi")
    i = 1
    While Not rsServ.EOF
        Me.grSectores.TextMatrix(i, 0) = rsServ("ord_asi")
        Me.grSectores.TextMatrix(i, 1) = rsServ("cod_sec")
        Me.grSectores.TextMatrix(i, 2) = rsServ("nom_sec")
        Me.grSectores.TextMatrix(i, 3) = rsServ("cod_asi")
        Me.grSectores.TextMatrix(i, 4) = rsServ("nom_asi")
        Me.grSectores.TextMatrix(i, 5) = IIf(rsServ("pn") = "1", "Si", "No")
        rsServ.MoveNext
        i = i + 1
    Wend
    rsServ.Close
End Sub

