VERSION 5.00
Object = "{86CF1D34-0C5F-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCT2.OCX"
Object = "{F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.2#0"; "COMDLG32.OCX"
Begin VB.Form Form_man_tab2 
   BorderStyle     =   1  'Fixed Single
   Caption         =   "Mantención de Tablas"
   ClientHeight    =   9045
   ClientLeft      =   150
   ClientTop       =   435
   ClientWidth     =   9840
   Icon            =   "For_man_tab2.frx":0000
   LinkTopic       =   "Form3"
   MaxButton       =   0   'False
   MDIChild        =   -1  'True
   MinButton       =   0   'False
   Moveable        =   0   'False
   ScaleHeight     =   9045
   ScaleWidth      =   9840
   Begin VB.Frame Frame_Vac 
      ForeColor       =   &H00FF0000&
      Height          =   4215
      Left            =   120
      TabIndex        =   35
      Top             =   4680
      Visible         =   0   'False
      Width           =   9555
      Begin VB.ComboBox cmb_agno 
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   330
         Left            =   3960
         Style           =   2  'Dropdown List
         TabIndex        =   96
         Top             =   360
         Width           =   1455
      End
      Begin VB.TextBox txt_ocu_vac_prox 
         BeginProperty DataFormat 
            Type            =   0
            Format          =   "#.##0"
            HaveTrueFalseNull=   0
            FirstDayOfWeek  =   0
            FirstWeekOfYear =   0
            LCID            =   3082
            SubFormatType   =   0
         EndProperty
         Enabled         =   0   'False
         Height          =   285
         Left            =   7920
         MaxLength       =   3
         TabIndex        =   59
         Top             =   3120
         Width           =   735
      End
      Begin VB.TextBox txt_ocu_vac 
         BeginProperty DataFormat 
            Type            =   0
            Format          =   "#.##0"
            HaveTrueFalseNull=   0
            FirstDayOfWeek  =   0
            FirstWeekOfYear =   0
            LCID            =   3082
            SubFormatType   =   0
         EndProperty
         Enabled         =   0   'False
         Height          =   285
         Left            =   4440
         MaxLength       =   3
         TabIndex        =   57
         Top             =   3120
         Width           =   735
      End
      Begin VB.TextBox txt_dis_vac_prox 
         BeginProperty DataFormat 
            Type            =   0
            Format          =   "#.##0"
            HaveTrueFalseNull=   0
            FirstDayOfWeek  =   0
            FirstWeekOfYear =   0
            LCID            =   3082
            SubFormatType   =   0
         EndProperty
         Enabled         =   0   'False
         Height          =   285
         Left            =   7920
         MaxLength       =   3
         TabIndex        =   53
         Top             =   3480
         Width           =   735
      End
      Begin VB.TextBox txt_total_vac_prox 
         BeginProperty DataFormat 
            Type            =   0
            Format          =   "#.##0"
            HaveTrueFalseNull=   0
            FirstDayOfWeek  =   0
            FirstWeekOfYear =   0
            LCID            =   3082
            SubFormatType   =   0
         EndProperty
         Height          =   285
         Left            =   7920
         MaxLength       =   3
         TabIndex        =   52
         Top             =   2760
         Width           =   735
      End
      Begin VB.TextBox txt_dis_vac 
         BeginProperty DataFormat 
            Type            =   0
            Format          =   "#.##0"
            HaveTrueFalseNull=   0
            FirstDayOfWeek  =   0
            FirstWeekOfYear =   0
            LCID            =   3082
            SubFormatType   =   0
         EndProperty
         Enabled         =   0   'False
         Height          =   285
         Left            =   4440
         MaxLength       =   3
         TabIndex        =   49
         Top             =   3480
         Width           =   735
      End
      Begin VB.TextBox txt_total_vac 
         BeginProperty DataFormat 
            Type            =   0
            Format          =   "#.##0"
            HaveTrueFalseNull=   0
            FirstDayOfWeek  =   0
            FirstWeekOfYear =   0
            LCID            =   3082
            SubFormatType   =   0
         EndProperty
         Height          =   285
         Left            =   4440
         MaxLength       =   3
         TabIndex        =   48
         Top             =   2760
         Width           =   735
      End
      Begin VB.CommandButton Btn_vac_eliminar 
         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            =   8040
         TabIndex        =   41
         Top             =   840
         Width           =   1215
      End
      Begin VB.CommandButton Btn_vac_cancelar 
         Caption         =   "Cancelar"
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   375
         Left            =   8040
         TabIndex        =   40
         Top             =   1320
         Width           =   1215
      End
      Begin VB.CommandButton Btn_vac_aceptar 
         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            =   8040
         TabIndex        =   39
         Top             =   360
         Width           =   1215
      End
      Begin VB.ComboBox Cmb_mod_vac 
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   330
         Left            =   3960
         TabIndex        =   38
         Top             =   780
         Width           =   3375
      End
      Begin VB.ComboBox Cmb_jor_vac 
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   330
         ItemData        =   "For_man_tab2.frx":2A8B2
         Left            =   3960
         List            =   "For_man_tab2.frx":2A8B4
         TabIndex        =   37
         Top             =   1500
         Width           =   3375
      End
      Begin VB.ComboBox Cmb_num_gra_vac 
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   330
         Left            =   3960
         TabIndex        =   36
         Top             =   1140
         Width           =   735
      End
      Begin VB.Label Label25 
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   255
         Left            =   300
         TabIndex        =   46
         Top             =   3840
         Width           =   5055
      End
      Begin VB.Label lbl_ano 
         Caption         =   "Año"
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   255
         Left            =   2700
         TabIndex        =   97
         Top             =   360
         Width           =   975
      End
      Begin VB.Image Image10 
         Height          =   2130
         Left            =   120
         Picture         =   "For_man_tab2.frx":2A8B6
         Top             =   240
         Width           =   1815
      End
      Begin VB.Label Label16 
         Caption         =   "Vacantes Ocupadas"
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   255
         Left            =   6240
         TabIndex        =   60
         Top             =   3120
         Width           =   1575
      End
      Begin VB.Label Label10 
         Caption         =   "Vacantes Ocupadas"
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   255
         Left            =   2700
         TabIndex        =   58
         Top             =   3120
         Width           =   1575
      End
      Begin VB.Label Label19 
         Alignment       =   2  'Center
         Caption         =   "Próximo Año"
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   255
         Left            =   5940
         TabIndex        =   56
         Top             =   2280
         Width           =   3255
      End
      Begin VB.Label Label18 
         Alignment       =   2  'Center
         Caption         =   "Año Actual"
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   255
         Left            =   2640
         TabIndex        =   55
         Top             =   2280
         Width           =   2835
      End
      Begin VB.Line Line2 
         BorderColor     =   &H8000000C&
         X1              =   5640
         X2              =   5640
         Y1              =   2520
         Y2              =   4200
      End
      Begin VB.Label Label17 
         Caption         =   "Totales Establecidos"
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H00C00000&
         Height          =   225
         Left            =   4920
         TabIndex        =   54
         Top             =   2040
         Width           =   1785
      End
      Begin VB.Line Line5 
         BorderColor     =   &H8000000C&
         X1              =   2220
         X2              =   9525
         Y1              =   2040
         Y2              =   2040
      End
      Begin VB.Label Label14 
         Caption         =   "Total Vacantes"
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   255
         Left            =   6240
         TabIndex        =   51
         Top             =   2760
         Width           =   1455
      End
      Begin VB.Label Label13 
         Caption         =   "Vacantes Disponibles"
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   255
         Left            =   6240
         TabIndex        =   50
         Top             =   3480
         Width           =   1575
      End
      Begin VB.Label Label15 
         Caption         =   "Total Vacantes"
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   255
         Left            =   2700
         TabIndex        =   47
         Top             =   2760
         Width           =   1455
      End
      Begin VB.Label Label26 
         Caption         =   "Modalidad"
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   255
         Left            =   2700
         TabIndex        =   45
         Top             =   780
         Width           =   1035
      End
      Begin VB.Label Label30 
         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
         Left            =   2700
         TabIndex        =   44
         Top             =   1140
         Width           =   1215
      End
      Begin VB.Label Label31 
         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            =   2700
         TabIndex        =   43
         Top             =   1500
         Width           =   1215
      End
      Begin VB.Label Label32 
         Caption         =   "Vacantes Disponibles"
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   255
         Left            =   2700
         TabIndex        =   42
         Top             =   3480
         Width           =   1575
      End
   End
   Begin VB.Frame frame_cap_maxima 
      Height          =   2535
      Left            =   120
      TabIndex        =   84
      Top             =   6360
      Width           =   6495
      Begin VB.TextBox Text1 
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   285
         Left            =   3240
         TabIndex        =   93
         Top             =   840
         Width           =   1215
      End
      Begin VB.CommandButton Command3 
         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            =   5040
         TabIndex        =   92
         Top             =   360
         Width           =   1215
      End
      Begin VB.CommandButton Command2 
         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            =   5040
         TabIndex        =   91
         Top             =   1320
         Width           =   1215
      End
      Begin VB.CommandButton Command1 
         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            =   5040
         TabIndex        =   90
         Top             =   840
         Width           =   1215
      End
      Begin VB.ListBox List1 
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   780
         Left            =   1080
         Style           =   1  'Checkbox
         TabIndex        =   89
         Top             =   1320
         Width           =   3375
      End
      Begin VB.ComboBox Combo2 
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   330
         ItemData        =   "For_man_tab2.frx":32999
         Left            =   1080
         List            =   "For_man_tab2.frx":3299B
         TabIndex        =   88
         Top             =   840
         Width           =   855
      End
      Begin VB.ComboBox Combo1 
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   330
         ItemData        =   "For_man_tab2.frx":3299D
         Left            =   1080
         List            =   "For_man_tab2.frx":3299F
         TabIndex        =   86
         Top             =   360
         Width           =   3375
      End
      Begin VB.Label Label36 
         Caption         =   "Capacidad"
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   255
         Left            =   2400
         TabIndex        =   94
         Top             =   840
         Width           =   855
      End
      Begin VB.Label Label34 
         Caption         =   "Sexo"
         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        =   87
         Top             =   840
         Width           =   615
      End
      Begin VB.Label Label35 
         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        =   85
         Top             =   360
         Width           =   855
      End
   End
   Begin VB.Frame Frame_Jornadas 
      ForeColor       =   &H00FF0000&
      Height          =   2655
      Left            =   120
      TabIndex        =   77
      Top             =   3600
      Visible         =   0   'False
      Width           =   8175
      Begin VB.CommandButton btn_Normaliza_Alu_x_cur 
         Caption         =   "Campo Ingreso al curso"
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   495
         Left            =   6720
         TabIndex        =   83
         Top             =   2040
         Width           =   1335
      End
      Begin VB.CommandButton btn_asi_jor 
         Caption         =   "Jornadas"
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   495
         Left            =   5280
         TabIndex        =   82
         Top             =   2040
         Width           =   1335
      End
      Begin VB.ListBox lst_des_jor 
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   690
         Left            =   3600
         TabIndex        =   2
         Top             =   600
         Visible         =   0   'False
         Width           =   2415
      End
      Begin VB.CommandButton Btn_eli_jor 
         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            =   6720
         TabIndex        =   6
         Top             =   840
         Width           =   1215
      End
      Begin VB.CommandButton Btn_can_jor 
         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            =   6720
         TabIndex        =   7
         Top             =   1320
         Width           =   1215
      End
      Begin VB.CommandButton Btn_ace_jor 
         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            =   6720
         TabIndex        =   5
         Top             =   360
         Width           =   1215
      End
      Begin VB.TextBox txt_des_jor 
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   285
         Left            =   3600
         MaxLength       =   21
         TabIndex        =   1
         Top             =   360
         Width           =   2415
      End
      Begin VB.TextBox Txt_cod_jor 
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   285
         Left            =   3600
         MaxLength       =   1
         TabIndex        =   3
         Top             =   720
         Width           =   495
      End
      Begin VB.TextBox Txt_codint_jor 
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   285
         Left            =   3600
         MaxLength       =   2
         TabIndex        =   4
         Top             =   1080
         Width           =   495
      End
      Begin VB.Image Image4 
         Height          =   2130
         Left            =   120
         Picture         =   "For_man_tab2.frx":329A1
         Top             =   240
         Width           =   1815
      End
      Begin VB.Label Label33 
         Caption         =   "Descripció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            =   2220
         TabIndex        =   81
         Top             =   360
         Width           =   1215
      End
      Begin VB.Label Label29 
         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            =   2220
         TabIndex        =   80
         Top             =   720
         Width           =   1215
      End
      Begin VB.Label Label28 
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   255
         Left            =   2280
         TabIndex        =   79
         Top             =   1680
         Width           =   5475
      End
      Begin VB.Label Label27 
         Caption         =   "Código Interno"
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   255
         Left            =   2220
         TabIndex        =   78
         Top             =   1080
         Width           =   1455
      End
   End
   Begin VB.Frame Frame_grados 
      ForeColor       =   &H00FF0000&
      Height          =   2595
      Left            =   120
      TabIndex        =   61
      Top             =   1440
      Visible         =   0   'False
      Width           =   8175
      Begin VB.ComboBox cmb_num_gra 
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   330
         Left            =   3840
         TabIndex        =   71
         Top             =   840
         Width           =   855
      End
      Begin VB.ComboBox cmb_mod_gra 
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   330
         Left            =   3840
         TabIndex        =   70
         Top             =   480
         Width           =   2415
      End
      Begin VB.CommandButton Btn_eli_gra 
         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            =   6720
         TabIndex        =   65
         Top             =   840
         Width           =   1215
      End
      Begin VB.CommandButton Btn_can_gra 
         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            =   6720
         TabIndex        =   64
         Top             =   1320
         Width           =   1215
      End
      Begin VB.CommandButton Btn_ace_gra 
         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            =   6720
         TabIndex        =   63
         Top             =   360
         Width           =   1215
      End
      Begin VB.TextBox Txt_des_Gra 
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   285
         Left            =   3840
         MaxLength       =   8
         TabIndex        =   62
         Top             =   1200
         Width           =   2415
      End
      Begin VB.Label Label20 
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   255
         Left            =   2280
         TabIndex        =   67
         Top             =   2160
         Width           =   4575
      End
      Begin VB.Image Image3 
         Height          =   2130
         Left            =   120
         Picture         =   "For_man_tab2.frx":39F0B
         Top             =   300
         Width           =   1815
      End
      Begin VB.Label Label23 
         Caption         =   "Modalidad"
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   255
         Left            =   2280
         TabIndex        =   69
         Top             =   480
         Width           =   1215
      End
      Begin VB.Label Label22 
         Caption         =   "Número de Grado"
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   255
         Left            =   2280
         TabIndex        =   68
         Top             =   840
         Width           =   1575
      End
      Begin VB.Label Label21 
         Caption         =   "Descripción Grado"
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   255
         Left            =   2280
         TabIndex        =   66
         Top             =   1200
         Width           =   1455
      End
   End
   Begin VB.Frame Frame_Evaluaciones 
      BeginProperty Font 
         Name            =   "Arial"
         Size            =   8.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H00FF0000&
      Height          =   3015
      Left            =   120
      TabIndex        =   26
      Top             =   120
      Visible         =   0   'False
      Width           =   8175
      Begin VB.ListBox lst_des_eva 
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   690
         Left            =   4080
         TabIndex        =   10
         Top             =   600
         Visible         =   0   'False
         Width           =   2055
      End
      Begin VB.TextBox txt_color_eva 
         Alignment       =   2  'Center
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   285
         Left            =   5520
         Locked          =   -1  'True
         TabIndex        =   76
         Text            =   "COLOR"
         Top             =   2040
         Width           =   1215
      End
      Begin VB.CommandButton btn_colorfondo_eva 
         Caption         =   "Seleccionar"
         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        =   75
         Top             =   2280
         Width           =   1215
      End
      Begin MSComDlg.CommonDialog Cmdialog 
         Left            =   7440
         Top             =   1920
         _ExtentX        =   847
         _ExtentY        =   847
         _Version        =   393216
      End
      Begin VB.CommandButton btn_colortexto_eva 
         Caption         =   "Seleccionar"
         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        =   73
         Top             =   1800
         Width           =   1215
      End
      Begin VB.TextBox Txt_cod_eva 
         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            =   4080
         MaxLength       =   1
         TabIndex        =   8
         Top             =   360
         Width           =   2055
      End
      Begin VB.TextBox Txt_des_eva 
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   285
         Left            =   4080
         MaxLength       =   15
         TabIndex        =   9
         Top             =   720
         Width           =   2055
      End
      Begin VB.TextBox txt_nota_eva 
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   285
         Left            =   4080
         MaxLength       =   2
         TabIndex        =   12
         Top             =   1440
         Width           =   375
      End
      Begin VB.CommandButton btn_eva_aceptar 
         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            =   6660
         TabIndex        =   29
         Top             =   360
         Width           =   1215
      End
      Begin VB.CommandButton btn_eva_cancelar 
         Caption         =   "Cancelar"
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   375
         Left            =   6660
         TabIndex        =   28
         Top             =   1320
         Width           =   1215
      End
      Begin VB.CommandButton btn_eva_eliminar 
         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            =   6660
         TabIndex        =   27
         Top             =   840
         Width           =   1215
      End
      Begin VB.TextBox txt_por_eva 
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   285
         Left            =   4080
         MaxLength       =   3
         TabIndex        =   11
         Top             =   1080
         Width           =   375
      End
      Begin VB.Label Label24 
         Caption         =   "Color Fondo"
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   255
         Left            =   2280
         TabIndex        =   74
         Top             =   2400
         Width           =   1215
      End
      Begin VB.Label Label9 
         Caption         =   "Color Texto"
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   255
         Left            =   2280
         TabIndex        =   72
         Top             =   1920
         Width           =   1215
      End
      Begin VB.Image Image2 
         Height          =   2130
         Left            =   120
         Picture         =   "For_man_tab2.frx":41EB9
         Top             =   240
         Width           =   1815
      End
      Begin VB.Label Label3 
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   255
         Left            =   2280
         TabIndex        =   30
         Top             =   2640
         Width           =   4155
      End
      Begin VB.Label Label6 
         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            =   2280
         TabIndex        =   34
         Top             =   360
         Width           =   1215
      End
      Begin VB.Label Label5 
         Caption         =   "Descripció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            =   2280
         TabIndex        =   33
         Top             =   720
         Width           =   1215
      End
      Begin VB.Label Label8 
         Caption         =   "Porcentaje 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            =   2280
         TabIndex        =   32
         Top             =   1080
         Width           =   1695
      End
      Begin VB.Label Label7 
         Caption         =   "Notas 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            =   2280
         TabIndex        =   31
         Top             =   1440
         Width           =   1455
      End
   End
   Begin VB.Frame Frame_periodo 
      ForeColor       =   &H00FF0000&
      Height          =   2955
      Left            =   120
      TabIndex        =   0
      Top             =   2520
      Visible         =   0   'False
      Width           =   8175
      Begin VB.ListBox Lst_des_periodo 
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   690
         Left            =   3480
         TabIndex        =   13
         Top             =   960
         Visible         =   0   'False
         Width           =   2535
      End
      Begin VB.CheckBox chk_cierre_per 
         Alignment       =   1  'Right Justify
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   375
         Left            =   3480
         Style           =   1  'Graphical
         TabIndex        =   95
         Top             =   2040
         Width           =   1530
      End
      Begin VB.TextBox Txt_des_periodo 
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   285
         Left            =   3480
         MaxLength       =   17
         TabIndex        =   18
         Top             =   720
         Width           =   2535
      End
      Begin VB.TextBox Txt_cod_periodo 
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   285
         Left            =   3480
         MaxLength       =   1
         TabIndex        =   17
         Top             =   360
         Width           =   375
      End
      Begin VB.CommandButton Btn_Per_Eliminar 
         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            =   6660
         TabIndex        =   16
         Top             =   900
         Width           =   1215
      End
      Begin VB.CommandButton Btn_Per_Cancelar 
         Caption         =   "Cancelar"
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   375
         Left            =   6660
         TabIndex        =   15
         Top             =   1380
         Width           =   1215
      End
      Begin VB.CommandButton Btn_Per_Aceptar 
         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            =   6660
         TabIndex        =   14
         Top             =   420
         Width           =   1215
      End
      Begin MSComCtl2.DTPicker dtp_fec_ini_per 
         BeginProperty DataFormat 
            Type            =   1
            Format          =   "MM/dd/yyyy"
            HaveTrueFalseNull=   0
            FirstDayOfWeek  =   0
            FirstWeekOfYear =   0
            LCID            =   2058
            SubFormatType   =   3
         EndProperty
         Height          =   375
         Left            =   3480
         TabIndex        =   19
         TabStop         =   0   'False
         Top             =   1080
         Width           =   1575
         _ExtentX        =   2778
         _ExtentY        =   661
         _Version        =   393216
         MousePointer    =   4
         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
         CustomFormat    =   "dd/mm/yyyy"
         Format          =   25559041
         CurrentDate     =   37622
         MaxDate         =   73415
         MinDate         =   27760
      End
      Begin MSComCtl2.DTPicker dtp_fec_ter_per 
         BeginProperty DataFormat 
            Type            =   1
            Format          =   "MM/dd/yyyy"
            HaveTrueFalseNull=   0
            FirstDayOfWeek  =   0
            FirstWeekOfYear =   0
            LCID            =   2058
            SubFormatType   =   3
         EndProperty
         Height          =   375
         Left            =   3480
         TabIndex        =   20
         TabStop         =   0   'False
         Top             =   1560
         Width           =   1575
         _ExtentX        =   2778
         _ExtentY        =   661
         _Version        =   393216
         MousePointer    =   4
         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
         CustomFormat    =   "dd/mm/yyyy"
         Format          =   25559041
         CurrentDate     =   37622
         MaxDate         =   73415
         MinDate         =   27760
      End
      Begin VB.Image Image1 
         Height          =   2130
         Left            =   120
         Picture         =   "For_man_tab2.frx":4A00F
         Top             =   240
         Width           =   1815
      End
      Begin VB.Label Label12 
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   255
         Left            =   2160
         TabIndex        =   25
         Top             =   2520
         Width           =   5715
      End
      Begin VB.Label Label11 
         Caption         =   "Descripció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            =   2160
         TabIndex        =   24
         Top             =   780
         Width           =   1215
      End
      Begin VB.Label Label4 
         Caption         =   "Número"
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   255
         Left            =   2160
         TabIndex        =   23
         Top             =   360
         Width           =   1215
      End
      Begin VB.Label Label1 
         Caption         =   "Fecha Término"
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   255
         Left            =   2160
         TabIndex        =   22
         Top             =   1680
         Width           =   1215
      End
      Begin VB.Label Label2 
         Caption         =   "Fecha Inicio"
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   255
         Left            =   2160
         TabIndex        =   21
         Top             =   1200
         Width           =   1215
      End
   End
End
Attribute VB_Name = "Form_man_tab2"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False

Private Sub Btn_ace_gra_Click()
'asignar valores para insertar o actualizar campos
If Len(Me.cmb_mod_gra.Text) <> 0 And Len(Me.cmb_num_gra.Text) <> 0 And Len(Trim(Me.Txt_des_Gra.Text)) <> 0 Then
CodModalidad = devuelvecampo("codigos_ensenanza", "", "cod_ens", "des_ens = '" & Me.cmb_mod_gra.Text & "'", conn)
If Busqueda = 1 Then
        If MsgBox("El registro no existe. ¿Desea crearlo?", vbYesNo + vbQuestion) = vbYes Then
            'Insertando Registro en tabla
            conn.Execute "INSERT INTO grados(cod_ens, num_gra, des_gra) values('" & CodModalidad & "' , '" & Me.cmb_num_gra.Text & "' , '" & Me.Txt_des_Gra.Text & "')"
            MsgBox ("Registro Agregado")
            Me.Label20.Caption = ""
            Me.cmb_mod_gra.Enabled = True
            Me.cmb_mod_gra.Text = ""
            Me.cmb_num_gra.Text = ""
            Me.Txt_des_Gra.Text = ""
            Me.cmb_num_gra.Enabled = False
            Me.Txt_des_Gra.Enabled = False
            Me.Btn_eli_gra.Enabled = False
            Me.cmb_mod_gra.SetFocus
        Else
            Me.cmb_mod_gra.SetFocus
            SendKeys "{home}+{end}"
        End If
Else
    a = "UPDATE grados Set des_gra = '" & Me.Txt_des_Gra.Text & "' where cod_ens = '" & CodModalidad & "' and num_gra ='" & Me.cmb_num_gra.Text & "'"
    conn.Execute a
    Busqueda = 1
    MsgBox ("Registro Modificado")
    Me.Label20.Caption = ""
    Me.cmb_mod_gra.Enabled = True
    Me.cmb_mod_gra.Text = ""
    Me.cmb_num_gra.Text = ""
    Me.Txt_des_Gra.Text = ""
    Me.cmb_num_gra.Enabled = False
    Me.Txt_des_Gra.Enabled = False
    Me.Btn_eli_gra.Enabled = False
    Me.cmb_mod_gra.SetFocus
End If
Else
    MsgBox ("No deben haber campos vacíos")
End If
'Me.Txt_mod_gra.Enabled = True
'Me.Txt_mod_gra.SetFocus


End Sub



Private Sub Btn_ace_jor_Click()
Dim Codigo, cod, codigofinal, a, descripcion As String
Codigo = Trim(Txt_cod_jor.Text)
descripcion = Trim(txt_des_jor.Text)
codigointerno = Trim(Me.Txt_codint_jor.Text)
If Len(Trim(Me.Txt_cod_jor.Text)) <> 0 And Len(Trim(Me.txt_des_jor.Text)) <> 0 And Len(Trim(Me.Txt_codint_jor.Text)) <> 0 Then
If Busqueda = 1 And Len(Trim(txt_des_jor.Text)) <> 0 Then
    rs.CursorLocation = adUseClient
    rs.Open "SELECT * FROM jornadas where des_jor=" & "'" & descripcion & "'"
    If rs.RecordCount > 0 Then
        rs.MoveLast
        rs.MoveFirst
        Txt_cod_jor.Text = rs("cod_jor")
        txt_des_jor.Text = rs("des_jor")
        Codigo = rs("cod_jor")
        Me.Label16.Caption = "Editando Jornada Existente"
        Me.Btn_eli_jor.Enabled = True
        Me.lst_des_jor.Visible = False
        Busqueda = 0
        Indi = 0
        Me.txt_des_jor.SetFocus
        SendKeys "{end}"
        rs.Close
    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_jor.Enabled = True
            Me.Txt_cod_jor.SetFocus
            conn.Execute "INSERT INTO jornadas(cod_jor, des_jor, cod_jor_interno) values(" & "'" & Codigo & "'" & "," & "'" & descripcion & "'" & "," & "'" & codigointerno & "'" & ")"
            MsgBox ("Registro Agregado")
            Me.Txt_cod_jor = ""
            Me.txt_des_jor = ""
            Me.Txt_codint_jor.Text = ""
            Me.Txt_codint_jor.Enabled = False
            Me.txt_des_jor.SetFocus
            Me.Label28.Caption = ""
            ingxcodigo = 1
        Else
            Me.txt_des_jor.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_des_jor.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 jornadas(cod_jor, des_jor, cod_jor_interno) values(" & "'" & Codigo & "'" & "," & "'" & descripcion & "'" & "," & "'" & codigointerno & "'" & ")"
                    MsgBox ("Registro Agregado")
                    ingxcodigo = 0
                Else
                    conn.Execute "UPDATE jornadas Set des_jor = " & "'" & descripcion & "'" & ", cod_jor_interno = " & "'" & codigointerno & "'" & " where cod_jor=" & "'" & Codigo & "'"
                    MsgBox ("Registro Modificado")
                    
                End If
                Me.Txt_cod_jor.Enabled = True
                Me.Label28.Caption = ""
                Me.Txt_cod_jor.Text = ""
                Me.txt_des_jor.Text = ""
                Me.Txt_codint_jor.Text = ""
                Me.Txt_codint_jor.Enabled = False
                Me.txt_des_jor.SetFocus
                Busqueda = 1
            'End If
End If
Else
    MsgBox ("No deben haber campos vacíos")
End If
Me.txt_des_jor.SetFocus

End Sub

Private Sub btn_asi_jor_Click()
'TABLA CURSOS este proceso se debe modificar según el colegio.
On Error GoTo controlerr
' BOSTON FARFANA
'Pre Kinder Mañana
'conn.Execute "UPDATE cursos Set cod_jor = '2' WHERE  (let_cur='A' or let_cur='B')and num_gra = '1' and cod_ens = '996'"
'Pre Kinder Tarde
'conn.Execute "UPDATE cursos Set cod_jor = '3' WHERE  (let_cur ='C' or let_cur ='D') and num_gra = '1'  and cod_ens = '996'"

'Kinder Mañana
'conn.Execute "UPDATE cursos Set cod_jor = '2' WHERE  (let_cur ='A' or let_cur ='B' or let_cur ='C' or let_cur ='D') and num_gra = '1'and cod_ens = '010'"
'Kinder Tarde
'conn.Execute "UPDATE cursos Set cod_jor = '3' WHERE  (let_cur ='E' or let_cur ='F' or let_cur ='G' or let_cur ='H' or let_cur ='I') and num_gra = '1' and cod_ens = '010'"

'Basica Mañana
'conn.Execute "UPDATE cursos Set cod_jor = '2' WHERE  (num_gra = '1' or num_gra = '2' or num_gra = '3' or num_gra = '4' or num_gra = '5' or num_gra = '6' or num_gra = '7' or num_gra = '8') and let_cur ='A' and cod_ens = '110'"
'conn.Execute "UPDATE cursos Set cod_jor = '2' WHERE  (num_gra = '1' or num_gra = '2' or num_gra = '3' or num_gra = '4' or num_gra = '5' or num_gra = '6' or num_gra = '7' or num_gra = '8') and let_cur ='B' and cod_ens = '110'"
'conn.Execute "UPDATE cursos Set cod_jor = '2' WHERE  (num_gra = '1' or num_gra = '2' or num_gra = '3' or num_gra = '4' or num_gra = '5' or num_gra = '6' or num_gra = '7' or num_gra = '8') and let_cur ='C' and cod_ens = '110'"
'conn.Execute "UPDATE cursos Set cod_jor = '2' WHERE  (num_gra = '1' or num_gra = '2' or num_gra = '5' or num_gra = '6' or num_gra = '8') and let_cur = 'D' and cod_ens = '110'"

'Basica Tarde
'conn.Execute "UPDATE cursos Set cod_jor = '3' WHERE  (num_gra = '3' or num_gra = '4' or num_gra = '7') and let_cur ='D' and cod_ens = '110'"
'conn.Execute "UPDATE cursos Set cod_jor = '3' WHERE  (num_gra = '1' or num_gra = '2' or num_gra = '3' or num_gra = '4' or num_gra = '5' or num_gra = '6' or num_gra = '7' or num_gra = '8') and let_cur ='E' and cod_ens = '110'"
'conn.Execute "UPDATE cursos Set cod_jor = '3' WHERE  (num_gra = '1' or num_gra = '2' or num_gra = '3' or num_gra = '4' or num_gra = '5' or num_gra = '6') and let_cur ='F' and cod_ens = '110'"
'conn.Execute "UPDATE cursos Set cod_jor = '3' WHERE  (num_gra = '1' or num_gra = '2' or num_gra = '5') and let_cur ='G' and cod_ens = '110'"
'conn.Execute "UPDATE cursos Set cod_jor = '3' WHERE  num_gra = '1'  and let_cur ='H' and cod_ens = '110'"

'Media Mañana
'conn.Execute "UPDATE cursos Set cod_jor = '2' WHERE  (let_cur ='A' or let_cur ='B' or let_cur ='C') and num_gra = '1'  and cod_ens = '310'"







' BOSTON FLORIDA
'Pre Kinder Tarde
'conn.Execute "UPDATE cursos Set cod_jor = '3' WHERE  (let_cur ='A' or let_cur ='B') and num_gra = '1'  and cod_ens = '996'"

'Kinder Mañana
'conn.Execute "UPDATE cursos Set cod_jor = '2' WHERE  (let_cur ='A') and num_gra = '1'and cod_ens = '010'"
'Kinder Tarde
'conn.Execute "UPDATE cursos Set cod_jor = '3' WHERE  (let_cur ='B') and num_gra = '1' and cod_ens = '010'"

'Basica Mañana
'conn.Execute "UPDATE cursos Set cod_jor = '2' WHERE  (num_gra = '1' or num_gra = '2' or num_gra = '3' or num_gra = '4' or num_gra = '5' or num_gra = '6' or num_gra = '7' or num_gra = '8') and let_cur ='A' and cod_ens = '110'"
'
'Basica Tarde
'conn.Execute "UPDATE cursos Set cod_jor = '3' WHERE  (num_gra = '1' or num_gra = '2' or num_gra = '3' or num_gra = '4' or num_gra = '5' or num_gra = '6' or num_gra = '7' or num_gra = '8') and let_cur ='B' and cod_ens = '110'" '
'conn.Execute "UPDATE cursos Set cod_jor = '3' WHERE  (num_gra = '1') and let_cur ='C' and cod_ens = '110'"


'Media Mañana
'conn.Execute "UPDATE cursos Set cod_jor = '2' WHERE  (num_gra = '1' or num_gra = '2' or num_gra = '3') and let_cur ='A' and cod_ens = '310'"


'MsgBox ("Jornadas asignadas a cursos OK")

'TABLA MATRICULAS
'Jornada Mañana
'conn.BeginTrans
rs.CursorLocation = adUseClient
a = " SELECT  a.ci_alu, a.cod_ens  FROM alu_x_cur a, cursos c where a.activo_alu='SI' and a.cod_ens = c.cod_ens and a.num_gra = c.num_gra and a.let_cur = c.let_cur and c.cod_jor = '2'"
rs.Open a, conn
If rs.RecordCount > 0 Then
    While Not rs.EOF
        'conn.Execute "UPDATE matriculas Set cod_ens =  WHERE  ci_alu ='" & rs("ci_alu") & "' and activo_alu ='SI'"
        conn.Execute "UPDATE matriculas Set cod_jor = '2', cod_ens = '" & rs("cod_ens") & "' WHERE  ci_alu ='" & rs("ci_alu") & "' and activo_alu ='SI'"
        conn.Execute "UPDATE postulaciones Set cod_jor = '2' WHERE  ci_alu ='" & rs("ci_alu") & "'"
        conn.Execute "UPDATE postulantes Set cod_jor = '2' WHERE  ci_alu ='" & rs("ci_alu") & "'"
        rs.MoveNext
    Wend
Else
End If
rs.Close
MsgBox ("Alumnos de Jornada Mañana ok")

'Jornada Tarde
a = " SELECT a.ci_alu, a.cod_ens FROM alu_x_cur a, cursos c where a.activo_alu='SI' and a.cod_ens = c.cod_ens and a.num_gra = c.num_gra and a.let_cur = c.let_cur and c.cod_jor = '3'"
rs.CursorLocation = adUseClient
rs.Open a, conn
If rs.RecordCount > 0 Then
    While Not rs.EOF
        conn.Execute "UPDATE matriculas Set cod_jor = '3', cod_ens = '" & rs("cod_ens") & "' WHERE  ci_alu ='" & rs("ci_alu") & "' and activo_alu ='SI'"
        conn.Execute "UPDATE postulaciones Set cod_jor = '3' WHERE  ci_alu ='" & rs("ci_alu") & "'"
        conn.Execute "UPDATE postulantes Set cod_jor = '3' WHERE  ci_alu ='" & rs("ci_alu") & "'"
        rs.MoveNext
    Wend
Else
End If
rs.Close
MsgBox ("Alumnos de Jornada Tarde ok")

' Matriculado_alu = 1
a = " SELECT ci_alu  FROM matriculas where activo_alu='SI'"
rs.CursorLocation = adUseClient
rs.Open a, conn
If rs.RecordCount > 0 Then
    While Not rs.EOF
        conn.Execute "UPDATE postulantes Set matriculado_alu = 1 WHERE  ci_alu ='" & rs("ci_alu") & "'"
        rs.MoveNext
    Wend
Else
End If
rs.Close
MsgBox ("Indicador de matriculado en tabla postulantes OK")


' Cambiar Fec_cam 0000-00-00 por 1111-11-11 de la tabla alu_x_cur
conn.Execute "UPDATE alu_x_cur Set fec_cam = '1111-11-11' WHERE  fec_cam ='0000-00-00'"
MsgBox ("Fechas 0000-00-00 transformadas a 1111-11-11")

' Agregar a tabla repitentes los repitentes de la importación
'a = "select "

'conn.CommitTrans
Exit Sub
controlerr:
'conn.RollbackTrans
MsgBox ("Error : " & Err.Number & " " & Err.Description)
End Sub

Private Sub Btn_can_gra_Click()
Unload Me
End Sub

Private Sub Btn_can_jor_Click()
Unload Me
End Sub

Private Sub btn_colorfondo_eva_Click()
Me.Cmdialog.Action = 3
If Me.Cmdialog.color = Me.txt_color_eva.ForeColor Then
    MsgBox ("El color del texto y el color de fondo NO pueden ser iguales")
    Call btn_colorfondo_eva_Click
Else
    Me.txt_color_eva.BackColor = Me.Cmdialog.color
End If

End Sub


Private Sub btn_colortexto_eva_Click()
Me.Cmdialog.Action = 3
If Me.Cmdialog.color = Me.txt_color_eva.BackColor Then
    MsgBox ("El color del texto y el color de fondo NO pueden ser iguales")
    Call btn_colortexto_eva_Click
Else
    Me.txt_color_eva.ForeColor = Me.Cmdialog.color
    Me.btn_colorfondo_eva.Enabled = True
    Me.btn_colorfondo_eva.SetFocus
End If
End Sub


Private Sub Btn_eli_gra_Click()
CodModalidad = devuelvecampo("codigos_ensenanza", "des_ens", "cod_ens", "des_ens = " & "'" & Me.cmb_mod_gra.Text & "'", conn)
If ExistReg("cursos", "cod_ens= '" & CodModalidad & "' and num_gra = '" & Me.cmb_num_gra.Text & "'", conn) Or ExistReg("postulantes", "cod_ens= '" & CodModalidad & "' and num_gra = '" & Me.cmb_num_gra.Text & "'", conn) Or ExistReg("subsectores", "cod_ens= '" & CodModalidad & "' and num_gra = '" & Me.cmb_num_gra.Text & "'", conn) Or ExistReg("vac_x_nivel", "cod_ens= '" & CodModalidad & "' and num_gra = '" & Me.cmb_num_gra.Text & "'", 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 grados where cod_ens= " & "'" & CodModalidad & "'" & " and num_gra = " & "'" & Me.cmb_num_gra.Text & "'"
        Me.cmb_mod_gra.Enabled = True
        Me.cmb_mod_gra.Text = ""
        Me.cmb_num_gra.Text = ""
        Me.Txt_des_Gra.Text = ""
        Me.cmb_num_gra.Enabled = False
        Me.Txt_des_Gra.Enabled = False
        Me.Btn_eli_gra.Enabled = False
        Me.cmb_mod_gra.SetFocus
        Busqueda = 1
    End If
End If
Me.Label20.Caption = ""
End Sub

Private Sub Btn_eli_jor_Click()
If ExistReg("postulantes", "cod_jor ='" & Txt_cod_jor & "'", conn) Or ExistReg("vac_x_nivel", "cod_jor ='" & Txt_cod_jor & "' ", conn) Or ExistReg("cursos", "cod_jor ='" & Txt_cod_jor & "'", conn) Or ExistReg("postulaciones", "cod_jor ='" & Txt_cod_jor & "'", conn) Or ExistReg("matriculas", "cod_jor ='" & Txt_cod_jor & "'", conn) Or ExistReg("matriculas_prox", "cod_jor ='" & Txt_cod_jor & "'", 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 jornadas WHERE COD_jor ='" & Txt_cod_jor & "'"
        Txt_cod_jor = ""
        txt_des_jor = ""
        Me.Txt_codint_jor = ""
        Me.Txt_cod_jor.Enabled = True
        Me.Txt_codint_jor.Enabled = False
        Busqueda = 1
    End If
End If
Me.Label28.Caption = ""
Me.txt_des_jor.SetFocus
Me.Btn_eli_jor.Enabled = False

End Sub

Private Sub btn_eva_aceptar_Click()
Dim Codigo, cod, codigofinal, a, descripcion As String
Codigo = Txt_cod_eva.Text
descripcion = Txt_des_eva.Text
porcentaje = Me.txt_por_eva.Text
notas = Me.txt_nota_eva.Text
If Len(Trim(Me.Txt_des_eva.Text)) <> 0 And Len(Trim(Me.txt_por_eva.Text)) <> 0 And Len(Trim(Me.txt_nota_eva.Text)) <> 0 Then
    If Val(Me.txt_por_eva.Text) > 100 Then
        MsgBox ("Porcentaje de evaluación no puede ser mayor a 100")
        Me.txt_por_eva.SetFocus
        SendKeys "{home}+{end}"
    Else
    If Busqueda = 1 And Len(Trim(Txt_des_eva.Text)) <> 0 Then
        rs.CursorLocation = adUseClient
        rs.Open "SELECT * FROM evaluaciones where des_eva =" & "'" & descripcion & "'"
        If rs.RecordCount > 0 Then
            rs.MoveLast
            rs.MoveFirst
            Txt_cod_eva.Text = rs("cod_eva")
            Txt_des_eva.Text = rs("des_eva")
            Me.txt_por_eva.Text = rs("")
            Me.txt_por_eva.Text = rs("porcentaje_eva")
            Me.txt_nota_eva.Text = rs("notas_eva")
            Me.txt_color_eva.BackColor = Val(rs("color_texto_eva"))
            Me.txt_color_eva.ForeColor = Val(rs("color_fondo_eva"))
            Codigo = rs("cod_eva")
            Me.Label3.Caption = "Editando Evaluación Existente"
            Me.btn_eva_eliminar.Enabled = True
            Me.lst_des_eva.Visible = False
            Busqueda = 0
            Indi = 0
            Me.Txt_des_eva.SetFocus
            SendKeys "{end}"
            rs.Close
        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
                codigofinal = agregacodigo("evaluaciones", "cod_eva", conn)
                Me.Txt_cod_eva.Text = codigofinal
                conn.Execute "INSERT INTO evaluaciones (cod_eva, des_eva, porcentaje_eva, notas_eva, color_fondo_eva, color_texto_eva) values('" & codigofinal & "' , '" & descripcion & "' , '" & porcentaje & "' , '" & notas & "' , '" & Me.txt_color_eva.BackColor & "', '" & Me.txt_color_eva.ForeColor & "'" & ")"
                MsgBox ("Registro Agregado")
                Me.btn_eva_eliminar.Enabled = False
                Me.Txt_cod_eva = ""
                Me.Txt_des_eva = ""
                Me.txt_por_eva = ""
                Me.txt_nota_eva = ""
                Me.txt_color_eva.BackColor = 16777215
                Me.txt_color_eva.ForeColor = 16777215
                Me.txt_nota_eva.Enabled = False
                Me.txt_por_eva.Enabled = False
                Me.Txt_cod_eva.Enabled = False
                Me.btn_colortexto_eva.Enabled = False
                Me.btn_colorfondo_eva.Enabled = False
                Me.btn_eva_eliminar.Enabled = False
                Me.Txt_des_eva.SetFocus
                Me.Label3.Caption = ""
            Else
                Me.txt_por_eva.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_des_eva.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 evaluaciones (cod_eva, des_eva, porcentaje_eva, notas_eva, color_fondo_eva, color_texto_eva, ) values('" & codigofinal & "' , '" & descripcion & "' , '" & porcentaje & "' , '" & notas & "' , '" & Me.txt_color_eva.BackColor & "', '" & Me.txt_color_eva.ForeColor & "'" & ")"
            MsgBox ("Registro Agregado")
            ingxcodigo = 0
        Else
            conn.Execute "UPDATE evaluaciones Set des_eva = '" & descripcion & "' , porcentaje_eva = '" & porcentaje & "', notas_eva = '" & notas & "', color_texto_eva = '" & Me.txt_color_eva.ForeColor & "', color_fondo_eva = '" & Me.txt_color_eva.BackColor & "' where cod_eva = '" & Codigo & "'"
            MsgBox ("Registro Modificado")
                    
        End If
            Me.btn_eva_eliminar.Enabled = False
            Me.Label3.Caption = ""
            Me.Txt_cod_eva.Text = ""
            Me.Txt_des_eva.Text = ""
            Me.txt_por_eva.Text = ""
            Me.txt_nota_eva.Text = ""
            Me.Txt_des_eva.SetFocus
            Me.txt_color_eva.BackColor = 16777215
            Me.txt_color_eva.ForeColor = 16777215
            Me.txt_nota_eva.Enabled = False
            Me.txt_por_eva.Enabled = False
            Me.Txt_cod_eva.Enabled = False
            Me.btn_colortexto_eva.Enabled = False
            Me.btn_colorfondo_eva.Enabled = False
            Me.btn_eva_eliminar.Enabled = False
            Busqueda = 1
            'End If
    End If
    End If
    Else
        MsgBox ("No deben haber campos vacíos")
    End If
    
    Me.Txt_des_eva.SetFocus

End Sub

Private Sub btn_eva_cancelar_Click()
Unload Me
End Sub

Private Sub btn_eva_eliminar_Click()
If ExistReg("notas", "num_per ='" & Txt_cod_eva & "'", 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 evaluaciones WHERE COD_Eva ='" & Txt_cod_eva & "'"
        Txt_cod_eva = ""
        Txt_des_eva = ""
        Me.txt_por_eva.Text = ""
        Me.txt_nota_eva.Text = ""
        Me.txt_color_eva.BackColor = 16777215
        Me.txt_color_eva.ForeColor = 16777215
        Me.txt_nota_eva.Enabled = False
        Me.txt_por_eva.Enabled = False
        Me.Txt_cod_eva.Enabled = False
        Me.btn_colortexto_eva.Enabled = False
        Me.btn_colorfondo_eva.Enabled = False
        Me.btn_eva_eliminar.Enabled = False
        Busqueda = 1
    End If
End If
Me.Label3.Caption = ""
Me.Txt_des_eva.SetFocus


End Sub

Private Sub btn_Normaliza_Alu_x_cur_Click()
'Dim Rutalumno As String
'rs.Open "select distinct ci_alu from alu_x_cur order by ci_alu", conn
'If rs.RecordCount > 0 Then
'    While Not rs.EOF
'        Rutalumno = rs("ci_alu")
'        rsaux.Open "select ci_alu from ci_alu = '" & Rutalumno & "'", conn
'        If rs.RecordCount > 1 Then
'
'        End If
'        rsaux.Close
'    Wend
'End If
End Sub

Private Sub Btn_Per_Aceptar_Click()
Dim Codigo, cod, codigofinal, a, descripcion As String
Codigo = Txt_cod_periodo.Text
descripcion = Txt_des_periodo.Text
If Len(Trim(Me.Txt_des_periodo.Text)) <> 0 And (Me.dtp_fec_ini_per.Enabled = True And Me.dtp_fec_ter_per.Enabled = True) Then
If Busqueda = 1 And Len(Trim(Txt_des_periodo.Text)) <> 0 Then
    rs.CursorLocation = adUseClient
    rs.Open "SELECT * FROM periodos where des_per =" & "'" & descripcion & "'"
    If rs.RecordCount > 0 Then
        rs.MoveLast
        rs.MoveFirst
        Txt_cod_periodo.Text = rs("num_per")
        Txt_des_periodo.Text = rs("des_per")
        Me.dtp_fec_ini_per.Value = rs("fec_ini_per")
        Me.dtp_fec_ter_per.Value = rs("fec_per_ter")
        Me.chk_cierre_per.Value = rs("per_cerrado")
        Codigo = rs("num_per")
        Me.Label12.Caption = "Editando Periodo Existente"
        Me.Lst_des_periodo.Visible = False
        Busqueda = 0
        Indi = 0
        Me.Txt_des_periodo.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("periodos", "num_per", conn)
            Me.Txt_cod_periodo.Text = codigofinal
            conn.Execute "INSERT INTO periodos(num_per, des_per, fec_ini_per, fec_ter_per, per_cerrado) values('" & codigofinal & "' , '" & descripcion & "' , '" & InvierteFecha(dtp_fec_ini_per, "R") & "' , '" & InvierteFecha(dtp_fec_ter_per, "R") & "', " & Me.chk_cierre_per.Value & ")"
            MsgBox ("Registro Agregado")
            Me.Txt_cod_periodo.Text = ""
            Me.Txt_des_periodo.Text = ""
            Me.chk_cierre_per.Value = 0
            Me.chk_cierre_per.Visible = False
            Me.Txt_des_periodo.SetFocus
            Me.dtp_fec_ini_per.Enabled = False
            Me.dtp_fec_ter_per.Enabled = False
            Me.Btn_Per_Eliminar.Enabled = False
        Else
            Me.Txt_des_periodo.SetFocus
            SendKeys "{home}+{end}"
        End If

    End If
ElseIf Len(Trim(Me.Txt_des_periodo.Text)) <> 0 Then
            'rs.Open "SELECT * FROM periodos where des_per =" & "'" & Me.Txt_des_periodo.Text & "'"
            'If rs.recordcount > 0 Then
            '    MsgBox ("Descripción ya existe")
            '    Me.Txt_des_periodo.SetFocus
            '    SendKeys "{home}+{end}"
            '    rs.Close
            'Else
            '    rs.Close
                conn.Execute "UPDATE periodos Set des_per = '" & descripcion & "' , fec_ini_per = '" & InvierteFecha(Me.dtp_fec_ini_per.Value, "R") & "', fec_ter_per = '" & InvierteFecha(Me.dtp_fec_ter_per.Value, "R") & "' , per_cerrado = " & Me.chk_cierre_per.Value & " where num_per =" & Codigo
                MsgBox ("Registro Modificado")
                Me.Label12.Caption = ""
                Me.Txt_cod_periodo.Text = ""
                Me.Txt_des_periodo.Text = ""
                Me.chk_cierre_per.Value = 0
                Me.chk_cierre_per.Visible = False
                Me.Txt_des_periodo.SetFocus
                Me.dtp_fec_ini_per.Enabled = False
                Me.dtp_fec_ter_per.Enabled = False
                Me.Btn_Per_Eliminar.Enabled = False
                Busqueda = 1
            'End If
End If

Else
    MsgBox "No debe haber ningún campo vacío"
End If
Me.Txt_des_periodo.SetFocus
End Sub

Private Sub Btn_Per_Cancelar_Click()
Unload Me
End Sub

Private Sub Btn_Per_Eliminar_Click()
If ExistReg("notas", "num_per ='" & Txt_cod_periodo & "'", 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 periodos WHERE num_per ='" & Txt_cod_periodo & "'"
        Txt_cod_periodo = ""
        Txt_des_periodo = ""
        Me.chk_cierre_per.Value = 0
        Me.chk_cierre_per.Visible = False
        Busqueda = 1
        Me.Btn_Per_Eliminar.Enabled = False
    End If
End If
Me.Label12.Caption = ""
Me.Txt_des_periodo.SetFocus

End Sub

Private Sub Btn_vac_aceptar_Click()

If Len(Me.Cmb_mod_vac.Text) <> 0 And Len(Me.Cmb_num_gra_vac.Text) <> 0 And Len(Me.Cmb_jor_vac.Text) <> 0 And Len(Trim(Me.txt_total_vac.Text)) <> 0 Then
    Codens = devuelvecampo("codigos_ensenanza", "des_ens", "cod_ens", "des_ens =" & "'" & Me.Cmb_mod_vac.Text & "'", conn)
    nivel = Me.Cmb_num_gra_vac.Text
    jorvac = devuelvecampo("jornadas", "", "cod_jor", "des_jor = '" & Me.Cmb_jor_vac.Text & "'", conn)
    If Me.txt_total_vac < Me.txt_ocu_vac.Text Then
        MsgBox ("-Total Vacantes- no puede ser menor que el número " & Chr(13) & "de -Vacantes Ocupadas-")
        Me.txt_total_vac.Text = Val(Me.txt_dis_vac.Text) + Val(Me.txt_ocu_vac.Text)
        Me.txt_total_vac.SetFocus
        SendKeys "{home}+{end}"
        Exit Sub
    End If
    If Me.txt_total_vac_prox < Me.txt_ocu_vac_prox Then
        MsgBox ("-Total Vacantes próximo año- no puede ser menor que el número " & Chr(13) & "de -Vacantes Ocupadas próximo año-")
        Me.txt_total_vac_prox.Text = Val(Me.txt_dis_vac_prox.Text) + Val(Me.txt_ocu_vac_prox.Text)
        Me.txt_total_vac_prox.SetFocus
        SendKeys "{home}+{end}"
        Exit Sub
    End If

If Busqueda = 1 Then
    rs.CursorLocation = adUseClient
    rs.Open "select * from vac_x_nivel where cod_ens= '" & Codens & "' and num_gra = '" & nivel & "' and cod_jor = '" & jorvac & "'" & " AND agno=" & Cmb_Agno.Text
    If rs.RecordCount > 0 Then
        Me.txt_total_vac.Text = rs("total_vac")
        Me.txt_ocu_vac.Text = rs("ocu_vac")
        Me.txt_dis_vac.Text = rs("dis_vac")
        Me.txt_total_vac_prox.Text = rs("total_vac_prox")
        Me.txt_ocu_vac_prox.Text = rs("ocu_vac_prox")
        Me.txt_dis_vac_prox.Text = rs("dis_vac_prox")
        rs.Close
        Me.Cmb_mod_vac.Enabled = False
        Me.Cmb_num_gra_vac.Enabled = False
        Me.Cmb_jor_vac.Enabled = True
        Me.Cmb_jor_vac.SetFocus
        Me.Label25.Caption = "Modificando Vacantes"
        Busqueda = 0
        Me.Btn_vac_eliminar.Enabled = True
    
    Else
        rs.Close
        
        If MsgBox("El registro no existe. ¿Desea crearlo?", vbYesNo + vbQuestion) = vbYes Then
            'Insertando Registro en tabla
            conn.Execute "INSERT INTO vac_x_nivel (cod_ens, num_gra, cod_jor, total_vac, dis_vac, ocu_vac, total_vac_prox, dis_vac_prox, ocu_vac_prox, agno) values('" & Codens & "' , '" & nivel & "' , '" & jorvac & "' , '" & Me.txt_total_vac.Text & "' , '" & Me.txt_dis_vac.Text & "' , '" & Me.txt_ocu_vac.Text & "' , '" & Me.txt_total_vac_prox.Text & "' , '" & Me.txt_dis_vac_prox.Text & "' , '" & Me.txt_ocu_vac_prox.Text & "'," & Cmb_Agno.Text & ")"
            MsgBox ("Registro Agregado")
            Me.Cmb_mod_vac.Enabled = True
            Me.Cmb_num_gra_vac.Enabled = True
            Me.Cmb_jor_vac.Enabled = True
            Me.Cmb_mod_vac.Text = ""
            Me.Cmb_num_gra_vac.Text = ""
            Me.Cmb_jor_vac.Text = ""
            
            Me.txt_total_vac.Text = ""
            Me.txt_dis_vac.Text = ""
            Me.txt_ocu_vac.Text = ""
            Me.txt_total_vac_prox.Text = ""
            Me.txt_dis_vac_prox.Text = ""
            Me.txt_ocu_vac_prox.Text = ""
            
            Me.txt_total_vac.Enabled = False
            Me.txt_dis_vac.Enabled = False
            Me.txt_ocu_vac.Enabled = False
            Me.txt_total_vac_prox.Enabled = False
            Me.txt_dis_vac_prox.Enabled = False
            Me.txt_ocu_vac_prox.Enabled = False
          
            Me.Cmb_mod_vac.SetFocus
            Me.Label25.Caption = ""
            Me.Btn_vac_eliminar.Enabled = False
        Else
            Me.Cmb_mod_vac.SetFocus
        End If

    End If
Else
    a = "UPDATE vac_x_nivel Set total_vac = " & Val(Me.txt_total_vac.Text) & ", dis_vac = " & Val(Me.txt_dis_vac.Text) & ", total_vac_prox = " & Val(Me.txt_total_vac_prox.Text) & ", dis_vac_prox = " & Val(Me.txt_dis_vac_prox.Text) & " where cod_ens = '" & Codens & "' and num_gra = '" & nivel & "' and cod_jor = '" & jorvac & "' and agno = " & Cmb_Agno.Text
    conn.Execute a
    Busqueda = 1
    MsgBox ("Registro Modificado")
    Me.Label25.Caption = ""
    Me.Cmb_mod_vac.Enabled = True
    Me.Cmb_num_gra_vac.Enabled = True
    Me.Cmb_jor_vac.Enabled = True
    Me.Cmb_mod_vac.Text = ""
    Me.Cmb_num_gra_vac.Text = ""
    Me.Cmb_jor_vac.Text = ""
    Me.txt_total_vac.Text = ""
    Me.txt_dis_vac.Text = ""
    Me.txt_ocu_vac.Text = ""
    Me.txt_total_vac_prox.Text = ""
    Me.txt_dis_vac_prox.Text = ""
    Me.txt_ocu_vac_prox.Text = ""
    
    Me.Cmb_num_gra_vac.Enabled = False
    Me.Cmb_jor_vac.Enabled = False
    Me.txt_total_vac.Enabled = False
    Me.txt_dis_vac.Enabled = False
    Me.txt_ocu_vac.Enabled = False
    Me.txt_total_vac_prox.Enabled = False
    Me.txt_dis_vac_prox.Enabled = False
    Me.txt_ocu_vac_prox.Enabled = False
    Me.Btn_vac_eliminar.Enabled = False
    Me.Cmb_mod_vac.SetFocus
    Me.Label25.Caption = ""
    Me.Btn_vac_eliminar.Enabled = False
End If
Else
    MsgBox ("No deben haber campos esenciales vacíos")
End If
End Sub

Private Sub Btn_vac_cancelar_Click()
Unload Me
End Sub

Private Sub Btn_vac_eliminar_Click()
CodModalidad = devuelvecampo("codigos_ensenanza", "des_ens", "cod_ens", "des_ens = " & "'" & Me.Cmb_mod_vac.Text & "'", conn)
CodJornada = devuelvecampo("jornadas", "", "cod_jor", "des_jor = '" & Me.Cmb_jor_vac.Text & "'", conn)
If ExistReg("grados", "cod_ens ='" & CodModalidad & "' and num_gra ='" & Me.Cmb_num_gra_vac.Text & "'", conn) Or ExistReg("postulantes", "cod_ens= '" & CodModalidad & "' and num_gra = '" & Me.Cmb_num_gra_vac.Text & "' and jornada = '" & Me.Cmb_jor_vac.Text & "' and matriculado_alu", 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 vac_x_nivel where cod_ens= " & "'" & CodModalidad & "'" & " and num_gra = " & "'" & Me.Cmb_num_gra_vac.Text & "'" & "and cod_jor = " & "'" & CodJornada & "' and agno = " & Cmb_Agno.Text & ""
        Me.Cmb_mod_vac = ""
        Me.Cmb_num_gra_vac = ""
        Me.Cmb_jor_vac = ""
        Me.txt_total_vac = ""
        Me.txt_ocu_vac = ""
        Me.txt_dis_vac = ""
        Me.txt_total_vac_prox = ""
        Me.txt_ocu_vac_prox = ""
        Me.txt_dis_vac_prox = ""
        Busqueda = 1
        Me.Btn_vac_eliminar.Enabled = False
    End If
End If
Me.Label1.Caption = ""
Me.txt_total_vac.SetFocus

End Sub

Private Sub chk_cierre_per_Click()
Me.chk_cierre_per.Caption = IIf(Me.chk_cierre_per.Value, "Periodo Cerrado", "Periodo Abierto")
End Sub

Private Sub Cmb_jor_vac_KeyPress(KeyAscii As Integer)
Dim str As String

If KeyAscii = 13 And Len(Me.Cmb_jor_vac.Text) <> 0 And Busqueda = 1 Then
    CodModalidad = devuelvecampo("codigos_ensenanza", "des_ens", "cod_ens", "des_ens = " & "'" & Me.Cmb_mod_vac.Text & "'", conn)
    CodJornada = devuelvecampo("jornadas", "", "cod_jor", "des_jor = '" & Me.Cmb_jor_vac.Text & "'", conn)
    str = "select * from vac_x_nivel where cod_ens= '" & CodModalidad & "' and num_gra = '" & Me.Cmb_num_gra_vac.Text & "' and cod_jor = '" & CodJornada & "' and Agno=" & Cmb_Agno.Text & ";"
    rs.CursorLocation = adUseClient
    rs.Open str, conn
    If rs.RecordCount > 0 Then
        Busqueda = 0
        Me.txt_total_vac.Enabled = True
        Me.txt_total_vac_prox.Enabled = True
        
        Me.txt_total_vac.Text = rs("total_vac")
        Me.txt_ocu_vac.Text = rs("ocu_vac")
        Me.txt_dis_vac.Text = rs("dis_vac")
        
        Me.txt_total_vac_prox.Text = rs("total_vac_prox")
        Me.txt_ocu_vac_prox.Text = rs("ocu_vac_prox")
        Me.txt_dis_vac_prox.Text = rs("dis_vac_prox")
        rs.Close
        Me.Label18.Caption = "Editando Vacantes Existentes"
        Me.Cmb_mod_vac.Enabled = False
        Me.Cmb_num_gra_vac.Enabled = False
        Me.Cmb_jor_vac.Enabled = False
        Me.txt_total_vac.SetFocus
        Me.Btn_vac_cancelar.Enabled = True
        SendKeys "{home}"
    Else
        rs.Close
        Me.Label25.Caption = "Ingresando Nuevas Vacantes"
        Me.txt_total_vac.Enabled = True
        Me.txt_total_vac.SetFocus
    End If

End If

Me.Btn_vac_eliminar.Enabled = True


End Sub

Private Sub cmb_mod_gra_Click()
If Len(Me.cmb_mod_gra.Text) <> 0 Then
 nivel = devuelvecampo("codigos_ensenanza", "", "num_gra_max", "des_ens = '" & Me.cmb_mod_gra.Text & "'", conn)
 Me.cmb_num_gra.Enabled = True
 Me.cmb_num_gra.Clear
 For t = 1 To Val(nivel)
    Me.cmb_num_gra.AddItem t
 Next t
End If

End Sub

Private Sub cmb_mod_gra_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 And Len(Me.cmb_mod_gra.Text) <> 0 Then
    Me.cmb_num_gra.Enabled = True
    Me.cmb_num_gra.SetFocus
Else
    Me.cmb_mod_gra.SetFocus
End If
KeyAscii = 0
End Sub

Private Sub Cmb_mod_vac_Click()
If Len(Me.Cmb_mod_vac.Text) <> 0 Then
 nivel = devuelvecampo("codigos_ensenanza", "des_ens", "num_gra_max", "des_ens = " & "'" & Me.Cmb_mod_vac.Text & "'", conn)
 Me.Cmb_num_gra_vac.Enabled = True
 Me.Cmb_num_gra_vac.Clear
 For t = 1 To Val(nivel)
    Me.Cmb_num_gra_vac.AddItem t
 Next t
End If

End Sub

Private Sub Cmb_mod_vac_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 And Len(Me.Cmb_mod_vac.Text) <> 0 Then
    Me.Cmb_num_gra_vac.Enabled = True
    Me.Cmb_num_gra_vac.SetFocus
End If
End Sub

Private Sub Cmb_mod_vac_LostFocus()
If Me.Cmb_mod_vac.Text = "Verdadero" Then
    Me.Cmb_mod_vac.Text = ""
    Me.Cmb_mod_vac.SetFocus
End If
End Sub

Private Sub cmb_num_gra_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 And Len(Me.cmb_num_gra.Text) <> 0 And Busqueda = 1 Then
    CodModalidad = devuelvecampo("codigos_ensenanza", "", "cod_ens", "des_ens = " & "'" & Me.cmb_mod_gra.Text & "'", conn)
    rs.CursorLocation = adUseClient
    rs.Open "select * from grados where num_gra ='" & Me.cmb_num_gra.Text & "' and cod_ens = '" & CodModalidad & "'", conn
    If rs.RecordCount > 0 Then
        Me.Txt_des_Gra.Text = rs("des_gra")
        Busqueda = 0
        Me.cmb_mod_gra.Enabled = False
        Me.cmb_num_gra.Enabled = False
        Me.Btn_eli_gra.Enabled = True
        Me.Label20.Caption = "Modificando Grado existente."
        rs.Close
    Else
        rs.Close
        Me.Label20.Caption = "Ingresando Nuevo Grado."
        Me.Btn_eli_gra.Enabled = False
        Busqueda = 1
    End If
    Me.Txt_des_Gra.Enabled = True
    Me.Txt_des_Gra.SetFocus
End If
KeyAscii = 0
End Sub

Private Sub Cmb_num_gra_vac_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 And Len(Me.Cmb_num_gra_vac.Text) <> 0 Then
    Me.Cmb_jor_vac.Enabled = True
    Me.Cmb_jor_vac.SetFocus
End If
End Sub


Private Sub dtp_fec_ini_per_Change()
Me.dtp_fec_ter_per.MinDate = Me.dtp_fec_ini_per.Value
End Sub

Private Sub dtp_fec_ini_per_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 And Len(Me.dtp_fec_ini_per.Value) <> 0 Then
    'Me.dtp_fec_ter_per.MinDate = Me.dtp_fec_ini_per.Value
    Me.dtp_fec_ter_per.Enabled = True
    Me.dtp_fec_ter_per.SetFocus
Else
    Me.dtp_fec_ini_per.SetFocus
End If

End Sub

Private Sub dtp_fec_ter_per_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 And Len(Me.dtp_fec_ter_per.Value) <> 0 Then
    Btn_Per_Aceptar_Click
Else
    Me.dtp_fec_ter_per.SetFocus
End If
End Sub

Private Sub dtp_fec_ter_per_LostFocus()
If Me.dtp_fec_ter_per.Value >= Me.dtp_fec_ini_per Then
        Me.Btn_Per_Aceptar.Enabled = True
        Me.Btn_Per_Aceptar.SetFocus
    Else
        MsgBox ("Fecha fin periodo, no puede ser menor " & Chr(13) & "a fecha de inicio")
        Me.dtp_fec_ter_per.SetFocus
    End If
End Sub

Private Sub Form_KeyPress(KeyAscii As Integer)
KeyAscii = Asc(UCase(Chr(KeyAscii)))
If KeyAscii = Asc("á") Or KeyAscii = Asc("Á") Then Exit Sub
If KeyAscii = Asc("é") Or KeyAscii = Asc("É") Then Exit Sub
If KeyAscii = Asc("í") Or KeyAscii = Asc("Í") Then Exit Sub
If KeyAscii = Asc("ó") Or KeyAscii = Asc("Ó") Then Exit Sub
If KeyAscii = Asc("ú") Or KeyAscii = Asc("Ú") Then Exit Sub
If KeyAscii = Asc("ñ") Or KeyAscii = Asc("Ñ") Then Exit Sub
If ((Chr(KeyAscii) >= "A" And Chr(KeyAscii) <= "Z") Or (Chr(KeyAscii) >= "a" And Chr(KeyAscii) <= "z")) Then Exit Sub
If (Chr(KeyAscii) >= "0" And Chr(KeyAscii) <= "9") Then Exit Sub
If KeyAscii = 8 Then Exit Sub
If KeyAscii = 13 Then Exit Sub
If KeyAscii = 32 Then Exit Sub
If KeyAscii = 37 Then Exit Sub
KeyAscii = 0
End Sub

Private Sub Form_Load()
Call menuhabilitado(False)
Form_man_tab2.KeyPreview = True
Busqueda = 1
Set rs = New ADODB.Recordset

If ManTab2 = "jor" Then
    Call Form_main.Hideframe2
    Form_man_tab2.Height = 3140
    Form_man_tab2.Width = 8400
    Form_man_tab2.Label28.Caption = ""
    Form_man_tab2.Frame_Jornadas.Top = 20
    Form_man_tab2.Frame_Jornadas.Left = 80
    Form_man_tab2.Frame_Jornadas.Visible = True
    CentrarForma Me
    Form_man_tab2.Show
    Form_man_tab2.txt_des_jor.SetFocus
    Form_man_tab2.Txt_codint_jor.Enabled = False
    Form_man_tab2.Btn_eli_jor.Enabled = False
End If

If ManTab2 = "per" Then
    Call Form_main.Hideframe2
    Form_man_tab2.Height = 3450
    Form_man_tab2.Width = 8400
    Form_man_tab2.Frame_periodo.Top = 20
    Form_man_tab2.Frame_periodo.Left = 80
    Form_man_tab2.Label12.Caption = ""
    Form_man_tab2.Frame_periodo.Visible = True
    CentrarForma Me
    Form_man_tab2.Show
    Form_man_tab2.dtp_fec_ini_per.Enabled = False
    Form_man_tab2.dtp_fec_ter_per.Enabled = False
    Form_man_tab2.chk_cierre_per.Visible = False
    Form_man_tab2.Txt_des_periodo.SetFocus
    Form_man_tab2.Txt_cod_periodo.Enabled = False
    Form_man_tab2.Btn_Per_Eliminar.Enabled = False

End If

If ManTab2 = "eva" Then
    Call Form_main.Hideframe2
    Form_man_tab2.Height = 3520
    Form_man_tab2.Width = 8430
    Form_man_tab2.Frame_Evaluaciones.Top = 20
    Form_man_tab2.Frame_Evaluaciones.Left = 80
    Form_man_tab2.Label12.Caption = ""
    Form_man_tab2.Frame_Evaluaciones.Visible = True
    CentrarForma Me
    Form_man_tab2.Show
    Form_man_tab2.Txt_des_eva.SetFocus
    Form_man_tab2.Txt_cod_eva.Enabled = False
    Form_man_tab2.txt_por_eva.Enabled = False
    Form_man_tab2.txt_nota_eva.Enabled = False
    Form_man_tab2.btn_colortexto_eva.Enabled = False
    Form_man_tab2.btn_colorfondo_eva.Enabled = False
    Form_man_tab2.btn_eva_eliminar.Enabled = False

End If

If ManTab2 = "vac" Then
    Form_man_tab2.Label25.Caption = ""
    Form_man_tab2.Height = 4700
    Form_man_tab2.Width = 9800
    Call Form_main.Hideframe2
    Form_man_tab2.Frame_Vac.Top = 20
    Form_man_tab2.Frame_Vac.Left = 80
    Form_man_tab2.Frame_Vac.Visible = True
    CentrarForma Me
    Form_man_tab2.Show
    Form_man_tab2.Cmb_mod_vac.SetFocus
    Form_man_tab2.Cmb_num_gra_vac.Enabled = False
    Form_man_tab2.Cmb_jor_vac.Enabled = False
    Form_man_tab2.txt_total_vac.Enabled = False
    Form_man_tab2.txt_total_vac_prox.Enabled = False
    Form_man_tab2.Btn_vac_eliminar.Enabled = False
    Call llenacombo(Form_man_tab2.Cmb_mod_vac, "codigos_ensenanza", "des_ens", "order by ord_ens", conn)
    Call llenacombo(Form_man_tab2.Cmb_jor_vac, "jornadas", "des_jor", "order by des_jor", conn)
    ' Combo de año
    Cmb_Agno.AddItem str(Anno), 0
    Cmb_Agno.AddItem str(Anno + 1), 1
    Cmb_Agno.Text = str(Anno)
    ' fin combo de año
    Form_man_tab2.Btn_vac_eliminar.Enabled = False
End If

If ManTab2 = "gra" Then
    Call Form_main.Hideframe2
    Form_man_tab2.Height = 3166
    Form_man_tab2.Width = 8520
    Form_man_tab2.Frame_grados.Top = 60
    Form_man_tab2.Frame_grados.Left = 120
    Form_man_tab2.Label20.Caption = ""
    Form_man_tab2.Frame_grados.Visible = True
    CentrarForma Me
    Form_man_tab2.Show
    Form_man_tab2.Txt_des_Gra.Enabled = False
    Form_man_tab2.cmb_num_gra.Enabled = False
    Call llenacombo(Form_man_tab2.cmb_mod_gra, "codigos_ensenanza", "des_ens", "order by ord_ens", conn)
    Form_man_tab2.Btn_eli_gra.Enabled = False
    Form_man_tab2.cmb_mod_gra.SetFocus
End If

End Sub

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

Private Sub lst_des_eva_DblClick()
Indi = 0
Busqueda = 0
Me.Txt_des_eva.Text = Me.lst_des_eva.Text
a = "SELECT * FROM evaluaciones where des_eva = " & "'" & Txt_des_eva & "'" & " order by des_eva ASC"
rs.Open a, conn
If rs.RecordCount > 0 Then
    Me.Txt_cod_eva.Text = rs("cod_eva")
    Me.txt_por_eva.Text = rs("porcentaje_eva")
    Me.txt_nota_eva.Text = rs("notas_eva")
    Me.txt_color_eva.BackColor = Val(rs("color_fondo_eva"))
    Me.txt_color_eva.ForeColor = Val(rs("color_texto_eva"))
    Me.txt_por_eva.Enabled = True
    Me.txt_nota_eva.Enabled = True
    Me.btn_colortexto_eva.Enabled = True
    Me.btn_colorfondo_eva.Enabled = True
    Me.lst_des_eva.Visible = False
    
    Me.Label3.Caption = "Editando Evaluación Existente"
    Me.btn_eva_eliminar.Enabled = True
    Me.Txt_des_eva.SetFocus
    SendKeys "{end}"
End If
rs.Close

End Sub

Private Sub lst_des_eva_GotFocus()
Me.btn_eva_aceptar.Enabled = False
End Sub

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

End Sub

Private Sub lst_des_eva_LostFocus()
Me.btn_eva_aceptar.Enabled = True
End Sub

Private Sub lst_des_jor_DblClick()
Indi = 0
Busqueda = 0
Me.txt_des_jor.Text = Me.lst_des_jor.Text
a = "SELECT * FROM jornadas where des_jor = " & "'" & txt_des_jor & "'" & " order by cod_jor ASC"
rs.CursorLocation = adUseClient
rs.Open a, conn
If rs.RecordCount > 0 Then
    Txt_cod_jor.Text = rs(0)
    Me.Txt_codint_jor.Text = rs(2)
    Me.lst_des_jor.Visible = False
    Me.Label28.Caption = "Editando Jornada"
    Me.Txt_codint_jor.Enabled = True
    Me.Btn_eli_jor.Enabled = True
    Me.txt_des_jor.SetFocus
    SendKeys "{end}"
    ingxcodigo = 0
End If
rs.Close

End Sub

Private Sub lst_des_jor_GotFocus()
Me.Btn_ace_jor.Enabled = False
End Sub

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

End Sub

Private Sub lst_des_jor_LostFocus()
Me.Btn_ace_jor.Enabled = True
End Sub

Private Sub Lst_des_periodo_DblClick()
Indi = 0
Busqueda = 0
Me.Txt_des_periodo.Text = Me.Lst_des_periodo.Text
a = "SELECT * FROM periodos where des_per = " & "'" & Txt_des_periodo & "'" & " order by num_per ASC"
rs.CursorLocation = adUseClient
rs.Open a, conn
If rs.RecordCount > 0 Then
    Me.dtp_fec_ini_per.Enabled = True
    Me.dtp_fec_ter_per.Enabled = True
    Txt_cod_periodo.Text = rs("num_per")
    Me.dtp_fec_ini_per.Value = rs("fec_ini_per")
    Me.dtp_fec_ter_per.Value = rs("fec_ter_per")
    Form_man_tab2.chk_cierre_per.Visible = True
    Me.chk_cierre_per.Value = rs("per_cerrado")
    Me.chk_cierre_per.Caption = IIf(rs("per_cerrado"), "Periodo Cerrado", "Periodo Abierto")
    Me.Lst_des_periodo.Visible = False
    Me.Label12.Caption = "Modificando Periodo existente"
    Me.Btn_Per_Eliminar.Enabled = True
    Me.Txt_des_periodo.SetFocus
    SendKeys "{end}"
End If
rs.Close

End Sub

Private Sub Lst_des_periodo_GotFocus()
Me.Btn_Per_Aceptar.Enabled = False
End Sub

Private Sub Lst_des_periodo_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
 Call Lst_des_periodo_DblClick
 'Me.Txt_des_periodo.text = Me.Lst_des_periodo.List(Me.Lst_des_periodo.ListIndex)
End If
End Sub

Private Sub Lst_des_periodo_LostFocus()
Me.Btn_Per_Aceptar.Enabled = True
End Sub

Private Sub Txt_cod_eva_KeyPress(KeyAscii As Integer)
'rs.CursorLocation = adUseClient
'If KeyAscii = 13 And Len(Me.Txt_cod_eva.Text) <> 0 Then
'    If Len(Me.Txt_des_eva.Text) <> 0 Then
'        If ExistReg("evaluaciones", "cod_eva='" & Txt_cod_eva & "'") Then
'            MsgBox ("Código de Evaluación ya existe")
'            Me.Txt_cod_eva.SetFocus
'            SendKeys "{home}+{end}"
'        Else
'            Me.txt_por_eva.Enabled = True
'            Me.txt_por_eva.SetFocus
'        End If
'    Else
'        rs.Open "SELECT * FROM evaluaciones where cod_eva = " & Me.Txt_cod_eva.Text, conn
'        If rs.recordcount > 0 Then
'            Busqueda = 0
'            Me.Txt_cod_eva.Enabled = False
'            Me.Txt_des_eva.Text = rs("des_eva")
'            Me.txt_por_eva.Text = rs("porcentaje_eva")
'            Me.txt_nota_eva.Text = rs("notas_eva")
'            Me.Label3.Caption = "Editando Registro Existente"
'            Me.btn_eva_eliminar.Enabled = True
'            Me.Txt_des_eva.SetFocus
'        Else
 '           Busqueda = 0
'            Me.Txt_des_eva.SetFocus
'            Me.Label3.Caption = "Ingresando Nuevo Registro"
'            Me.btn_eva_eliminar.Enabled = False
 '           ingxcodigo = 1
 ''       End If
 '       rs.Close
 '   End If
'End If

End Sub


Private Sub Txt_cod_jor_KeyPress(KeyAscii As Integer)
rs.CursorLocation = adUseClient
If KeyAscii = 13 And Len(Trim(Me.Txt_cod_jor.Text)) <> 0 Then
    If Len(Trim(Me.txt_des_jor.Text)) <> 0 Then
        If ExistReg("jornadas", "cod_jor='" & Txt_cod_jor & "'", conn) Then
            MsgBox ("Código de Jornada ya existe")
            Me.Txt_cod_jor.SetFocus
            SendKeys "{home}+{end}"
        Else
            Me.Txt_codint_jor.Enabled = True
            Me.Txt_codint_jor.SetFocus
        End If
    Else
        rs.CursorLocation = adUseClient
        rs.Open "SELECT * FROM jornadas where cod_jor = '" & Me.Txt_cod_jor.Text & "'", conn
        If rs.RecordCount > 0 Then
            Busqueda = 0
            Me.Txt_cod_jor.Enabled = False
            Me.Txt_codint_jor.Enabled = True
            Me.txt_des_jor.Text = rs("des_jor")
            Me.Txt_codint_jor.Text = rs("cod_jor_interno")
            Me.Label28.Caption = "Editando Jornada"
            Me.Btn_eli_jor.Enabled = True
            Me.txt_des_jor.SetFocus
        Else
            Busqueda = 0
            Me.txt_des_jor.SetFocus
            Me.Label28.Caption = "Ingresando Nueva Jornada"
            Me.Btn_eli_jor.Enabled = False
            ingxcodigo = 1
        End If
        rs.Close
    End If
End If

End Sub

Private Sub Txt_codint_jor_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 And Len(Trim(Me.Txt_codint_jor.Text)) <> 0 Then
    Call Btn_ace_jor_Click
End If
End Sub

Private Sub Txt_des_eva_Change()
If Busqueda = 1 Then
  rs.CursorLocation = adUseClient
'fetch the initial table ..
'rs.Open "SELECT * FROM tipo_apo", conn
lst_des_eva.Clear
If Not ((Chr(KeyAscii) >= "A" And Chr(KeyAscii) <= "Z") Or (Chr(KeyAscii) >= "a" And Chr(KeyAscii) <= "z")) Then
    KeyAscii = 0
    If Me.Txt_des_eva.Text <> "" Then
      Criterio = "'" + Me.Txt_des_eva.Text + Consulta + "%'"
      rs.CursorLocation = adUseClient
      rs.Open "SELECT * FROM evaluaciones where des_eva like " & Criterio & " order by des_eva", conn
      'rs.FindFirst "des_pre like " + Criterio
            'rs.MoveFirst
        lst_des_eva.Visible = False
        'Me.Txt_cod_mod.Text = ""
        If rs.RecordCount > 0 Then
            Me.Label3.Caption = ""
            Indi = 0
            While Not rs.EOF
                Me.Txt_cod_eva.Enabled = False
                lst_des_eva.AddItem rs(1)
                lst_des_eva.Visible = True
                rs.MoveNext
            Wend
        Else
            Me.Label3.Caption = "Ingresando Nueva Evaluación"
            Me.btn_eva_eliminar.Enabled = False
            Indi = 0
        End If
        rs.Close
    Else
    lst_des_eva.Visible = False
    'Me.Txt_cod_eva.Enabled = True
    'Me.Txt_cod_eva.Text = ""
    End If
End If
End If
End Sub

Private Sub Txt_des_eva_KeyPress(KeyAscii As Integer)
If KeyAscii = 27 Then
    Txt_des_eva.Text = ""
    lst_des_eva.Visible = False
    KeyAscii = 0

ElseIf KeyAscii = 13 And Len(Trim(Me.Txt_des_eva.Text)) <> 0 And Busqueda = 0 Then
    Me.txt_por_eva.Enabled = True
    Me.txt_por_eva.SetFocus
    Me.lst_des_eva.Visible = False

ElseIf KeyAscii = 13 And Len(Trim(Me.Txt_des_eva.Text)) <> 0 And Busqueda = 1 And Not valorenlista(Form_man_tab2.lst_des_eva, Txt_des_eva.Text) Then
    Me.txt_por_eva.Enabled = True
    Me.txt_por_eva.SetFocus
    Me.lst_des_eva.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_des_eva.Text = "" Then
        If KeyAscii = 37 Then Exit Sub
End If
    KeyAscii = 0: Exit Sub

End Sub

Private Sub Txt_des_Gra_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 And Len(Trim(Me.Txt_des_Gra.Text)) <> 0 Then
    Call Btn_ace_gra_Click
End If
End Sub

Private Sub txt_des_jor_Change()
If Busqueda = 1 Then
  rs.CursorLocation = adUseClient
'fetch the initial table ..
'rs.Open "SELECT * FROM tipo_apo", conn
lst_des_jor.Clear
If Not ((Chr(KeyAscii) >= "A" And Chr(KeyAscii) <= "Z") Or (Chr(KeyAscii) >= "a" And Chr(KeyAscii) <= "z")) Then
    KeyAscii = 0
    If Me.txt_des_jor.Text <> "" Then
      Criterio = "'" + Me.txt_des_jor.Text + Consulta + "%'"
      rs.Open "SELECT * FROM jornadas where des_jor like " & Criterio & " order by cod_jor", conn
      'rs.FindFirst "des_pre like " + Criterio
            'rs.MoveFirst
        lst_des_jor.Visible = False
        'Me.Txt_cod_mod.Text = ""
        If rs.RecordCount > 0 Then
            Me.Label28.Caption = ""
            Indi = 0
            While Not rs.EOF
                Me.Txt_cod_jor.Enabled = False
                lst_des_jor.AddItem rs(1)
                lst_des_jor.Visible = True
                rs.MoveNext
            Wend
        Else
            Me.Label28.Caption = "Ingresando Nueva Jornada"
            Me.Btn_eli_jor.Enabled = False
            Indi = 0
        End If
        rs.Close
    Else
    lst_des_jor.Visible = False
    Me.Txt_cod_jor.Enabled = True
    Me.Txt_cod_jor.Text = ""
    End If
End If
End If

End Sub

Private Sub txt_des_jor_KeyPress(KeyAscii As Integer)

If KeyAscii = 27 Then
    txt_des_jor.Text = ""
    lst_des_jor.Visible = False
    KeyAscii = 0

ElseIf KeyAscii = 13 And Len(Trim(Me.txt_des_jor.Text)) <> 0 And Busqueda = 0 Then
    Me.Txt_codint_jor.Enabled = True
    Me.Txt_codint_jor.SetFocus
    Me.lst_des_jor.Visible = False

ElseIf KeyAscii = 13 And Len(Trim(Me.txt_des_jor.Text)) <> 0 And Busqueda = 1 And Not valorenlista(Form_man_tab2.lst_des_jor, txt_des_jor.Text) Then
    Me.Txt_cod_jor.Enabled = True
    Me.Txt_cod_jor.SetFocus
    Me.lst_des_jor.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_des_jor.Text = "" Then
        If KeyAscii = 37 Then Exit Sub
End If
    'KeyAscii = 0: Exit Sub

End Sub

Private Sub Txt_des_periodo_Change()
If Busqueda = 1 Then
  rs.CursorLocation = adUseClient
Lst_des_periodo.Clear
If Not ((Chr(KeyAscii) >= "A" And Chr(KeyAscii) <= "Z") Or (Chr(KeyAscii) >= "a" And Chr(KeyAscii) <= "z")) Then
    KeyAscii = 0
    If Me.Txt_des_periodo.Text <> "" Then
      Criterio = "'" + Me.Txt_des_periodo.Text + Consulta + "%'"
      rs.Open "SELECT * FROM periodos where des_per like " & Criterio & " order by num_per", conn
      'rs.FindFirst "des_pre like " + Criterio
            'rs.MoveFirst
        Lst_des_periodo.Visible = False
        Me.Txt_cod_periodo.Text = ""
        If rs.RecordCount > 0 Then
            Indi = 0
            While Not rs.EOF
                'Me.Txt_cod_TipoApo.Text = rs(0)
                Me.Txt_cod_periodo.Enabled = False
                Lst_des_periodo.AddItem rs(1)
                Lst_des_periodo.Visible = True
                'Me.Btn_Per_Aceptar.Enabled = False
                rs.MoveNext
            Wend
        Else
            Indi = 0
        End If
        rs.Close
    Else
    Lst_des_periodo.Visible = False
    Me.Txt_cod_periodo.Enabled = True
    Me.Txt_cod_periodo.Text = ""
    End If
End If
End If

End Sub

Private Sub Txt_des_periodo_KeyPress(KeyAscii As Integer)
'busqueda = 1
If KeyAscii = 27 Then
    Txt_des_periodo.Text = ""
    Lst_des_periodo.Visible = False
    KeyAscii = 0
ElseIf KeyAscii = 13 And Len(Trim(Me.Txt_des_periodo.Text)) <> 0 And Busqueda = 0 Then
    Me.dtp_fec_ini_per.Enabled = True
    Me.dtp_fec_ini_per.SetFocus
    Me.Lst_des_periodo.Visible = False
ElseIf KeyAscii = 13 And Len(Trim(Me.Txt_des_periodo.Text)) <> 0 And Busqueda = 1 And Not valorenlista(Form_man_tab2.Lst_des_periodo, Txt_des_periodo.Text) Then
    Me.dtp_fec_ini_per.Enabled = True
    Me.dtp_fec_ini_per.SetFocus
    Me.Lst_des_periodo.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_des_periodo.Text = "" Then
        If KeyAscii = 37 Then Exit Sub
End If
    KeyAscii = 0: Exit Sub

End Sub

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

Private Sub txt_ocu_vac_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 And Len(Trim(Me.txt_ocu_vac.Text)) <> 0 And Val(Trim(Me.txt_ocu_vac.Text)) <= Val(Me.txt_total_vac.Text) Then
    Me.txt_dis_vac.Text = Val(Me.txt_total_vac.Text) - Val(Me.txt_ocu_vac.Text)
    Me.txt_total_vac_prox.Enabled = True
    Me.txt_total_vac_prox.SetFocus
Else
    Me.txt_ocu_vac.SetFocus
End If
End Sub

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

Private Sub txt_total_vac_KeyPress(KeyAscii As Integer)
'Dim limite As Integer
'limite = Val(Me.txt_dis_vac.Text) - Val(Me.txt_ocu_vac.Text)
If KeyAscii = 13 And Len(Trim(Me.txt_total_vac.Text)) <> 0 And Val(Me.txt_total_vac) >= Val(Me.txt_ocu_vac) Then
    Me.txt_dis_vac.Text = Val(Me.txt_total_vac.Text) - Val(Me.txt_ocu_vac.Text)
    Me.txt_total_vac_prox.Enabled = True
    Me.txt_total_vac_prox.SetFocus
Else
    Me.txt_total_vac.SetFocus
End If
End Sub

Private Sub txt_total_vac_prox_KeyPress(KeyAscii As Integer)
'Dim limite As Integer
'limite = Val(Me.txt_dis_vac_prox.Text) - Val(Me.txt_ocu_vac_prox.Text)
If KeyAscii = 13 And Len(Trim(Me.txt_total_vac_prox.Text)) <> 0 And Val(Me.txt_total_vac_prox) >= Val(Me.txt_ocu_vac_prox) Then
    Me.txt_dis_vac_prox.Text = Val(Me.txt_total_vac_prox.Text) - Val(Me.txt_ocu_vac_prox.Text)
    Call Btn_vac_aceptar_Click
Else
    Me.txt_total_vac_prox.SetFocus
End If

End Sub

Private Sub txt_total_vac_prox_LostFocus()
If Me.txt_total_vac_prox < Me.txt_ocu_vac_prox.Text Then
    MsgBox ("-Total Vacantes próximo año- no puede ser menor que el número " & Chr(13) & "de -Vacantes Ocupadas próximo año-")
    Me.txt_total_vac_prox = Me.txt_ocu_vac_prox.Text
    Me.txt_total_vac_prox.SetFocus
End If
End Sub

