VERSION 5.00
Object = "{BDC217C8-ED16-11CD-956C-0000C04E4C0A}#1.1#0"; "TABCTL32.OCX"
Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.2#0"; "MSCOMCTL.OCX"
Begin VB.Form Form_man_tab 
   BorderStyle     =   1  'Fixed Single
   Caption         =   " "
   ClientHeight    =   10680
   ClientLeft      =   975
   ClientTop       =   900
   ClientWidth     =   17205
   ForeColor       =   &H00000000&
   Icon            =   "Form_man_tab.frx":0000
   KeyPreview      =   -1  'True
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MDIChild        =   -1  'True
   MinButton       =   0   'False
   Moveable        =   0   'False
   ScaleHeight     =   10680
   ScaleWidth      =   17205
   Visible         =   0   'False
   Begin VB.Frame FRAME_SAL 
      ForeColor       =   &H00FF0000&
      Height          =   2655
      Left            =   120
      TabIndex        =   83
      Top             =   5760
      Visible         =   0   'False
      Width           =   7875
      Begin VB.TextBox txt_num_mes 
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   315
         Left            =   3660
         MaxLength       =   2
         TabIndex        =   150
         Top             =   1440
         Width           =   615
      End
      Begin VB.TextBox txt_num_sill 
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   285
         Left            =   3660
         MaxLength       =   2
         TabIndex        =   149
         Top             =   1800
         Width           =   615
      End
      Begin VB.CommandButton Btn_Sal_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            =   6420
         TabIndex        =   89
         Top             =   1320
         Width           =   1215
      End
      Begin VB.CommandButton Btn_Sal_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            =   6420
         TabIndex        =   88
         Top             =   840
         Width           =   1215
      End
      Begin VB.CommandButton Btn_Sal_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            =   6420
         TabIndex        =   87
         Top             =   360
         Width           =   1215
      End
      Begin VB.TextBox txt_cap_sal 
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   285
         Left            =   3660
         MaxLength       =   2
         TabIndex        =   86
         Top             =   1080
         Width           =   615
      End
      Begin VB.TextBox txt_pis_sal 
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   285
         Left            =   3660
         MaxLength       =   1
         TabIndex        =   85
         Top             =   720
         Width           =   615
      End
      Begin VB.TextBox txt_num_sal 
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   285
         Left            =   3660
         MaxLength       =   3
         TabIndex        =   84
         Top             =   360
         Width           =   615
      End
      Begin VB.Label Label40 
         Caption         =   "Número Mesas"
         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        =   152
         Top             =   1440
         Width           =   1095
      End
      Begin VB.Label Label39 
         Caption         =   "Número Sillas"
         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        =   151
         Top             =   1800
         Width           =   1335
      End
      Begin VB.Image Image2 
         Height          =   2130
         Left            =   120
         Picture         =   "Form_man_tab.frx":2A8B2
         Top             =   240
         Width           =   1815
      End
      Begin VB.Label Label19 
         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        =   148
         Top             =   2280
         Width           =   5535
      End
      Begin VB.Label lbl_cap_sal 
         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            =   2160
         TabIndex        =   92
         Top             =   1080
         Width           =   1335
      End
      Begin VB.Label lbl_pis_sal 
         Caption         =   "Piso"
         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        =   91
         Top             =   720
         Width           =   1095
      End
      Begin VB.Label lbl_num_sal 
         Caption         =   "Sala 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        =   90
         Top             =   360
         Width           =   1335
      End
   End
   Begin VB.Frame frame_pro 
      ForeColor       =   &H00FF0000&
      Height          =   4155
      Left            =   120
      TabIndex        =   99
      Top             =   6480
      Visible         =   0   'False
      Width           =   8955
      Begin VB.ComboBox cmb_perfiles 
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   330
         Left            =   3780
         TabIndex        =   174
         Top             =   3240
         Width           =   3255
      End
      Begin VB.ComboBox cmb_ciu_pro 
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   330
         Left            =   5640
         Style           =   1  'Simple Combo
         TabIndex        =   163
         Text            =   "cmb_ciu_pro"
         Top             =   2160
         Width           =   1335
      End
      Begin VB.ListBox lst_ape_pro 
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   1110
         Left            =   3780
         TabIndex        =   58
         Top             =   600
         Visible         =   0   'False
         Width           =   3255
      End
      Begin VB.TextBox txt_ape2_pro 
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   285
         Left            =   3780
         MaxLength       =   30
         TabIndex        =   155
         Top             =   720
         Width           =   3255
      End
      Begin VB.ComboBox cmb_comuna_pro 
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   330
         Left            =   3780
         TabIndex        =   147
         Top             =   2160
         Width           =   1815
      End
      Begin VB.TextBox txt_dir_pro 
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   285
         Left            =   3780
         MaxLength       =   40
         TabIndex        =   146
         Top             =   1800
         Width           =   3255
      End
      Begin VB.TextBox txt_fon_pro 
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   285
         Left            =   3780
         MaxLength       =   10
         TabIndex        =   145
         Top             =   2520
         Width           =   1455
      End
      Begin VB.TextBox txt_hor_ate_pro 
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   285
         Left            =   3780
         MaxLength       =   30
         TabIndex        =   144
         Top             =   2880
         Width           =   3255
      End
      Begin VB.TextBox txt_dig_pro 
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   285
         Left            =   4920
         MaxLength       =   1
         TabIndex        =   112
         Top             =   1440
         Width           =   255
      End
      Begin VB.TextBox txt_rut_pro 
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   285
         Left            =   3780
         MaxLength       =   8
         TabIndex        =   60
         Top             =   1440
         Width           =   1095
      End
      Begin VB.TextBox txt_ape_pro 
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   285
         Left            =   3780
         MaxLength       =   30
         TabIndex        =   57
         Top             =   360
         Width           =   3255
      End
      Begin VB.CommandButton btn_ace_pro 
         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            =   7500
         TabIndex        =   61
         Top             =   360
         Width           =   1215
      End
      Begin VB.CommandButton btn_eli_pro 
         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            =   7500
         TabIndex        =   62
         Top             =   840
         Width           =   1215
      End
      Begin VB.CommandButton btn_can_pro 
         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            =   7500
         TabIndex        =   63
         Top             =   1320
         Width           =   1215
      End
      Begin VB.TextBox txt_nom_pro 
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   285
         Left            =   3780
         MaxLength       =   30
         TabIndex        =   59
         Top             =   1080
         Width           =   3255
      End
      Begin VB.Label Label8 
         Caption         =   "Perfil"
         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        =   173
         Top             =   3240
         Width           =   1215
      End
      Begin VB.Label Label42 
         Caption         =   "Apellido Materno"
         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        =   156
         Top             =   720
         Width           =   1335
      End
      Begin VB.Image Image10 
         Height          =   2130
         Left            =   120
         Picture         =   "Form_man_tab.frx":317C5
         Top             =   240
         Width           =   1815
      End
      Begin VB.Label Label38 
         Caption         =   "Teléfono"
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   255
         Left            =   2220
         TabIndex        =   143
         Top             =   2520
         Width           =   1335
      End
      Begin VB.Label Label37 
         Caption         =   "Dirección"
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   255
         Left            =   2220
         TabIndex        =   142
         Top             =   1800
         Width           =   1335
      End
      Begin VB.Label Label36 
         Caption         =   "Comuna"
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   255
         Left            =   2220
         TabIndex        =   141
         Top             =   2160
         Width           =   1335
      End
      Begin VB.Label Label17 
         Caption         =   "Horario de Atenció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        =   140
         Top             =   2880
         Width           =   1575
      End
      Begin VB.Label Label18 
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   255
         Left            =   2220
         TabIndex        =   109
         Top             =   3720
         Width           =   4935
      End
      Begin VB.Label lbl_rut_PRO 
         Caption         =   "Rut"
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   255
         Left            =   2220
         TabIndex        =   102
         Top             =   1440
         Width           =   1335
      End
      Begin VB.Label lbl_nom_PRO 
         Caption         =   "Nombres"
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   255
         Left            =   2220
         TabIndex        =   101
         Top             =   1080
         Width           =   1095
      End
      Begin VB.Label lbl_ape_PRO 
         Caption         =   "Apellido Paterno"
         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        =   100
         Top             =   360
         Width           =   1335
      End
   End
   Begin VB.Frame Frame_cur 
      ForeColor       =   &H00FF0000&
      Height          =   4095
      Left            =   120
      TabIndex        =   113
      Top             =   120
      Visible         =   0   'False
      Width           =   8835
      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            =   3720
         TabIndex        =   171
         Top             =   360
         Width           =   975
      End
      Begin VB.TextBox txt_vac_cur 
         BeginProperty DataFormat 
            Type            =   1
            Format          =   "0"
            HaveTrueFalseNull=   0
            FirstDayOfWeek  =   0
            FirstWeekOfYear =   0
            LCID            =   3082
            SubFormatType   =   1
         EndProperty
         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            =   3720
         MaxLength       =   2
         TabIndex        =   161
         Top             =   3360
         Width           =   375
      End
      Begin VB.TextBox txt_alu_vac 
         BeginProperty DataFormat 
            Type            =   1
            Format          =   "0"
            HaveTrueFalseNull=   0
            FirstDayOfWeek  =   0
            FirstWeekOfYear =   0
            LCID            =   3082
            SubFormatType   =   1
         EndProperty
         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            =   6480
         MaxLength       =   2
         TabIndex        =   159
         Top             =   2760
         Width           =   615
      End
      Begin VB.TextBox txt_vac_ini 
         BeginProperty DataFormat 
            Type            =   1
            Format          =   "0"
            HaveTrueFalseNull=   0
            FirstDayOfWeek  =   0
            FirstWeekOfYear =   0
            LCID            =   3082
            SubFormatType   =   1
         EndProperty
         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            =   3720
         MaxLength       =   2
         TabIndex        =   157
         Top             =   2760
         Width           =   375
      End
      Begin VB.ComboBox cmb_cap_sala 
         Enabled         =   0   'False
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   330
         ItemData        =   "Form_man_tab.frx":38A9A
         Left            =   6480
         List            =   "Form_man_tab.frx":38A9C
         Style           =   1  'Simple Combo
         TabIndex        =   154
         Top             =   2400
         Width           =   615
      End
      Begin VB.ComboBox Cmb_num_gra_cur 
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   330
         Left            =   3720
         TabIndex        =   129
         Top             =   1080
         Width           =   735
      End
      Begin VB.ComboBox cmb_numsal_cur 
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   330
         ItemData        =   "Form_man_tab.frx":38A9E
         Left            =   3720
         List            =   "Form_man_tab.frx":38AA0
         TabIndex        =   128
         Top             =   2400
         Width           =   855
      End
      Begin VB.ComboBox Cmb_jor_cur 
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   330
         ItemData        =   "Form_man_tab.frx":38AA2
         Left            =   3720
         List            =   "Form_man_tab.frx":38AA4
         TabIndex        =   127
         Top             =   1440
         Width           =   2175
      End
      Begin VB.ComboBox Cmb_prof_cur 
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   330
         Left            =   3720
         TabIndex        =   125
         Top             =   1800
         Width           =   3375
      End
      Begin VB.ComboBox Cmb_mod_cur 
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   330
         Left            =   3720
         TabIndex        =   124
         Top             =   720
         Width           =   2175
      End
      Begin VB.TextBox txt_let_cur 
         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
         MaxLength       =   1
         TabIndex        =   117
         Top             =   1080
         Width           =   375
      End
      Begin VB.CommandButton Btn_Ace_cur 
         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            =   7380
         TabIndex        =   116
         Top             =   360
         Width           =   1215
      End
      Begin VB.CommandButton Btn_can_cur 
         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            =   7380
         TabIndex        =   115
         Top             =   1320
         Width           =   1215
      End
      Begin VB.CommandButton Btn_eli_cur 
         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            =   7380
         TabIndex        =   114
         Top             =   840
         Width           =   1215
      End
      Begin VB.Label Label6 
         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            =   2220
         TabIndex        =   172
         Top             =   360
         Width           =   375
      End
      Begin VB.Line Line1 
         BorderColor     =   &H8000000C&
         X1              =   2160
         X2              =   7200
         Y1              =   3120
         Y2              =   3120
      End
      Begin VB.Label Label32 
         Caption         =   "Vacantes Actual"
         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        =   162
         Top             =   3360
         Width           =   1395
      End
      Begin VB.Label Label44 
         Caption         =   "Alumnos en curso"
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   255
         Left            =   4920
         TabIndex        =   160
         Top             =   2760
         Width           =   1395
      End
      Begin VB.Label Label43 
         Caption         =   "Vacantes Inicial"
         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        =   158
         Top             =   2760
         Width           =   1395
      End
      Begin VB.Label Label41 
         Caption         =   "Capacidad Sala"
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   255
         Left            =   4920
         TabIndex        =   153
         Top             =   2400
         Width           =   1215
      End
      Begin VB.Image Image9 
         Height          =   2130
         Left            =   120
         Picture         =   "Form_man_tab.frx":38AA6
         Top             =   240
         Width           =   1815
      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            =   2220
         TabIndex        =   126
         Top             =   1440
         Width           =   1215
      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            =   2220
         TabIndex        =   123
         Top             =   1080
         Width           =   1215
      End
      Begin VB.Label Label29 
         Caption         =   "Nº de Sala"
         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        =   122
         Top             =   2400
         Width           =   1455
      End
      Begin VB.Label Label28 
         Caption         =   "Letra"
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   255
         Left            =   4740
         TabIndex        =   121
         Top             =   1080
         Width           =   495
      End
      Begin VB.Label Label27 
         Caption         =   "Profesor Jefe"
         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        =   120
         Top             =   1800
         Width           =   1215
      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            =   2220
         TabIndex        =   119
         Top             =   720
         Width           =   1455
      End
      Begin VB.Label Label25 
         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        =   118
         Top             =   3720
         Width           =   5235
      End
      Begin VB.Line Line5 
         BorderColor     =   &H8000000C&
         X1              =   2160
         X2              =   7200
         Y1              =   2280
         Y2              =   2280
      End
   End
   Begin VB.Frame Frame_Modalidades 
      ForeColor       =   &H00FF0000&
      Height          =   2535
      Left            =   120
      TabIndex        =   77
      Top             =   7680
      Visible         =   0   'False
      Width           =   7875
      Begin VB.ListBox lst_des_mod 
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   690
         Left            =   3720
         TabIndex        =   66
         Top             =   600
         Visible         =   0   'False
         Width           =   2295
      End
      Begin VB.TextBox Txt_Num_Gra_Max 
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   285
         Left            =   3720
         MaxLength       =   1
         TabIndex        =   70
         Top             =   1080
         Width           =   495
      End
      Begin VB.TextBox Txt_cod_mod 
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   285
         Left            =   3720
         MaxLength       =   3
         TabIndex        =   65
         Top             =   720
         Width           =   495
      End
      Begin VB.TextBox txt_des_mod 
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   285
         Left            =   3720
         MaxLength       =   50
         TabIndex        =   64
         Top             =   360
         Width           =   2295
      End
      Begin VB.CommandButton Btn_ace_mod 
         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            =   6420
         TabIndex        =   67
         Top             =   360
         Width           =   1215
      End
      Begin VB.CommandButton Btn_can_mod 
         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            =   6420
         TabIndex        =   69
         Top             =   1320
         Width           =   1215
      End
      Begin VB.CommandButton Btn_eli_mod 
         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            =   6420
         TabIndex        =   68
         Top             =   840
         Width           =   1215
      End
      Begin VB.Image Image1 
         Height          =   2130
         Left            =   120
         Picture         =   "Form_man_tab.frx":3FD65
         Top             =   240
         Width           =   1815
      End
      Begin VB.Label Label21 
         Caption         =   "Nº Grado Máximo"
         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        =   111
         Top             =   1080
         Width           =   1455
      End
      Begin VB.Label Label16 
         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        =   108
         Top             =   2160
         Width           =   5475
      End
      Begin VB.Label Label1 
         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        =   79
         Top             =   720
         Width           =   1215
      End
      Begin VB.Label Label2 
         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        =   78
         Top             =   360
         Width           =   1215
      End
   End
   Begin VB.Frame Frame_Usuarios 
      ForeColor       =   &H00FF0000&
      Height          =   5595
      Left            =   8400
      TabIndex        =   75
      Top             =   3240
      Visible         =   0   'False
      Width           =   6255
      Begin TabDlg.SSTab SSTab1 
         Height          =   2775
         Left            =   120
         TabIndex        =   10
         Top             =   240
         Width           =   6015
         _ExtentX        =   10610
         _ExtentY        =   4895
         _Version        =   393216
         Tabs            =   2
         Tab             =   1
         TabHeight       =   520
         BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         TabCaption(0)   =   "Perfiles"
         TabPicture(0)   =   "Form_man_tab.frx":47E68
         Tab(0).ControlEnabled=   0   'False
         Tab(0).Control(0)=   "Label3"
         Tab(0).Control(1)=   "Label5"
         Tab(0).Control(2)=   "TxtNomPer"
         Tab(0).Control(3)=   "Check_Perm(0)"
         Tab(0).Control(4)=   "Check_Perm(1)"
         Tab(0).Control(5)=   "Check_Perm(2)"
         Tab(0).Control(6)=   "LstPer"
         Tab(0).Control(7)=   "BtnAcePer"
         Tab(0).Control(8)=   "BtnCanPer"
         Tab(0).Control(9)=   "BtnEliPer"
         Tab(0).Control(10)=   "TxtCodPer"
         Tab(0).ControlCount=   11
         TabCaption(1)   =   "Usuarios"
         TabPicture(1)   =   "Form_man_tab.frx":47E84
         Tab(1).ControlEnabled=   -1  'True
         Tab(1).Control(0)=   "LbComCom"
         Tab(1).Control(0).Enabled=   0   'False
         Tab(1).Control(1)=   "LbUsu"
         Tab(1).Control(1).Enabled=   0   'False
         Tab(1).Control(2)=   "LbPass"
         Tab(1).Control(2).Enabled=   0   'False
         Tab(1).Control(3)=   "LbPer"
         Tab(1).Control(3).Enabled=   0   'False
         Tab(1).Control(4)=   "LbCargo"
         Tab(1).Control(4).Enabled=   0   'False
         Tab(1).Control(5)=   "Txt_Usu_Desc"
         Tab(1).Control(5).Enabled=   0   'False
         Tab(1).Control(6)=   "Txt_Usu_Cod"
         Tab(1).Control(6).Enabled=   0   'False
         Tab(1).Control(7)=   "Txt_Usu_Cargo"
         Tab(1).Control(7).Enabled=   0   'False
         Tab(1).Control(8)=   "Txt_Usu_Pas"
         Tab(1).Control(8).Enabled=   0   'False
         Tab(1).Control(9)=   "CmdPer"
         Tab(1).Control(9).Enabled=   0   'False
         Tab(1).Control(10)=   "lst_usu_desc"
         Tab(1).Control(10).Enabled=   0   'False
         Tab(1).Control(11)=   "Btn_Usu_Aceptar"
         Tab(1).Control(11).Enabled=   0   'False
         Tab(1).Control(12)=   "Btn_Usu_Cancelar"
         Tab(1).Control(12).Enabled=   0   'False
         Tab(1).Control(13)=   "Btn_Usu_Eliminar"
         Tab(1).Control(13).Enabled=   0   'False
         Tab(1).Control(14)=   "BtnRstPriv"
         Tab(1).Control(14).Enabled=   0   'False
         Tab(1).ControlCount=   15
         Begin VB.CommandButton BtnRstPriv 
            Caption         =   "Restablecer"
            BeginProperty Font 
               Name            =   "Arial"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   375
            Left            =   4560
            TabIndex        =   22
            Top             =   2040
            Width           =   1215
         End
         Begin VB.TextBox TxtCodPer 
            BeginProperty Font 
               Name            =   "Arial"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   315
            Left            =   -73320
            Locked          =   -1  'True
            MaxLength       =   30
            TabIndex        =   1
            Top             =   600
            Width           =   1095
         End
         Begin VB.CommandButton BtnEliPer 
            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            =   -70440
            TabIndex        =   8
            Top             =   1080
            Width           =   1215
         End
         Begin VB.CommandButton BtnCanPer 
            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            =   -70440
            TabIndex        =   9
            Top             =   1560
            Width           =   1215
         End
         Begin VB.CommandButton BtnAcePer 
            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            =   -70440
            TabIndex        =   7
            Top             =   600
            Width           =   1215
         End
         Begin VB.CommandButton Btn_Usu_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            =   4560
            TabIndex        =   20
            Top             =   1080
            Width           =   1215
         End
         Begin VB.CommandButton Btn_Usu_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            =   4560
            TabIndex        =   21
            Top             =   1560
            Width           =   1215
         End
         Begin VB.CommandButton Btn_Usu_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            =   4560
            TabIndex        =   19
            Top             =   600
            Width           =   1215
         End
         Begin VB.ListBox LstPer 
            BeginProperty Font 
               Name            =   "Arial"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   690
            Left            =   -73320
            TabIndex        =   3
            Top             =   1320
            Visible         =   0   'False
            Width           =   2655
         End
         Begin VB.CheckBox Check_Perm 
            Alignment       =   1  'Right Justify
            Caption         =   "Borrar"
            BeginProperty Font 
               Name            =   "Arial"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   255
            Index           =   2
            Left            =   -74760
            TabIndex        =   6
            Top             =   2040
            Width           =   1695
         End
         Begin VB.CheckBox Check_Perm 
            Alignment       =   1  'Right Justify
            Caption         =   "Modificar"
            BeginProperty Font 
               Name            =   "Arial"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   255
            Index           =   1
            Left            =   -74760
            TabIndex        =   5
            Top             =   1680
            Width           =   1695
         End
         Begin VB.CheckBox Check_Perm 
            Alignment       =   1  'Right Justify
            Caption         =   "Agregar"
            BeginProperty Font 
               Name            =   "Arial"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   255
            Index           =   0
            Left            =   -74760
            TabIndex        =   4
            Top             =   1320
            Width           =   1695
         End
         Begin VB.ListBox lst_usu_desc 
            BeginProperty Font 
               Name            =   "Arial"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   690
            Left            =   1680
            TabIndex        =   16
            Top             =   840
            Visible         =   0   'False
            Width           =   2655
         End
         Begin VB.ComboBox CmdPer 
            BeginProperty Font 
               Name            =   "Arial"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   330
            Left            =   1680
            TabIndex        =   15
            Top             =   2040
            Width           =   2655
         End
         Begin VB.TextBox Txt_Usu_Pas 
            BeginProperty Font 
               Name            =   "Arial"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   -1  'True
               Strikethrough   =   0   'False
            EndProperty
            Height          =   315
            Left            =   1680
            MaxLength       =   10
            TabIndex        =   13
            Top             =   1380
            Width           =   2655
         End
         Begin VB.TextBox Txt_Usu_Cargo 
            BeginProperty Font 
               Name            =   "Arial"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   315
            Left            =   1680
            MaxLength       =   30
            TabIndex        =   14
            Top             =   1740
            Width           =   2655
         End
         Begin VB.TextBox Txt_Usu_Cod 
            BeginProperty Font 
               Name            =   "Arial"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   315
            Left            =   1680
            MaxLength       =   10
            TabIndex        =   12
            Top             =   1020
            Width           =   2655
         End
         Begin VB.TextBox Txt_Usu_Desc 
            BeginProperty Font 
               Name            =   "Arial"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   315
            Left            =   1680
            MaxLength       =   30
            TabIndex        =   11
            Top             =   600
            Width           =   2655
         End
         Begin VB.TextBox TxtNomPer 
            BeginProperty Font 
               Name            =   "Arial"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   315
            Left            =   -73320
            MaxLength       =   30
            TabIndex        =   2
            Top             =   960
            Width           =   2655
         End
         Begin VB.Label Label5 
            Caption         =   "Cod. Perfil"
            BeginProperty Font 
               Name            =   "Arial"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   255
            Left            =   -74760
            TabIndex        =   170
            Top             =   600
            Width           =   1395
         End
         Begin VB.Label LbCargo 
            Caption         =   "Cargo"
            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        =   169
            Top             =   1680
            Width           =   615
         End
         Begin VB.Label LbPer 
            Caption         =   "Perfil"
            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        =   168
            Top             =   2040
            Width           =   495
         End
         Begin VB.Label LbPass 
            Caption         =   "Password"
            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        =   167
            Top             =   1320
            Width           =   855
         End
         Begin VB.Label LbUsu 
            Caption         =   "Usuario"
            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        =   166
            Top             =   960
            Width           =   735
         End
         Begin VB.Label LbComCom 
            Caption         =   "Nombre Completo"
            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        =   165
            Top             =   600
            Width           =   1395
         End
         Begin VB.Label Label3 
            Caption         =   "Nombre Perfil"
            BeginProperty Font 
               Name            =   "Arial"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   255
            Left            =   -74760
            TabIndex        =   164
            Top             =   960
            Width           =   1395
         End
      End
      Begin MSComctlLib.TreeView Trv_Menu 
         DragIcon        =   "Form_man_tab.frx":47EA0
         Height          =   1995
         Left            =   120
         TabIndex        =   18
         Top             =   3120
         Width           =   6015
         _ExtentX        =   10610
         _ExtentY        =   3519
         _Version        =   393217
         LineStyle       =   1
         Style           =   7
         Checkboxes      =   -1  'True
         BorderStyle     =   1
         Appearance      =   1
         BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
      End
      Begin VB.Image Image8 
         Height          =   2010
         Left            =   180
         Picture         =   "Form_man_tab.frx":481AA
         Stretch         =   -1  'True
         Top             =   240
         Width           =   1785
      End
      Begin VB.Label Label20 
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   255
         Left            =   120
         TabIndex        =   110
         Top             =   5160
         Width           =   5955
      End
      Begin VB.Label Label7 
         Caption         =   "Privilegios"
         Height          =   255
         Left            =   240
         TabIndex        =   76
         Top             =   1920
         Width           =   1455
      End
   End
   Begin VB.Frame frame_acci 
      ForeColor       =   &H00FF0000&
      Height          =   2535
      Left            =   120
      TabIndex        =   93
      Top             =   4440
      Visible         =   0   'False
      Width           =   7875
      Begin VB.ListBox lst_lug_lug 
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   690
         Left            =   3720
         TabIndex        =   38
         Top             =   960
         Visible         =   0   'False
         Width           =   2175
      End
      Begin VB.CommandButton btn_can_lug 
         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            =   6420
         TabIndex        =   73
         Top             =   1320
         Width           =   1215
      End
      Begin VB.CommandButton btn_eli_lug 
         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            =   6420
         TabIndex        =   72
         Top             =   840
         Width           =   1215
      End
      Begin VB.CommandButton btn_ace_lug 
         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            =   6420
         TabIndex        =   71
         Top             =   360
         Width           =   1215
      End
      Begin VB.TextBox txt_lug_lug 
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   285
         Left            =   3720
         MaxLength       =   20
         TabIndex        =   37
         Top             =   720
         Width           =   2175
      End
      Begin VB.TextBox txt_cod_lug 
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   285
         Left            =   3720
         MaxLength       =   2
         TabIndex        =   36
         Text            =   " "
         Top             =   360
         Width           =   375
      End
      Begin VB.Image Image3 
         Height          =   2130
         Left            =   120
         Picture         =   "Form_man_tab.frx":4AF27
         Top             =   240
         Width           =   1815
      End
      Begin VB.Label Label15 
         BeginProperty Font 
            Name            =   "MS Sans Serif"
            Size            =   8.25
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   -1  'True
            Strikethrough   =   0   'False
         EndProperty
         Height          =   255
         Left            =   2040
         TabIndex        =   107
         Top             =   1920
         Width           =   5595
      End
      Begin VB.Label lbl_lug_acci 
         Caption         =   "Lugar"
         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        =   95
         Top             =   720
         Width           =   1335
      End
      Begin VB.Label lbl_cod_acci 
         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            =   2160
         TabIndex        =   94
         Top             =   360
         Width           =   1455
      End
   End
   Begin VB.Frame frame_com 
      ForeColor       =   &H00FF0000&
      Height          =   2535
      Left            =   120
      TabIndex        =   134
      Top             =   3600
      Visible         =   0   'False
      Width           =   7875
      Begin VB.ListBox lst_com_com 
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   1110
         Left            =   3720
         TabIndex        =   23
         Top             =   720
         Visible         =   0   'False
         Width           =   2415
      End
      Begin VB.CommandButton btn_can_com 
         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            =   6480
         TabIndex        =   29
         Top             =   1320
         Width           =   1215
      End
      Begin VB.CommandButton BTN_ELI_COM 
         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            =   6480
         TabIndex        =   28
         Top             =   840
         Width           =   1215
      End
      Begin VB.CommandButton btn_ace_com 
         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            =   6480
         TabIndex        =   27
         Top             =   360
         Width           =   1215
      End
      Begin VB.TextBox txt_com_com 
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   285
         Left            =   3720
         MaxLength       =   20
         TabIndex        =   17
         Top             =   480
         Width           =   2295
      End
      Begin VB.TextBox txt_pro_com 
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   285
         Left            =   3720
         MaxLength       =   17
         TabIndex        =   24
         Top             =   840
         Width           =   2415
      End
      Begin VB.TextBox txt_reg_com 
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   285
         Left            =   3720
         MaxLength       =   50
         TabIndex        =   25
         Top             =   1200
         Width           =   2415
      End
      Begin VB.TextBox txt_cod_com 
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   285
         Left            =   3720
         MaxLength       =   5
         TabIndex        =   26
         Text            =   " "
         Top             =   1560
         Width           =   615
      End
      Begin VB.Image Image7 
         Height          =   2130
         Left            =   120
         Picture         =   "Form_man_tab.frx":53448
         Top             =   240
         Width           =   1815
      End
      Begin VB.Label lbl_com_com 
         Caption         =   "Comuna"
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   255
         Left            =   2280
         TabIndex        =   139
         Top             =   480
         Width           =   735
      End
      Begin VB.Label lbl_pro_com 
         Caption         =   "Provincia"
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   375
         Left            =   2280
         TabIndex        =   138
         Top             =   840
         Width           =   855
      End
      Begin VB.Label lbl_cod_com 
         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        =   137
         Top             =   1560
         Width           =   735
      End
      Begin VB.Label lbll_reg_com 
         Caption         =   "Regió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        =   136
         Top             =   1200
         Width           =   855
      End
      Begin VB.Label Label23 
         BeginProperty Font 
            Name            =   "MS Sans Serif"
            Size            =   8.25
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   -1  'True
            Strikethrough   =   0   'False
         EndProperty
         Height          =   255
         Left            =   2160
         TabIndex        =   135
         Top             =   2040
         Width           =   5415
      End
   End
   Begin VB.Frame Frame_Tip_Deu 
      Caption         =   "Tipos de Deuda"
      BeginProperty Font 
         Name            =   "Arial"
         Size            =   8.25
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H00C00000&
      Height          =   2055
      Left            =   8160
      TabIndex        =   80
      Top             =   120
      Visible         =   0   'False
      Width           =   6135
      Begin VB.ListBox lst_des_deu 
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   690
         Left            =   1800
         TabIndex        =   47
         Top             =   1080
         Visible         =   0   'False
         Width           =   2415
      End
      Begin VB.CommandButton Btn_Deu_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            =   4680
         TabIndex        =   49
         Top             =   840
         Width           =   1215
      End
      Begin VB.CommandButton Btn_Deu_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            =   4680
         TabIndex        =   50
         Top             =   1320
         Width           =   1215
      End
      Begin VB.CommandButton Btn_Deu_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            =   4680
         TabIndex        =   48
         Top             =   360
         Width           =   1215
      End
      Begin VB.TextBox Txt_Des_deu 
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   285
         Left            =   1800
         MaxLength       =   15
         TabIndex        =   46
         Top             =   840
         Width           =   2415
      End
      Begin VB.TextBox Txt_cod_deu 
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   285
         Left            =   1800
         MaxLength       =   2
         TabIndex        =   45
         Top             =   480
         Width           =   495
      End
      Begin VB.Label Label14 
         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        =   106
         Top             =   1680
         Width           =   3495
      End
      Begin VB.Label Label9 
         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            =   240
         TabIndex        =   82
         Top             =   840
         Width           =   1215
      End
      Begin VB.Label Label10 
         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            =   240
         TabIndex        =   81
         Top             =   480
         Width           =   1215
      End
   End
   Begin VB.Frame Frame_conv 
      ForeColor       =   &H00FF0000&
      Height          =   2535
      Left            =   120
      TabIndex        =   130
      Top             =   2520
      Visible         =   0   'False
      Width           =   7875
      Begin VB.ListBox Lst_conv 
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   480
         Left            =   3720
         TabIndex        =   32
         Top             =   960
         Visible         =   0   'False
         Width           =   2175
      End
      Begin VB.TextBox Txt_cod_Conv 
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   285
         Left            =   3720
         MaxLength       =   2
         TabIndex        =   30
         Top             =   360
         Width           =   375
      End
      Begin VB.TextBox Txt_Des_Conv 
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   285
         Left            =   3720
         MaxLength       =   30
         TabIndex        =   31
         Top             =   720
         Width           =   2175
      End
      Begin VB.CommandButton Btn_Ace_conv 
         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            =   6420
         TabIndex        =   33
         Top             =   360
         Width           =   1215
      End
      Begin VB.CommandButton Btn_Can_Conv 
         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            =   6420
         TabIndex        =   35
         Top             =   1320
         Width           =   1215
      End
      Begin VB.CommandButton Btn_Eli_conv 
         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            =   6420
         TabIndex        =   34
         Top             =   840
         Width           =   1215
      End
      Begin VB.Image Image4 
         Height          =   2130
         Left            =   120
         Picture         =   "Form_man_tab.frx":5A61B
         Top             =   240
         Width           =   1815
      End
      Begin VB.Label Label33 
         BeginProperty Font 
            Name            =   "MS Sans Serif"
            Size            =   8.25
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   -1  'True
            Strikethrough   =   0   'False
         EndProperty
         Height          =   255
         Left            =   1980
         TabIndex        =   133
         Top             =   1920
         Width           =   5655
      End
      Begin VB.Label Label34 
         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            =   2160
         TabIndex        =   132
         Top             =   360
         Width           =   1215
      End
      Begin VB.Label Label35 
         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        =   131
         Top             =   720
         Width           =   1215
      End
   End
   Begin VB.Frame Frame_Tip_Apo 
      ForeColor       =   &H00FF0000&
      Height          =   2535
      Left            =   120
      TabIndex        =   0
      Top             =   1680
      Visible         =   0   'False
      Width           =   7875
      Begin VB.ListBox Lst_des_tipoapo 
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   690
         Left            =   3720
         TabIndex        =   41
         Top             =   960
         Visible         =   0   'False
         Width           =   2175
      End
      Begin VB.TextBox Txt_des_tipoapo 
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   285
         Left            =   3720
         MaxLength       =   10
         TabIndex        =   40
         Top             =   720
         Width           =   2175
      End
      Begin VB.TextBox Txt_cod_TipoApo 
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   285
         Left            =   3720
         MaxLength       =   1
         TabIndex        =   39
         Top             =   360
         Width           =   375
      End
      Begin VB.CommandButton Btn_Tip_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            =   6420
         TabIndex        =   43
         Top             =   840
         Width           =   1215
      End
      Begin VB.CommandButton Btn_Tip_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            =   6420
         TabIndex        =   44
         Top             =   1320
         Width           =   1215
      End
      Begin VB.CommandButton Btn_Tip_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            =   6420
         TabIndex        =   42
         Top             =   360
         Width           =   1215
      End
      Begin VB.Image Image5 
         Height          =   2130
         Left            =   120
         Picture         =   "Form_man_tab.frx":62B7C
         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        =   104
         Top             =   2040
         Width           =   5415
      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        =   103
         Top             =   720
         Width           =   1215
      End
      Begin VB.Label Label4 
         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            =   2160
         TabIndex        =   74
         Top             =   360
         Width           =   1215
      End
   End
   Begin VB.Frame frame_mov 
      ForeColor       =   &H00FF0000&
      Height          =   2535
      Left            =   120
      TabIndex        =   96
      Top             =   960
      Visible         =   0   'False
      Width           =   7875
      Begin VB.ListBox lst_des_mov 
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   690
         Left            =   3720
         TabIndex        =   53
         Top             =   960
         Visible         =   0   'False
         Width           =   2055
      End
      Begin VB.CommandButton btn_can_mov 
         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            =   6420
         TabIndex        =   56
         Top             =   1320
         Width           =   1215
      End
      Begin VB.CommandButton btn_eli_mov 
         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            =   6420
         TabIndex        =   55
         Top             =   840
         Width           =   1215
      End
      Begin VB.CommandButton btn_ace_mov 
         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            =   6420
         TabIndex        =   54
         Top             =   360
         Width           =   1215
      End
      Begin VB.TextBox txt_des_mov 
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   285
         Left            =   3720
         MaxLength       =   20
         TabIndex        =   52
         Top             =   720
         Width           =   2055
      End
      Begin VB.TextBox txt_cod_mov 
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   285
         Left            =   3720
         MaxLength       =   2
         TabIndex        =   51
         Text            =   "  "
         Top             =   360
         Width           =   375
      End
      Begin VB.Image Image6 
         Height          =   2130
         Left            =   120
         Picture         =   "Form_man_tab.frx":6ACEE
         Top             =   240
         Width           =   1815
      End
      Begin VB.Label lbl_cod_mov 
         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            =   2160
         TabIndex        =   97
         Top             =   360
         Width           =   1335
      End
      Begin VB.Label lbl_des_mov 
         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        =   98
         Top             =   720
         Width           =   1335
      End
      Begin VB.Label Label13 
         BeginProperty Font 
            Name            =   "MS Sans Serif"
            Size            =   8.25
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   -1  'True
            Strikethrough   =   0   'False
         EndProperty
         Height          =   255
         Left            =   2160
         TabIndex        =   105
         Top             =   2040
         Width           =   5595
      End
   End
End
Attribute VB_Name = "Form_man_tab"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim Indi As Integer
Dim OCUPADOS As Integer
Dim alumnosensala As Integer
Dim cursoensala, TextoRS As String

Private Sub BtnAcePer_Click()

    Dim Cuenta, cod, codigofinal, a, descripcion, Privilegios, Permisos As String
    'Cuenta = TxtCodPer.Text
    Dim e As Long
    descripcion = TxtNomPer.Text
    Password = "#P#" 'Txt_Usu_Pas.Text"
    cargo = "" 'Txt_Usu_Cargo.Text
    
    '********************************************
    Privilegios = "#"
    For i = 1 To Me.Trv_Menu.Nodes.count
        'Privilegios = Privilegios + IIf(Me.Trv_Menu.Nodes.Item(i).Checked, "1", "0")
        nom_control = Trv_Menu.Nodes.Item(i).Text
        opcion_control = "&" & Trv_Menu.Nodes.Item(i).Text
       
        'BUSCAR EL NOMBRE DEL CONTROL CON EL CAPTION
        For e = 0 To Form_main.Controls.count - 1
        aux2 = Form_main.Controls.Item(e).Name
        If TypeOf Form_main.Controls.Item(e) Is Menu Then
            aux3 = Form_main.Controls.Item(e).Caption
            If Form_main.Controls.Item(e).Caption = nom_control Or Form_main.Controls.Item(e).Caption = opcion_control Then
                Control = Form_main.Controls.Item(e).Name
            End If
        End If
        Next
        'FIN BUSCAR
        
        If Me.Trv_Menu.Nodes.Item(i).Checked = True Then
            Privilegios = Privilegios + Control + "|1#"
        Else
            Privilegios = Privilegios + Control + "|0#"
        End If
        
    Next
'*******************************************
    For i = 0 To 2
        Permisos = Permisos + IIf(Me.Check_Perm.Item(i).Value, "1", "0")
    Next
    If Len(Me.TxtNomPer.Text) <> 0 Then
        If Busqueda = 1 And Len(TxtNomPer.Text) <> 0 Then
            rs_Usu.CursorLocation = adUseClient
            rs_Usu.Open "SELECT * FROM usuarios where nombre_completo_usu =" & "'" & descripcion & "'"
            If rs_Usu.RecordCount > 0 Then
                rs_Usu.MoveLast
                rs_Usu.MoveFirst
                Me.TxtCodPer.Text = rs_Usu("aut_nombre_usuario")
                Me.TxtNomPer.Text = rs_Usu("nombre_completo_usu")
                Me.Check_Perm.Item(0).Value = IIf(Left(rs_Usu("Permiso_usu"), 1) = 1, True, False)
                Me.Check_Perm.Item(1).Value = IIf(Mid(rs_Usu("Permiso_usu"), 2, 1) = 1, True, False)
                Me.Check_Perm.Item(2).Value = IIf(Mid(rs_Usu("Permiso_usu"), 3, 1) = 1, True, False)
                Cuenta = rs_Usu("aut_nombre_usuario")
                Me.Label20.Caption = "Editando Registro Existente"
                Me.Btn_Usu_Eliminar.Enabled = True
                Me.lst_usu_desc.Visible = False
                
                Busqueda = 0
                Indi = 0
                Me.TxtNomPer.SetFocus
                SendKeys "{end}"
                rs_Usu.Close
            Else
                rs_Usu.Close
                If MsgBox("El registro no existe. ¿Desea crearlo?", vbYesNo + vbQuestion) = vbYes Then
                    Me.TxtCodPer.Enabled = True
                    Me.TxtCodPer.SetFocus
                    Cuenta = FillconCero(agregacodigo("usuarios", "aut_nombre_usuario", conn), 10)
                    conn.Execute "INSERT INTO usuarios(aut_nombre_usuario, nombre_completo_usu, pas_usu, cargo_usu, priv_usu, Permiso_usu) values(" & "'" & Cuenta & "'" & "," & "'" & descripcion & "'" & "," & "'" & Password & "'" & "," & "'" & cargo & "'" & "," & "'" & Privilegios & "'" & "," & "'" & Permisos & "'" & ")"
                    MsgBox ("Registro Agregado")
                    Me.TxtCodPer = ""
                    Me.TxtNomPer = ""
                    Me.Trv_Menu.Nodes.Clear
                    Me.TxtNomPer.SetFocus
                    Me.Label20.Caption = ""
                    Me.Check_Perm.Item(0).Value = False
                    Me.Check_Perm.Item(1).Value = False
                    Me.Check_Perm.Item(2).Value = False
                Else
                    Me.TxtNomPer.SetFocus
                    SendKeys "{home}+{end}"
                End If
            End If
        ElseIf Len(Me.TxtNomPer.Text) <> 0 Then
            If ingxcodigo = 1 Then
                conn.Execute "INSERT INTO usuarios(aut_nombre_usuario, nombre_completo_usu, pas_usu, cargo_usu, priv_usu, Permiso_usu) values(" & "'" & Cuenta & "'" & "," & "'" & descripcion & "'" & "," & "'" & Password & "'" & "," & "'" & cargo & "'" & "," & "'" & Privilegios & "'" & "," & "'" & Permisos & "'" & ")"
                MsgBox ("Perfil creado exitosamente")
                ingxcodigo = 0
            Else
                Cuenta = Me.TxtCodPer
                a = "UPDATE usuarios Set nombre_completo_usu = " & "'" & descripcion & "'" & ", pas_usu = " & "'" & Password & "'" & ", cargo_usu = " & "'" & cargo & "'" & ", priv_usu = " & "'" & Privilegios & "'" & ", permiso_usu = " & "'" & Permisos & "'" & " where aut_nombre_usuario='" & Cuenta & "'"
                conn.Execute a
                MsgBox ("Perfil modificado exitosamente")
            End If
            Me.TxtCodPer.Enabled = True
            Me.Label20.Caption = ""
            Me.TxtNomPer.Text = ""
            Me.TxtCodPer.Text = ""
            'Me.txt_des_mod.Text = ""
            'Me.Txt_Usu_Pas = ""
            'Me.Txt_Usu_Cargo = ""
            Me.Check_Perm.Item(0).Value = False
            Me.Check_Perm.Item(1).Value = False
            Me.Check_Perm.Item(2).Value = False
            Me.Trv_Menu.Nodes.Clear
            Me.TxtNomPer.SetFocus
            Busqueda = 1
        End If
    Else
        MsgBox ("No deben haber campos vacíos")
    End If
    Me.TxtNomPer.SetFocus
    SSTab1.TabEnabled(1) = True
    Me.Trv_Menu.Nodes.Clear
End Sub

Private Sub BtnCanPer_Click()
Unload Me
End Sub

Private Sub BtnEliPer_Click()
If ExistReg("reg_ope", "aut_nombre_usuario ='" & Me.TxtCodPer & "'", 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 usuarios WHERE aut_nombre_usuario ='" & Me.TxtCodPer & "'"
        Me.TxtCodPer = ""
        Me.TxtNomPer = ""
        Me.CmdPer = ""
        Me.Check_Perm(0).Value = False
        Me.Check_Perm(1).Value = False
        Me.Check_Perm(2).Value = False
        Busqueda = 1
    End If
End If
Me.Trv_Menu.Nodes.Clear
Me.Label20.Caption = ""
Me.TxtNomPer.SetFocus
Me.BtnEliPer.Enabled = False

End Sub

Private Sub BtnRstPriv_Click()
        Me.Trv_Menu.Nodes.Clear
        Crea_Tree_Usu
        
        CuentaCont = 1
        For i = 1 To Form_main.Controls.count - 1
            If TypeOf Form_main.Controls.Item(i) Is Menu Then
                If Left(Form_main.Controls.Item(i).Caption, 1) = "-" Then
                Else
        
                    Me.Trv_Menu.Nodes.Item(CuentaCont).Checked = IIf(Mid(TextoRS, CuentaCont, 1) = 1, True, False)
                    CuentaCont = CuentaCont + 1
                End If
            End If
        Next
End Sub

Private Sub cmb_numsal_cur_Click()
Me.cmb_cap_sala.ListIndex = Me.cmb_numsal_cur.ListIndex
End Sub


Private Sub CmdPer_Click()
If Me.Txt_Usu_Cod <> "" Then
   
        
        Me.Trv_Menu.Nodes.Clear
        Crea_Tree_Usu
        texto = DevuelveCampo("usuarios", "", "priv_usu", "aut_nombre_usuario ='" & Left(CmdPer.Text, 10) & "'", conn)
        
        CuentaCont = 1
        For i = 1 To Form_main.Controls.count - 1
            If TypeOf Form_main.Controls.Item(i) Is Menu Then
                If Left(Form_main.Controls.Item(i).Caption, 1) = "-" Then
                Else
                    ncontrol1 = Form_main.Controls.Item(i).Name
                    MiPos = InStr(1, texto, ncontrol1)
                    If MiPos > 0 Then
                        activ = ""
                        MiPos = InStr(MiPos, texto, "#")
                        MiPos = MiPos - 1
                        activ = Mid(texto, MiPos, MiPos + 1)
                        activ = Left(activ, 1)
                        If activ = 1 Then
                            Me.Trv_Menu.Nodes.Item(CuentaCont).Checked = True
                        End If
                    End If
                    CuentaCont = CuentaCont + 1
                    'Me.Trv_Menu.Nodes.Item(CuentaCont).Checked = IIf(Mid(texto, CuentaCont, 1) = 1, True, False)
                    'CuentaCont = CuentaCont + 1
                End If
            End If
        Next
    End If

End Sub




Private Sub LstPer_Click()
    Dim texto As String, CuentaCont As Integer
    Set rs_Usu = New ADODB.Recordset
    Indi = 0
    Busqueda = 0
    Me.TxtNomPer.Text = Me.LstPer.Text
    a = "SELECT * FROM usuarios where nombre_completo_usu = " & "'" & TxtNomPer & "'" & " order by nombre_completo_usu ASC"
    rs_Usu.CursorLocation = adUseClient
    rs_Usu.Open a, conn
    If rs_Usu.RecordCount > 0 Then
        Crea_Tree_Usu
        TxtCodPer.Text = rs_Usu("aut_nombre_usuario")
        texto = rs_Usu("priv_usu")
        CuentaCont = 1
        For i = 1 To Form_main.Controls.count - 1
            If TypeOf Form_main.Controls.Item(i) Is Menu Then
                If Left(Form_main.Controls.Item(i).Caption, 1) = "-" Then
                Else
                ncontrol1 = Form_main.Controls.Item(i).Name
                MiPos = InStr(1, texto, ncontrol1)
                If MiPos > 0 Then
                    activ = ""
                    MiPos = InStr(MiPos, texto, "#")
                    MiPos = MiPos - 1
                    activ = Mid(texto, MiPos, MiPos + 1)
                    activ = Left(activ, 1)
                    If activ = 1 Then
                        Me.Trv_Menu.Nodes.Item(CuentaCont).Checked = True
                    End If
                End If
                CuentaCont = CuentaCont + 1
                End If
            End If
        Next
        If IsNull(rs_Usu("permiso_usu")) Then
            permiso = "000"
        Else
            permiso = rs_Usu("permiso_usu")
        End If
        Me.Check_Perm.Item(0).Value = val(Left(permiso, 1))
        Me.Check_Perm.Item(1).Value = val(Mid(permiso, 2, 1))
        Me.Check_Perm.Item(2).Value = val(Mid(permiso, 3, 1))
        Me.LstPer.Visible = False
        Me.Label20.Caption = "Editando Registro Existente..."
        Me.BtnEliPer.Enabled = True
        Me.TxtNomPer.SetFocus
        SendKeys "{end}"
        SSTab1.TabEnabled(1) = False
    End If
    rs_Usu.Close



End Sub

Private Sub SSTab1_Click(PreviousTab As Integer)
If SSTab1.Tab = 0 Then
    'Me.Trv_Menu.Visible = True
Else
    'Me.Trv_Menu.Visible = True
    CmdPer.Clear
    Call LlenaCombo(Form_man_tab.CmdPer, "usuarios", "concat(aut_nombre_usuario, ' - ', nombre_completo_usu)", "where pas_usu ='#P#'", conn)
End If
End Sub

Private Sub SSTab1_GotFocus()
'If SSTab1.Tab = 0 Then
'    Me.Trv_Menu.Visible = True
'Else
'    Me.Trv_Menu.Visible = False
'End If
End Sub

Private Sub SSTab1_KeyDown(KeyCode As Integer, Shift As Integer)
'If SSTab1.Tab = 0 Then
'    Me.Trv_Menu.Visible = True
'Else
'    Me.Trv_Menu.Visible = False
'End If

End Sub

Private Sub Trv_Menu_NodeCheck(ByVal Node As MSComctlLib.Node)
    Dim cont As Integer
    Dim Actual As Boolean
    Dim Menu As Boolean
    Dim txt_Menu As String
    Actual = Me.Trv_Menu.Nodes.Item(Node.Key).Checked
    txt_Menu = Trv_Menu.Nodes.Item(Node.Key).Key
    If Trv_Menu.Nodes.Item(Node.Key).Children = 0 Then
        Trv_Menu.Nodes.Item(Trv_Menu.Nodes.Item(Node.Key).ParEnt.Index).Checked = Actual
    Else
        
    End If
End Sub


Private Sub Crea_Tree_Usu()
    Dim Raiz As Node
    Dim Nodo As Node
    Dim Menu As Integer
    Dim Keys As Variant
    Dim opcMenu As Variant
    Me.Trv_Menu.Nodes.Clear
    IniciarNodos "Parámetros Globales", "par_glo"
    IniciarNodos "Mantención de tablas", "man_tab"
    IniciarNodos "Procesos", "proc"
    IniciarNodos "Informes", "informes"
    IniciarNodos "Herramientas", "Hrm"
    IniciarNodos "Finalizar", "fin"
    IniciarNodos "Ayuda", "Hlp"
End Sub

Private Sub IniciarNodos(ByVal sID As String, _
                         ByVal sMenu As String, _
                         Optional ByVal sParent As String = "")
    ' Asignar al treeview el contenido del menú indicado
    Dim s As String, sC As String
    Dim i As Long
    Dim tControl As Control
    Dim tMenu As Menu
    Dim tNode As Node
    '
    i = Len(sMenu)
    '
    On Error Resume Next
    '
    If Len(sParent) Then
        ' Comprobar si ya existe ese nodo,
        ' para usar la misma rama...
        Set tNode = Me.Trv_Menu.Nodes(sMenu)
        If tNode Is Nothing Then
            ' Si no existe, se crea una nueva
            s = sID
            sID = sParent & sID
            Set tNode = Me.Trv_Menu.Nodes.Add(sParent, tvwChild, sID, s)
        Else
            sID = tNode.Key
        End If
    Else
        Set tNode = Me.Trv_Menu.Nodes.Add(, , sID, sID)
        ' Sólo expandir los nodos principales
        ' (quita el comentario para que se expanda el nodo)
        'tNode.Expanded = True
    End If
    For Each tControl In Form_main.Controls
        If TypeOf tControl Is Menu Then
            Set tMenu = tControl
            s = tMenu.Name
            Select Case sMenu
                Case s
                    ' nada
                Case Left$(s, i)
                    sC = tMenu.Caption
                    If sC <> "-" Then
                        ' Quitar los ampersands
                        sC = Replace(sC, "&", "")
                        Err = 0
                        Call Me.Trv_Menu.Nodes.Add(sID, tvwChild, s, sC)
                        If Err Then
                            ' Ya existe el nodo, borrarlo y crear el nuevo
                            Me.Trv_Menu.Nodes.Remove s
                            Call Me.Trv_Menu.Nodes.Add(sID, tvwChild, s, sC)
                        End If
                    End If
            End Select
        End If
        Err.Clear
    Next
End Sub



Private Sub Revisa_check(RangoInicio As Integer, RangoFinal As Integer, KeyNodo As String, NodoPrincipal As String)
    Dim SubMenu As Boolean
    Dim cont As Integer
    For cont = RangoInicio To RangoFinal
        If Me.Trv_Menu.Nodes.Item(cont).Checked = True Then
            SubMenu = True
            Exit For
        End If
    Next
    If Menu Then
        Me.Trv_Menu.Nodes.Item(NodoPrincipal).Checked = True
    End If
    If SubMenu Then
        'Me.Trv_Menu.Nodes.Item(KeyNodo).Checked = True
    Else
        'Me.Trv_Menu.Nodes.Item(KeyNodo).Checked = False
    End If

End Sub


Private Sub btn_ace_com_Click()
Dim Codigo, cod, codigofinal, a, descripcion As String
If Len(Trim(Me.txt_com_com.Text)) <> 0 And Len(Trim(Me.txt_reg_com.Text)) <> 0 And Len(Trim(Me.txt_pro_com.Text)) <> 0 And Len(Trim(Me.txt_reg_com.Text)) <> 0 And Len(Trim(Me.txt_cod_com.Text)) Then
comu = Trim(txt_com_com.Text)
regi = Trim(txt_reg_com.Text)
provi = Trim(txt_pro_com.Text)
codi = Trim(txt_cod_com.Text)
If Busqueda = 1 And Len(Trim(txt_com_com.Text)) <> 0 Then
    rs.CursorLocation = adUseClient
    rs.Open "SELECT * FROM CODIGOS__GEOGRAFICOS where COMUNA=" & "'" & comu & "'"
    If rs.RecordCount > 0 Then
        rs.MoveLast
        rs.MoveFirst
        Me.txt_cod_com.Text = rs("COD_GEO")
        Me.txt_reg_com.Text = rs("REGION")
        Me.txt_pro_com.Text = rs("PROVINCIA")
        Me.Label23.Caption = "Editando Registro Existente"
        Me.lst_com_com.Visible = False
        Busqueda = 0
        Indi = 0
        Me.txt_com_com.SetFocus
        SendKeys "{end}"
        rs.Close
    Else
        rs.Close

   If MsgBox("El registro no existe. ¿Desea crearlo?", vbYesNo + vbQuestion) = vbYes Then
            conn.Execute "INSERT INTO CODIGOS__GEOGRAFICOS(" & _
           "cod_geo,region,provincia,comuna) " & _
            "values(" & _
            "'" & codi & "', " & _
            "'" & regi & "', " & _
            "'" & provi & "', " & _
            "'" & comu & "')"
            MsgBox ("Registro Agregado")
            Me.Label23.Caption = ""
            Me.txt_com_com.Text = ""
            Me.txt_reg_com.Text = ""
            Me.txt_pro_com.Text = ""
            Me.txt_cod_com.Text = ""
            Me.txt_com_com.Enabled = True
            Me.txt_pro_com.Enabled = False
            Me.txt_reg_com.Enabled = False
            Me.txt_cod_com.Enabled = False
            Me.BTN_ELI_COM.Enabled = False
            Me.txt_com_com.SetFocus
        Else
            Me.txt_com_com.SetFocus
            SendKeys "{home}+{end}"
        End If

    End If
ElseIf Len(Trim(Me.txt_com_com.Text)) <> 0 Then
                conn.Execute "UPDATE CODIGOS__GEOGRAFICOS Set COMUNA = " & "'" & comu & "'" & ", REGION    = " & "'" & regi & "'" & ", PROVINCIA = " & "'" & provi & "'" & ",COD_GEO = " & "'" & codi & "'" & " where COMUNA=" & "'" & comu & "'"
                MsgBox ("Registro Modificado")
                Me.Label23.Caption = ""
                Me.txt_reg_com.Text = ""
                Me.txt_pro_com.Text = ""
                Me.txt_cod_com.Text = ""
                Me.txt_com_com.Enabled = True
                Me.txt_com_com.SetFocus
                txt_pro_com.Enabled = False
                txt_reg_com.Enabled = False
                txt_cod_com.Enabled = False
                BTN_ELI_COM.Enabled = False
                Busqueda = 1
End If
Else
    MsgBox "Debe llenar campos esenciales"
End If
Me.txt_com_com.SetFocus

End Sub

Private Sub Btn_Ace_conv_Click()
Dim Codigo, cod, codigofinal, a, descripcion As String
Codigo = Txt_cod_Conv.Text
descripcion = Txt_Des_Conv.Text
If Len(Trim(Me.Txt_Des_Conv.Text)) <> 0 Then
If Busqueda = 1 And Len(Trim(Txt_Des_Conv.Text)) <> 0 Then
    rs.CursorLocation = adUseClient
    rs.Open "SELECT * FROM convenios where des_conV=" & "'" & descripcion & "'"
    If rs.RecordCount > 0 Then
        rs.MoveLast
        rs.MoveFirst
        Txt_cod_Conv.Text = rs("cod_conv")
        Txt_Des_Conv.Text = rs("des_conv")
        Codigo = rs("cod_conv")
        Me.Label33.Caption = "Editando Convenio Existente."
        Me.Lst_conv.Visible = False
        Busqueda = 0
        Indi = 0
        Me.Txt_Des_Conv.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("convenios", "cod_conv", conn)
            Me.Txt_cod_Conv.Text = codigofinal
            conn.Execute "INSERT INTO convenios(cod_conv, des_conv) values(" & "'" & codigofinal & "'" & "," & "'" & Trim(descripcion) & "'" & ")"
            MsgBox ("Registro Agregado")
            Me.Txt_cod_Conv.Text = ""
            Me.Txt_Des_Conv.Text = ""
            Me.Txt_Des_Conv.SetFocus
            Me.Txt_cod_Conv.Enabled = False
            Me.Btn_Eli_conv.Enabled = False

        Else
            Me.Txt_Des_Conv.SetFocus
            SendKeys "{home}+{end}"
        End If

    End If
ElseIf Len(Trim(Me.Txt_Des_Conv)) <> 0 Then
            'rs.Open "SELECT * FROM convenios where des_conv=" & "'" & Me.Txt_Des_Conv.Text & "'"
            'If rs.recordcount > 0 Then
            '    MsgBox ("Descripción ya existe")
            '    Me.Txt_Des_Conv.SetFocus
            '    SendKeys "{home}+{end}"
            '    rs.Close
            'Else
                'rs.Close
                conn.Execute "UPDATE convenios Set des_conv= " & "'" & Trim(descripcion) & "'" & " where cod_conv= '" & Codigo & "'"
                MsgBox ("Registro Modificado")
                Me.Label33.Caption = ""
                Me.Txt_cod_Conv.Text = ""
                Me.Txt_Des_Conv.Text = ""
                Me.Txt_Des_Conv.SetFocus
                Me.Txt_cod_Conv.Enabled = False
                Me.Btn_Eli_conv.Enabled = False
                Busqueda = 1
            'End If
End If
Else
    MsgBox "No debe haber ningún campo vacío"
End If
Me.Txt_Des_Conv.SetFocus
Me.Label33.Caption = ""
End Sub

Private Sub btn_ace_cur_Click()
Dim log As Boolean
Dim accion_realizada As String
Dim vmaximo As Integer
Dim problemavacantes As Boolean
problemavacantes = False
'Consulta asignaciones sala
    Dim objRSs As ADODB.Recordset
    Set objRSs = New ADODB.Recordset
    Dim csala As String
    Dim tsala As Integer
'fin Consulta signaciones sala

If Len(Me.Cmb_mod_cur.Text) <> 0 And Len(Me.Cmb_num_gra_cur.Text) <> 0 _
And Len(Trim(Me.txt_let_cur.Text)) <> 0 And Len(Trim(Me.cmb_numsal_cur.Text)) Then
    Codens = DevuelveCampo("codigos_ensenanza", "des_ens", "cod_ens", "des_ens =" & "'" & Me.Cmb_mod_cur.Text & "'", conn)
    nivel = Me.Cmb_num_gra_cur.Text
    letra = UCase(Me.txt_let_cur.Text)
    numsala = Me.cmb_numsal_cur.Text
    Capacidad = val(Me.cmb_cap_sala.Text)
    Vacantes = val(Me.txt_vac_cur.Text)
    vacinicial = val(Me.txt_vac_ini.Text)
    
    'POLETTE consultar por asignacion de salas
    'csala = "SELECT COUNT(*) as tsala FROM cursos WHERE agno = '" & cmb_agno.Text & "' AND num_sal = '" & numsala & "'"
    csala = "SELECT COUNT(DISTINCT let_cur) AS tsala FROM cursos WHERE agno = '" & cmb_agno.Text & "' AND num_sal = '" & numsala & "'"
    objRSs.Open csala, conn
    
    If Not objRSs.EOF Then
        tsala = objRSs("tsala")
    Else
        tsala = 0
    End If
    
    objRSs.Close
    
    If (tsala >= 3) Then
        MsgBox "Las salas no pueden ser asignadas a más de 3 cursos a la vez. Por favor seleccione otra sala.", vbExclamation, "Atención"
        Exit Sub
    Else
    
    
        'asignar valores para insertar o actualizar campos
    If Codens = "000" Or Codens = "010" Then
        vmaximo = 45
    Else
        vmaximo = 45
    End If
           
    If vacinicial = 0 Then ' SI EL CURSO ES NUEVO
        If Capacidad > vmaximo Then
            MsgBox ("Capacidad máxima para curso " & vmaximo & " alumnos, se asignará este valor.")
            Me.txt_vac_ini.Text = vmaximo
            Me.txt_vac_cur.Text = vmaximo
            problemavacantes = False
        Else
            Me.txt_vac_ini.Text = Capacidad
            Me.txt_vac_cur.Text = Capacidad
            problemavacantes = False
        End If
    ElseIf vacinicial > 0 Then ' SI EL CURSO NO ES NUEVO
        If Capacidad >= OCUPADOS Then
            If Capacidad > vmaximo Then
                MsgBox ("Capacidad máxima para curso " & vmaximo & " alumnos, se asignará este valor.")
                Me.txt_vac_ini.Text = vmaximo
                Me.txt_vac_cur.Text = vmaximo - OCUPADOS
                problemavacantes = False
            Else
                Me.txt_vac_ini.Text = Capacidad
                Me.txt_vac_cur.Text = Capacidad - OCUPADOS
                problemavacantes = False
            End If
         Else
            MsgBox ("No es posible asignar sala nº " & Me.cmb_numsal_cur.Text & " a este curso" & Chr(13) & Chr(13) & "Capacidad actual en sala : " & Capacidad & Chr(13) & "Alumnos en este curso  : " & OCUPADOS)
            Me.cmb_numsal_cur.SetFocus
            problemavacantes = True
         End If
      End If


If Not problemavacantes Then
    If tablavacia("profesores", conn) Or Cmb_prof_cur.Text = "" Then
        RutProfe = ""
    Else
       If Me.Cmb_prof_cur.ListIndex = -1 Then 'Esto pregunta si no hizo click en el combobox
            For t = 0 To Me.Cmb_prof_cur.ListCount        'y hay un profesor seleccionado
                If Me.Cmb_prof_cur.List(t) = Me.Cmb_prof_cur.Text Then
                    RutProfe = aprofesores(t)
                    Exit For
                End If
            Next t
       Else
       RutProfe = aprofesores(Me.Cmb_prof_cur.ListIndex)
        'rutprofe = traerutespecial("profesores", "Rut_prof", "Noms_prof", "ape1_prof", Me.Cmb_prof_cur.Text)
       End If
    End If
    jornada = DevuelveCampo("jornadas", "", "cod_jor", "des_jor = '" & Me.Cmb_jor_cur.Text & "'", conn)
    Vacantes = Me.txt_vac_cur.Text
        
    If Busqueda = 1 Then
    
            If MsgBox("El registro no existe. ¿Desea crearlo?", vbYesNo + vbQuestion) = vbYes Then
                'Insertando Registro en tabla
                conn.Execute "INSERT INTO cursos(cod_ens, num_gra, let_cur, num_sal, rut_prof, cod_jor, vacantes_cur, agno ) values('" & Codens & "','" & nivel & "','" & Trim(letra) & "','" & numsala & "','" & RutProfe & "','" & jornada & "','" & Vacantes & "', " & cmb_agno.Text & ")"
                MsgBox ("Registro Agregado")
                
                'Log de ingreso de cursos
                Select Case Codens
                    Case "996"
                        grado = "PK"
                    Case "010"
                        grado = "K"
                    Case "110"
                        grado = "EB"
                    Case "310"
                        grado = "EM"
                End Select
                curso = CStr(nivel) & "º " & letra & " " & grado
                accion_realizada = "Se a ingresado el curso " & curso _
                                 & " para el año " & cmb_agno.Text & " con profesor " _
                                 & "jefe " & Cmb_prof_cur.Text & " and jornada " & Cmb_jor_cur.Text
                log = Inserta_Vitacora_Profesores(Trim(RutProfe), "Ingreso de curso", Trim(accion_realizada))
                'Fin de log
                
                Cmb_num_gra_cur.Text = ""
                
                Me.txt_let_cur.Text = ""
                Me.Cmb_jor_cur.Text = ""
                Me.Cmb_prof_cur.Text = ""
                Me.cmb_numsal_cur.Text = ""
                Me.txt_vac_ini.Text = ""
                Me.cmb_cap_sala.Text = ""
                Me.txt_alu_vac.Text = ""
                Me.txt_vac_cur.Text = ""
                
                Me.Cmb_mod_cur.Text = ""
                Me.Cmb_mod_cur.SetFocus
                Me.Label25.Caption = ""
                
                Me.Cmb_num_gra_cur.Enabled = False
                Me.txt_let_cur.Enabled = False
                Me.cmb_numsal_cur.Enabled = False
                Me.Cmb_prof_cur.Enabled = False
                Me.txt_vac_cur.Enabled = False
                Me.Cmb_mod_cur.Enabled = True
                Me.Cmb_mod_cur.SetFocus
                Me.Btn_eli_cur.Enabled = False
            Else
                Me.Cmb_mod_cur.SetFocus
            End If
    
    Else
       'a = "UPDATE cursos Set num_sal = '" & numsala & "', rut_prof = '" & rutprofe & "', cod_jor = " & "'" & Jornada & "', vacantes_cur = '" & vacantes & "' where cod_ens = '" & Codens & "' and num_gra = '" & nivel & "' and let_cur = '" & Trim(letra) & "'"
        
        a = "UPDATE cursos Set num_sal = '" & numsala & "', rut_prof = '" & RutProfe & "', cod_jor = " & "'" & jornada & "', vacantes_cur = '" & Vacantes + OCUPADOS & "' where cod_ens = '" & Codens & "' and num_gra = '" & nivel & "' and let_cur = '" & Trim(letra) & "' and agno = " & cmb_agno.Text
        
        conn.Execute a
        Busqueda = 1
        MsgBox ("Registro Modificado")
        
        'Log de modificación de cursos
                Select Case Codens
                    Case "996"
                        grado = "PK"
                    Case "010"
                        grado = "K"
                    Case "110"
                        grado = "EB"
                    Case "310"
                        grado = "EM"
                End Select
                curso = CStr(nivel) & "º " & letra & " " & grado
                accion_realizada = "Se a modificado el curso " & curso _
                                 & " para el año " & cmb_agno.Text & " con profesor " _
                                 & "jefe " & Cmb_prof_cur.Text & " and jornada " & Cmb_jor_cur.Text
                log = Inserta_Vitacora_Profesores(Trim(RutProfe), "Modificación de curso", Trim(accion_realizada))
        'Fin de log
        
        Me.Txt_Usu_Cod.Enabled = True
        Me.Label20.Caption = ""
        Me.Cmb_num_gra_cur.Enabled = True
        Cmb_num_gra_cur.Text = ""
        Me.txt_let_cur.Enabled = True
        Me.txt_let_cur.Text = ""
        Me.Cmb_jor_cur.Text = ""
        Me.Cmb_prof_cur.Text = ""
        Me.cmb_numsal_cur.Text = ""
        Me.txt_vac_ini.Text = ""
        Me.cmb_cap_sala.Text = ""
        Me.txt_alu_vac.Text = ""
        Me.txt_vac_cur.Text = ""
        Me.Cmb_mod_cur.Enabled = True
        Me.Cmb_mod_cur.Text = ""
        Me.Cmb_mod_cur.SetFocus
        Me.Cmb_num_gra_cur.Enabled = False
        Me.txt_let_cur.Enabled = False
        Me.Cmb_jor_cur.Enabled = False
        Me.cmb_numsal_cur.Enabled = False
        Me.Cmb_prof_cur.Enabled = False
        Me.txt_vac_cur.Enabled = False
        Me.Btn_eli_cur.Enabled = False
    End If
    
End If ' este endif cierra la pregunta sin problema de vacantes

End If 'POLETTE FIN

Else
        MsgBox ("No deben haber campos esenciales vacíos")
End If

End Sub

Private Sub btn_ace_lug_Click()
Dim Codigo, cod, codigofinal, a, descripcion As String
Codigo = txt_cod_lug.Text
descripcion = Trim(txt_lug_lug.Text)
If Len(Trim(Me.txt_lug_lug.Text)) <> 0 Then
If Busqueda = 1 And Len(Trim(txt_lug_lug.Text)) <> 0 Then
    rs.CursorLocation = adUseClient
    rs.Open "SELECT * FROM lugar_accidente where lug_lug=" & "'" & descripcion & "'"
    If rs.RecordCount > 0 Then
        rs.MoveLast
        rs.MoveFirst
        txt_cod_lug.Text = rs("cod_lug")
        txt_lug_lug.Text = rs("lug_lug")
        Codigo = rs("cod_lug")
        Me.Label14.Caption = "Modificando Registro Existente"
        Me.lst_lug_lug.Visible = False
        Busqueda = 0
        Indi = 0
        Me.txt_lug_lug.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("lugar_accidente", "cod_lug", conn)
            Me.txt_cod_lug.Text = codigofinal
            conn.Execute "INSERT INTO lugar_accidente(cod_lug, lug_lug) values(" & "'" & codigofinal & "'" & "," & "'" & descripcion & "'" & ")"
            MsgBox ("Registro Agregado")
            Me.txt_cod_lug.Text = ""
            Me.txt_lug_lug.Text = ""
            Me.txt_lug_lug.SetFocus
            Me.btn_eli_lug.Enabled = False
        Else
            Me.txt_lug_lug.SetFocus
            SendKeys "{home}+{end}"
        End If

    End If
ElseIf Len(Trim(Me.txt_lug_lug.Text)) <> 0 Then
            rs.CursorLocation = adUseClient
            rs.Open "SELECT * FROM lugar_accidente where lug_lug=" & "'" & Trim(Me.txt_lug_lug.Text) & "'"
            If rs.RecordCount > 0 Then
                MsgBox ("Descripción ya existe")
                Me.txt_lug_lug.SetFocus
                SendKeys "{home}+{end}"
                rs.Close
            Else
                rs.Close
                conn.Execute "UPDATE LUGAR_ACCIDENTE Set lug_lug = " & "'" & descripcion & "'" & " where cod_lug=" & Codigo
                MsgBox ("Registro Modificado")
                Me.Label14.Caption = ""
                Me.txt_cod_lug.Text = ""
                Me.txt_lug_lug.Text = ""
                Me.txt_lug_lug.SetFocus
                Busqueda = 1
                Me.btn_eli_lug.Enabled = False
            End If
End If
Else
    MsgBox "No debe haber ningún campo vacío"
End If
Me.txt_lug_lug.SetFocus
End Sub

Private Sub Btn_ace_mod_Click()
Dim Codigo, cod, codigofinal, a, descripcion As String
Codigo = Trim(Txt_cod_mod.Text)
descripcion = Trim(txt_des_mod.Text)
gradomaximo = Trim(Txt_Num_Gra_Max.Text)
If Len(Trim(Me.Txt_cod_mod.Text)) <> 0 And Len(Trim(Me.txt_des_mod.Text)) <> 0 And Len(Trim(Me.Txt_Num_Gra_Max.Text)) <> 0 Then
If Busqueda = 1 And Len(Trim(txt_des_mod.Text)) <> 0 Then
    rs.CursorLocation = adUseClient
    rs.Open "SELECT * FROM codigos_ensenanza where des_ens=" & "'" & descripcion & "'"
    If rs.RecordCount > 0 Then
        rs.MoveLast
        rs.MoveFirst
        Txt_cod_mod.Text = rs("cod_ens")
        txt_des_mod.Text = rs("des_ens")
        Codigo = rs("cod_ens")
        Me.Label16.Caption = "Editando Tipo de Enseñanza Existente"
        Me.Btn_eli_mod.Enabled = True
        Me.lst_des_mod.Visible = False
        Busqueda = 0
        Indi = 0
        Me.txt_des_mod.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_mod.Enabled = True
            Me.Txt_cod_mod.SetFocus
            conn.Execute "INSERT INTO codigos_ensenanza(cod_ens, des_ens, num_gra_max) values(" & "'" & Codigo & "'" & "," & "'" & descripcion & "'" & "," & "'" & gradomaximo & "'" & ")"
            MsgBox ("Registro Agregado")
            Me.Txt_cod_mod = ""
            Me.txt_des_mod = ""
            Me.Txt_Num_Gra_Max = ""
            Me.Txt_Num_Gra_Max.Enabled = False
            Me.txt_des_mod.SetFocus
            Me.Label16.Caption = ""
            ingxcodigo = 1
        Else
            Me.txt_des_mod.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_mod.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 codigos_ensenanza(cod_ens, des_ens, num_gra_max) values(" & "'" & Codigo & "'" & "," & "'" & descripcion & "'" & "," & "'" & gradomaximo & "'" & ")"
                    MsgBox ("Registro Agregado")
                    ingxcodigo = 0
                Else
                    conn.Execute "UPDATE codigos_ensenanza Set des_ens = " & "'" & descripcion & "'" & ", num_gra_max = " & "'" & gradomaximo & "'" & " where cod_ens=" & "'" & Codigo & "'"
                    MsgBox ("Registro Modificado")
                    
                End If
                Me.Txt_cod_mod.Enabled = True
                Me.Label16.Caption = ""
                Me.Txt_cod_mod.Text = ""
                Me.txt_des_mod.Text = ""
                Me.Txt_Num_Gra_Max.Text = ""
                Me.Txt_Num_Gra_Max.Enabled = False
                Me.txt_des_mod.SetFocus
                Busqueda = 1
            'End If
End If
Else
    MsgBox ("No deben haber campos vacíos")
End If
Me.txt_des_mod.SetFocus
End Sub

Private Sub btn_ace_mov_Click()
Dim Codigo, cod, codigofinal, a, descripcion As String
Codigo = txt_cod_mov.Text
descripcion = txt_des_mov.Text
If Len(Trim(Me.txt_des_mov.Text)) <> 0 Then
If Busqueda = 1 And Len(Trim(txt_des_mov.Text)) <> 0 Then
    rs.CursorLocation = adUseClient
    rs.Open "SELECT * FROM MOBILIARIO where des_mob=" & "'" & descripcion & "'"
    If rs.RecordCount > 0 Then
        rs.MoveLast
        rs.MoveFirst
        txt_cod_mov.Text = rs("cod_mob")
        txt_des_mov.Text = rs("des_mob")
        Codigo = rs("cod_mob")
        Me.Label12.Caption = "Modificando Mobiliario Existente"
        Me.lst_des_mov.Visible = False
        Busqueda = 0
        Indi = 0
        Me.txt_des_mov.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("mobiliario", "cod_mob", conn)
            Me.txt_cod_mov.Text = codigofinal
            conn.Execute "INSERT INTO MOBILIARIO(cod_mob, des_mob) values(" & "'" & codigofinal & "'" & "," & "'" & Trim(descripcion) & "'" & ")"
            MsgBox ("Registro Agregado")
            Me.txt_cod_mov.Text = ""
            Me.txt_des_mov.Text = ""
            Me.txt_des_mov.SetFocus
        Else
            Me.txt_des_mov.SetFocus
            SendKeys "{home}+{end}"
        End If

    End If
ElseIf Len(Trim(Me.txt_des_mov.Text)) <> 0 Then
            rs.CursorLocation = adUseClient
            rs.Open "SELECT * FROM MOBILIARIO where des_mob=" & "'" & Me.txt_des_mov.Text & "'"
            If rs.RecordCount > 0 Then
                MsgBox ("Descripción ya existe")
                Me.txt_des_mov.SetFocus
                SendKeys "{home}+{end}"
                rs.Close
            Else
                rs.Close
                conn.Execute "UPDATE MOBILIARIO Set des_mob = " & "'" & Trim(descripcion) & "'" & " where cod_mob=" & Codigo
                MsgBox ("Registro Modificado")
                Me.Label12.Caption = ""
                Me.txt_cod_mov.Text = ""
                Me.txt_des_mov.Text = ""
                Me.txt_des_mov.SetFocus
                Busqueda = 1
            End If
End If
Else
    MsgBox ("No debe haber ningún campo vacío")
End If
Me.txt_des_mov.SetFocus
End Sub

Private Sub btn_ace_pro_Click()
Dim log As Boolean
Dim accion_realizada As String
Dim Codigo, cod, codigofinal, a, descripcion As String
If Len(Trim(Me.txt_ape_pro.Text)) <> 0 And Len(Trim(Me.txt_nom_pro.Text)) <> 0 And Len(Trim(Me.txt_rut_pro.Text)) <> 0 And Len(Trim(Me.txt_dir_pro.Text)) <> 0 And Len(Trim(Me.cmb_comuna_pro.Text)) <> 0 And Len(Trim(Me.cmb_ciu_pro.Text)) <> 0 And Len(Trim(Me.txt_fon_pro.Text)) <> 0 Then
                
apellido_p = Trim(txt_ape_pro.Text)
apellido_m = Trim(txt_ape2_pro.Text)

nombres = Trim(txt_nom_pro.Text)
rut = Trim(Me.txt_rut_pro.Text) + "-" + Trim(Me.txt_dig_pro.Text)
direccion = Trim(Me.txt_dir_pro.Text)
Comuna = DevuelveCampo("codigos__geograficos", "", "cod_geo", "comuna = '" & Me.cmb_comuna_pro.Text & "'", conn)
fono = Trim(Me.txt_fon_pro.Text)
horario = Trim(Me.txt_hor_ate_pro.Text)
'comprobar si la tabla esta vacía

If Busqueda = 1 And Len(Trim(txt_ape_pro.Text)) <> 0 Then
    rs.CursorLocation = adUseClient
    rs.Open "SELECT * FROM profesores where rut_prof=" & "'" & rut & "'"
    If rs.RecordCount > 0 Then
        rs.MoveLast
        rs.MoveFirst
        Me.txt_nom_pro.Text = rs("noms_prof")
        Me.txt_rut_pro.Text = rs("rut_prof")
        Me.Label18.Caption = "Editando Profesor Existente"
        Me.lst_ape_pro.Visible = False
        Busqueda = 0
        Indi = 0
        Me.txt_ape_pro.SetFocus
        SendKeys "{end}"
        rs.Close
    Else
        rs.Close
        If MsgBox("El registro no existe. ¿Desea crearlo?", vbYesNo + vbQuestion) = vbYes Then
            'Insertando Registro en tabla
            perfil = DevuelveCampo("perfiles", "perfil", "cod_perfil", "perfil = " & "'" & Me.cmb_perfiles.Text & "'", conn)
            conn.Execute "INSERT INTO profesores (rut_prof, noms_prof, ape1_prof, ape2_prof, dir_prof, comuna_prof, hor_ate_prof, fon_prof,cod_perfil) values('" & rut & "' , '" & nombres & "' , '" & apellido_p & "' , '" & apellido_m & "' , '" & direccion & "' , '" & Comuna & "' , '" & horario & "' , '" & fono & "'" & ",'" & perfil & "')"
            DerUsuario = "000000000000000000000000000000000100000000"
            conn.Execute "INSERT INTO usuarios (aut_nombre_usuario, pas_usu, nombre_completo_usu, cargo_usu, priv_usu) values('" & rut & "' , '" & rut & "' , '" & apellido_p + " " + apellido_m + " " + nombres & "' , 'DOCENTE' , '" & DerUsuario & "'" & ")"
            MsgBox ("Registro Agregado")
            
            'Log ingreso de profesor
            accion_realizada = "Se ha ingresado el profesor " & Trim(txt_ape_pro.Text) _
                             & " " & Trim(txt_ape2_pro.Text) & " " & Trim(txt_nom_pro.Text) _
                             & " con rut " & Trim(Me.txt_rut_pro.Text) & "-" _
                             & Trim(Me.txt_dig_pro.Text)
            log = Inserta_Vitacora_Profesores(Trim(rut), "Ingreso de profesor", accion_realizada)
            'Fin de log
            
            Me.txt_ape_pro.Text = ""
            Me.txt_ape2_pro.Text = ""
            Me.txt_nom_pro.Text = ""
            Me.txt_rut_pro.Text = ""
            Me.txt_dig_pro.Text = ""
            Me.txt_dir_pro.Text = ""
            'Me.cmb_comuna_pro.Text = ""
            Form_man_tab.cmb_ciu_pro.Visible = False
            Me.txt_fon_pro.Text = ""
            Me.txt_hor_ate_pro.Text = ""
            Me.txt_ape_pro.SetFocus
            Me.btn_eli_pro.Enabled = False
            Me.txt_ape_pro.Enabled = False
            Me.txt_nom_pro.Enabled = False
            Me.txt_rut_pro.Enabled = False
            Me.txt_dig_pro.Enabled = False
            Me.txt_dir_pro.Enabled = False
            Me.cmb_comuna_pro.Enabled = False
            Me.txt_fon_pro.Enabled = False
            Me.txt_hor_ate_pro.Enabled = False
        Else
            Me.txt_ape_pro.SetFocus
            SendKeys "{home}+{end}"
        End If

    End If
ElseIf Len(Trim(Me.txt_ape_pro.Text)) <> 0 Then
                perfil = DevuelveCampo("perfiles", "perfil", "cod_perfil", "perfil = " & "'" & Me.cmb_perfiles.Text & "'", conn)
                conn.Execute "UPDATE PROFESORES Set noms_prof = '" & nombres & "' , ape1_prof = '" & apellido_p & "' , ape2_prof = '" & apellido_m & "', dir_prof = '" & direccion & "' , comuna_prof = '" & Comuna & "' , hor_ate_prof = '" & horario & "' , fon_prof = '" & fono & "',cod_perfil = " & perfil & " where rut_prof= '" & rut & "'"
                conn.Execute "UPDATE usuarios Set nombre_completo_usu = '" & apellido_p + " " + apellido_m + " " + nombres & "' where aut_nombre_usuario= '" & rut & "'"
                MsgBox ("Registro Modificado")
                
                'Log modificacion de profesor
                accion_realizada = "Se ha modificado el profesor " & apellido_p _
                                 & " " & apellido_m & " " & nombres & " con rut " & rut
                log = Inserta_Vitacora_Profesores(Trim(rut), "Modificación de profesor", accion_realizada)
                'Fin de log
                
                Me.Label18.Caption = ""
                Me.txt_ape_pro.Text = ""
                Me.txt_ape2_pro.Text = ""
                Me.txt_nom_pro.Text = ""
                Me.txt_rut_pro.Text = ""
                Me.txt_dig_pro.Text = ""
                Me.txt_dir_pro.Text = ""
                'Me.cmb_comuna_pro.Text = ""
                Form_man_tab.cmb_ciu_pro.Visible = False
                Me.txt_fon_pro.Text = ""
                Me.txt_hor_ate_pro.Text = ""
                Me.btn_eli_pro.Enabled = False
                Me.txt_nom_pro.Enabled = False
                Me.txt_rut_pro.Enabled = False
                Me.txt_dig_pro.Enabled = False
                Me.txt_dir_pro.Enabled = False
                Me.cmb_comuna_pro.Enabled = False
                Me.txt_fon_pro.Enabled = False
                Me.txt_hor_ate_pro.Enabled = False
                Me.txt_ape_pro.SetFocus
                Busqueda = 1
End If
Else
    MsgBox "Debe llenar campos esenciales"
End If
Me.txt_ape_pro.Enabled = True
Me.txt_ape_pro.SetFocus
End Sub

Private Sub btn_can_com_Click()
Unload Me

End Sub

Private Sub Btn_Can_Conv_Click()
Unload Me
End Sub

Private Sub btn_can_cur_Click()
Unload Me
End Sub

Private Sub Btn_can_mod_Click()
Unload Me
End Sub

Private Sub Btn_Deu_Aceptar_Click()
Dim Codigo, cod, codigofinal, a, descripcion As String
Codigo = Txt_cod_deu.Text
descripcion = Txt_Des_deu.Text
If Len(Trim(Me.Txt_Des_deu.Text)) <> 0 Then
If Busqueda = 1 And Len(Trim(Txt_Des_deu.Text)) <> 0 Then
    rs.CursorLocation = adUseClient
    rs.Open "SELECT * FROM tipo_deuda where des_tip_deu=" & "'" & descripcion & "'"
    If rs.RecordCount > 0 Then
        rs.MoveLast
        rs.MoveFirst
        Txt_cod_deu.Text = rs("cod_tip_deu")
        Txt_Des_deu.Text = rs("des_tip_deu")
        Codigo = rs("cod_tip_deu")
        Me.Label14.Caption = "Modificando Tipo de Deuda Existente."
        Me.lst_des_deu.Visible = False
        Busqueda = 0
        Indi = 0
        Me.Txt_Des_deu.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("tipo_deuda", "cod_tip_deu", conn)
            Me.Txt_cod_deu.Text = codigofinal
            conn.Execute "INSERT INTO TIPO_DEUDA(cod_tip_deu, des_tip_deu) values(" & "'" & codigofinal & "'" & "," & "'" & Trim(descripcion) & "'" & ")"
            MsgBox ("Registro Agregado")
            Me.Txt_cod_deu.Text = ""
            Me.Txt_Des_deu.Text = ""
            Me.Txt_Des_deu.SetFocus
            Me.Txt_cod_deu.Enabled = False
            Me.Btn_Deu_Eliminar.Enabled = False
        Else
            Me.Txt_Des_deu.SetFocus
            SendKeys "{home}+{end}"
        End If

    End If
ElseIf Len(Trim(Me.Txt_Des_deu)) <> 0 Then
            rs.CursorLocation = adUseClient
            rs.Open "SELECT * FROM tipo_deuda where des_tip_deu=" & "'" & Trim(Me.Txt_Des_deu.Text) & "'"
            If rs.RecordCount > 0 Then
                MsgBox ("Descripción ya existe")
                Me.Txt_Des_deu.SetFocus
                SendKeys "{home}+{end}"
                rs.Close
            Else
                rs.Close
                conn.Execute "UPDATE TIPO_DEUDA Set des_tip_deu= " & "'" & Trim(descripcion) & "'" & " where cod_tip_deu=" & Codigo
                MsgBox ("Registro Modificado")
                Me.Label14.Caption = ""
                Me.Txt_cod_deu.Text = ""
                Me.Txt_Des_deu.Text = ""
                Me.Txt_Des_deu.SetFocus
                Me.Txt_cod_deu.Enabled = False
                Me.Btn_Deu_Eliminar.Enabled = False
                Busqueda = 1
            End If
End If
Else
    MsgBox "No debe haber ningún campo vacío"
End If
Me.Txt_Des_deu.SetFocus
End Sub
Private Sub Btn_Deu_Cancelar_Click()
Unload Me
End Sub

Private Sub Btn_Deu_Eliminar_Click()
If ExistReg("deudas", "cod_tip_deu ='" & Txt_cod_deu & "'", 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 tipo_deuda WHERE COD_TIP_DEU ='" & Txt_cod_deu & "'"
        Txt_cod_deu = ""
        Txt_Des_deu = ""
        Me.Txt_cod_deu.Enabled = False
        Me.Btn_Deu_Eliminar.Enabled = False
        Busqueda = 1
    End If
End If
Me.Label14.Caption = ""
Me.Txt_Des_deu.SetFocus
End Sub

Private Sub BTN_ELI_COM_Click()
If ExistReg("postulantes", "cod_geo ='" & txt_cod_com & "'", conn) Or ExistReg("apoderados", "comuna_apo ='" & txt_cod_com & "'", conn) Then
    MsgBox ("No es posible eliminar registro. Existen registros asociados")
Else
    If MsgBox("El registro  será eliminado. ¿Desea continuar?", vbYesNo + vbQuestion) = vbYes Then
        conn.Execute "DeLETE FROM codigos__geograficos WHERE cod_geo ='" & txt_cod_com & "'"
        Me.txt_com_com.Text = ""
        Me.txt_reg_com.Text = ""
        Me.txt_pro_com.Text = ""
        Me.txt_cod_com.Text = ""
        Me.txt_com_com.Enabled = True
        Me.txt_pro_com.Enabled = False
        Me.txt_reg_com.Enabled = False
        Me.txt_cod_com.Enabled = False
        Me.BTN_ELI_COM.Enabled = False
        Busqueda = 1
    Else
        Me.btn_eli_pro.Enabled = True
    End If
End If
Me.Label23.Caption = ""
Me.txt_com_com.SetFocus

End Sub

Private Sub Btn_Eli_conv_Click()
If ExistReg("apoderados", "cod_conv ='" & Txt_cod_Conv & "'", 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 convenios WHERE COD_conv ='" & Txt_cod_Conv & "'"
        Txt_cod_Conv = ""
        Txt_Des_Conv = ""
        Busqueda = 1
        Me.Txt_cod_Conv.Enabled = False
        Me.Btn_Eli_conv.Enabled = False
    End If
End If
Me.Label33.Caption = ""
Me.Txt_Des_Conv.SetFocus

End Sub

Private Sub Btn_eli_cur_Click()
Dim objRS As ADODB.Recordset
Set objRS = New ADODB.Recordset
Dim var_sql As String
Dim grado As String
Dim curso As String
Dim accion_realizada As String
Dim log As Boolean

CodModalidad = DevuelveCampo("codigos_ensenanza", "des_ens", "cod_ens", "des_ens = " & "'" & Me.Cmb_mod_cur.Text & "'", conn)
If ExistReg("alu_x_cur", "cod_ens= '" & CodModalidad & "' and num_gra = '" & Me.Cmb_num_gra_cur.Text & "' and let_cur = '" & Me.txt_let_cur.Text & "'", conn) Or ExistReg("asistencia", "cod_ens= '" & CodModalidad & "' and num_gra = '" & Me.Cmb_num_gra_cur.Text & "' and let_cur = '" & Me.txt_let_cur.Text & "'", conn) Or ExistReg("asi_x_cur_prof", "cod_ens= '" & CodModalidad & "' and num_gra = '" & Me.Cmb_num_gra_cur.Text & "' and let_cur = '" & Me.txt_let_cur.Text & "' and agno = " & cmb_agno.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 cursos where cod_ens= " & "'" & CodModalidad & "'" & " and num_gra = " & "'" & Me.Cmb_num_gra_cur.Text & "'" & "and let_cur = " & "'" & Me.txt_let_cur.Text & "' and agno = " & cmb_agno.Text & ""
        
        'Log de eliminación de cursos
                Select Case CodModalidad
                    Case "996"
                        grado = "PK"
                    Case "010"
                        grado = "K"
                    Case "110"
                        grado = "EB"
                    Case "310"
                        grado = "EM"
                End Select
                curso = CStr(Me.Cmb_num_gra_cur.Text) & "º " & Me.txt_let_cur.Text & " " & grado
                accion_realizada = "Se a eliminado el curso " & curso _
                                 & " para el año " & cmb_agno.Text
                log = Inserta_Vitacora_Profesores(Trim(objRS("rut_prof")), "Eliminación de curso", accion_realizada)
                objRS.Close
        'Fin de log
        
        Me.Cmb_mod_cur = ""
        Me.Cmb_num_gra_cur = ""
        Me.txt_let_cur = ""
        Me.Cmb_jor_cur = ""
        Me.Cmb_prof_cur = ""
        Me.cmb_numsal_cur = ""
        Me.txt_vac_cur = ""
        Me.Cmb_mod_cur.Enabled = True
        Me.Cmb_num_gra_cur.Enabled = False
        Me.txt_let_cur.Enabled = False
        Me.Cmb_jor_cur.Enabled = False
        Me.cmb_numsal_cur.Enabled = False
        Me.Cmb_prof_cur.Enabled = False
        Me.txt_vac_cur.Enabled = False
        Me.Btn_eli_cur.Enabled = False
        Busqueda = 1
    End If
End If
Me.Label25.Caption = ""

End Sub

Private Sub btn_eli_lug_Click()
If ExistReg("enfermeria", "cod_lug ='" & txt_cod_lug & "'", 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 lugar_accidente WHERE COD_LUG ='" & txt_cod_lug & "'"
        txt_cod_lug = ""
        txt_lug_lug = ""
        Busqueda = 1
        Me.btn_eli_lug.Enabled = False
    End If
End If

End Sub

Private Sub Btn_eli_mod_Click()
If ExistReg("grados", "cod_ens ='" & Txt_cod_mod & "'", conn) Or ExistReg("matriculas", "cod_ens ='" & Txt_cod_mod & "'", conn) Or ExistReg("matriculas_prox", "cod_ens ='" & Txt_cod_mod & "'", conn) Or ExistReg("unid_educ", "cod_ens ='" & Txt_cod_mod & "'", 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 CODIGOS_ENSENANZA WHERE COD_ENS ='" & Txt_cod_mod & "'"
        Txt_cod_mod = ""
        txt_des_mod = ""
        Txt_Num_Gra_Max = ""
        Me.Txt_cod_mod.Enabled = True
        Me.Txt_Num_Gra_Max.Enabled = False
        Busqueda = 1
    End If
End If
Me.Label16.Caption = ""
Me.txt_des_mod.SetFocus
Me.Btn_eli_mod.Enabled = False
End Sub

Private Sub btn_eli_mov_Click()
If ExistReg("salas", "cod_mob ='" & txt_cod_mov & "'", 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 MOBILIARIO WHERE COD_MOB ='" & txt_cod_mov & "'"
                txt_cod_mov = ""
                txt_des_mov = ""
                Me.btn_eli_mov.Enabled = False
                Busqueda = 1
    End If
End If
    Me.Label13.Caption = ""
    Me.txt_des_mov.SetFocus

End Sub

Private Sub btn_eli_pro_Click()
Dim log As Boolean
Dim accion_realizada As String
Dim rut As String
rut = Trim(Me.txt_rut_pro.Text) & "-" & Trim(Me.txt_dig_pro.Text)
If ExistReg("cursos", "rut_prof ='" & Me.txt_rut_pro.Text + "-" + Me.txt_dig_pro.Text & "'", conn) Or ExistReg("asi_x_cur_prof", "rut_prof ='" & Me.txt_rut_pro.Text + "-" + Me.txt_dig_pro.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 profesores WHERE rut_prof ='" & Me.txt_rut_pro.Text + "-" + Me.txt_dig_pro.Text & "'"
        'Log eliminacion de profesor
                accion_realizada = "Se a eliminado al profesor " & Trim(txt_ape_pro.Text) _
                             & " " & Trim(txt_ape2_pro.Text) & " " & Trim(txt_nom_pro.Text) _
                             & " con rut " & Trim(Me.txt_rut_pro.Text) & "-" _
                             & Trim(Me.txt_dig_pro.Text)
                log = Inserta_Vitacora_Profesores(rut, "Eliminación de profesor", Trim(accion_realizada))
        'Fin de log
        Me.txt_ape_pro.Text = ""
        Me.txt_ape2_pro.Text = ""
        Me.txt_nom_pro.Text = ""
        Me.txt_rut_pro.Text = ""
        Me.txt_dig_pro.Text = ""
        Me.txt_dir_pro.Text = ""
        'Me.cmb_comuna_pro.Text = ""
        Me.txt_fon_pro.Text = ""
        Me.txt_hor_ate_pro.Text = ""
        Me.txt_ape_pro.SetFocus
        Busqueda = 1
        Me.btn_eli_pro.Enabled = False
        Me.txt_nom_pro.Enabled = False
        Me.txt_rut_pro.Enabled = False
        Me.txt_dig_pro.Enabled = False
        Me.txt_dir_pro.Enabled = False
        Me.cmb_comuna_pro.Enabled = False
        Me.txt_fon_pro.Enabled = False
        Me.txt_hor_ate_pro.Enabled = False
        Me.btn_eli_mov.Enabled = False
    Else
        Me.btn_eli_pro.Enabled = True
    End If
End If
Me.Label18.Caption = ""
Me.txt_ape_pro.Enabled = True
Me.txt_ape_pro.SetFocus
'Me.btn_eli_pro.Enabled = False
End Sub

Private Sub Btn_Sal_Aceptar_Click()
Dim nta, cod, codigofinal, a, descripcion As String
alumnosensala = 0

'asignar valores para insertar o actualizar campos
If Len(Trim(Me.txt_num_sal.Text)) <> 0 And Len(Trim(Me.txt_pis_sal.Text)) <> 0 And Len(Trim(Me.txt_cap_sal.Text)) <> 0 And val(Me.txt_cap_sal.Text) > 0 Then
If val(Me.txt_cap_sal.Text) >= alumnosensala Then
    numsala = Trim(Me.txt_num_sal.Text)
    pisosala = Trim(Me.txt_pis_sal.Text)
    Capacidad = CLng(Trim(Me.txt_cap_sal.Text))
    'mobiliario = devuelvecampo("mobiliario", "", "cod_mob", "des_mob = '" & Me.cmb_mob_sal.Text & "'", conn)
    'If Len(Trim(mobiliario)) = 0 Then
        'nummesas = 0
        'numsillas = 0
    'Else
        nummesas = CLng(Trim(Me.txt_num_mes.Text))
        numsillas = CLng(Trim(Me.txt_num_sill.Text))
    'End If
    If Busqueda = 1 Then
            If MsgBox("El registro no existe. ¿Desea crearlo?", vbYesNo + vbQuestion) = vbYes Then
                'Insertando Registro en tabla
                conn.Execute "INSERT INTO salas(num_sal, piso_sal, capacidad_sal, num_mesa_sal, num_silla_sal) values('" & numsala & "' , '" & pisosala & "'," & Capacidad & "," & nummesas & "," & numsillas & ")"
                MsgBox ("Registro Agregado")
                Me.Label19.Caption = ""
                Me.txt_num_sal.Enabled = True
                Me.txt_num_sal.Text = ""
                Me.txt_pis_sal.Text = ""
                Me.txt_cap_sal.Text = ""
                'Me.cmb_mob_sal.Text = ""
                Me.txt_num_mes.Text = ""
                Me.txt_num_sal.Text = ""
                Me.txt_num_sal.SetFocus
                Me.Label19.Caption = ""
                
                Me.txt_pis_sal.Enabled = False
                Me.txt_cap_sal.Enabled = False
                'Me.cmb_mob_sal.Enabled = False
                Me.txt_num_mes.Enabled = False
                Me.txt_num_sill.Enabled = False
                Me.Btn_Sal_Eliminar.Enabled = False
            Else
                Me.txt_num_sal.SetFocus
                SendKeys "{home}+{end}"
            End If
    Else
        a = "UPDATE salas Set piso_sal = '" & pisosala & "', capacidad_sal = " & Capacidad & ", num_mesa_sal =" & nummesas & ", num_silla_sal =" & numsillas & "  where num_sal = '" & numsala & "'"
        conn.Execute a
        Busqueda = 1
        MsgBox ("Registro Modificado")
        Me.Label19.Caption = ""
        Me.txt_num_sal.Enabled = True
        Me.txt_num_sal.Text = ""
        Me.txt_pis_sal.Text = ""
        Me.txt_cap_sal.Text = ""
        'Me.cmb_mob_sal.Text = ""
        Me.txt_num_mes.Text = ""
        Me.txt_num_sal.Text = ""
        Me.txt_num_sal.SetFocus
        Me.Label19.Caption = ""
        Me.txt_pis_sal.Enabled = False
        Me.txt_cap_sal.Enabled = False
        'Me.cmb_mob_sal.Enabled = False
        Me.txt_num_mes.Enabled = False
        Me.txt_num_sill.Enabled = False
        Me.Btn_Sal_Eliminar.Enabled = False
        
    End If
Else
    MsgBox ("EL curso " & cursoensala & Chr(13) & "ocupa esta sala actualmente con " & alumnosensala & " alumno(s)." & Chr(13) & Chr(13) & "La capacidad de alumnos para esta sala es incorrecta.")
    Me.txt_cap_sal.SetFocus
    Exit Sub
End If
Else
    MsgBox ("No deben haber campos vacíos o capacidad sala es 0")
End If
Me.txt_num_sal.Enabled = True
Me.txt_num_sal.SetFocus
    
End Sub

Private Sub Btn_Sal_Cancelar_Click()
Unload Me
End Sub

Private Sub Btn_Sal_Eliminar_Click()
If ExistReg("cursos", "num_sal ='" & txt_num_sal & "'", 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 salas WHERE num_sal ='" & txt_num_sal.Text & "'"
        Me.txt_num_sal.Text = ""
        Me.txt_pis_sal.Text = ""
        Me.txt_cap_sal.Text = ""
        'Me.cmb_mob_sal.Text = ""
        Me.txt_num_mes.Text = ""
        Me.txt_num_sill.Text = ""

        Me.txt_pis_sal.Enabled = False
        Me.txt_cap_sal.Enabled = False
        'Me.cmb_mob_sal.Enabled = False
        Me.txt_num_mes.Enabled = False
        Me.txt_num_sill.Enabled = False
        Busqueda = 1
        
        Me.Btn_Sal_Eliminar.Enabled = False
    End If
End If
Me.Label19.Caption = ""
Me.txt_num_sal.Enabled = True
Me.txt_num_sal.SetFocus
End Sub

Private Sub Btn_Tip_Aceptar_Click()
Dim Codigo, cod, codigofinal, a, descripcion As String
Codigo = Txt_cod_TipoApo.Text
descripcion = Txt_des_tipoapo.Text
If Len(Trim(Me.Txt_des_tipoapo.Text)) <> 0 Then
If Busqueda = 1 And Len(Trim(Txt_des_tipoapo.Text)) <> 0 Then
    rs.CursorLocation = adUseClient
    rs.Open "SELECT * FROM tipo_apo where des_tipo_apo=" & "'" & descripcion & "'"
    If rs.RecordCount > 0 Then
        rs.MoveLast
        rs.MoveFirst
        Txt_cod_TipoApo.Text = rs("cod_tipo_apo")
        Txt_des_tipoapo.Text = rs("des_tipo_apo")
        Codigo = rs("cod_tipo_apo")
        Me.Label12.Caption = "Modificando Tipo de Apoderado Existente"
        Me.Lst_des_tipoapo.Visible = False
        Busqueda = 0
        Indi = 0
        Me.Txt_des_tipoapo.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("tipo_apo", "cod_tipo_apo", conn)
            Me.Txt_cod_TipoApo.Text = codigofinal
            conn.Execute "INSERT INTO TIPO_APO(cod_tipo_Apo, des_tipo_Apo) values(" & "'" & codigofinal & "'" & "," & "'" & Trim(descripcion) & "'" & ")"
            MsgBox ("Registro Agregado")
            Me.Txt_cod_TipoApo.Text = ""
            Me.Txt_des_tipoapo.Text = ""
            Me.Txt_des_tipoapo.SetFocus
            Me.Txt_cod_TipoApo.Enabled = False
            Me.Btn_Tip_Eliminar.Enabled = False
        Else
            Me.Txt_des_tipoapo.SetFocus
            SendKeys "{home}+{end}"
        End If

    End If
ElseIf Len(Trim(Me.Txt_des_tipoapo.Text)) <> 0 Then
            rs.CursorLocation = adUseClient
            rs.Open "SELECT * FROM tipo_apo where des_tipo_apo=" & "'" & Trim(Me.Txt_des_tipoapo.Text) & "'"
            If rs.RecordCount > 0 Then
                MsgBox ("Descripción ya existe")
                Me.Txt_des_tipoapo.SetFocus
                SendKeys "{home}+{end}"
                rs.Close
            Else
                rs.Close
                conn.Execute "UPDATE TIPO_APO Set des_tipo_apo = " & "'" & Trim(descripcion) & "'" & " where cod_tipo_apo=" & Codigo
                MsgBox ("Registro Modificado")
                Me.Label12.Caption = ""
                Me.Txt_cod_TipoApo.Text = ""
                Me.Txt_des_tipoapo.Text = ""
                Me.Txt_des_tipoapo.SetFocus
                Me.Txt_cod_TipoApo.Enabled = False
                Me.Btn_Tip_Eliminar.Enabled = False
                Busqueda = 1
            End If
End If
Else
    MsgBox "No debe haber ningún campo vacío"
End If
Me.Txt_des_tipoapo.SetFocus
End Sub

Private Sub Btn_Tip_Cancelar_Click()
Unload Me
End Sub

Private Sub Btn_Tip_Eliminar_Click()
If ExistReg("apoderados", "cod_tipo_apo ='" & Txt_cod_TipoApo & "'", 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 TIPO_APO WHERE COD_TIPO_APO ='" & Txt_cod_TipoApo & "'"
        Txt_cod_TipoApo = ""
        Txt_des_tipoapo = ""
        Me.Txt_cod_TipoApo.Enabled = False
        Me.Btn_Tip_Eliminar.Enabled = False
        Busqueda = 1
    End If
End If
Me.Label12.Caption = ""
Me.Txt_des_tipoapo.SetFocus
End Sub


Private Sub Btn_Usu_Aceptar_Click()
    Dim Cuenta, cod, codigofinal, a, descripcion, Privilegios, Permisos As String
    Dim e As Long
    Cuenta = Txt_Usu_Cod.Text
    descripcion = Txt_Usu_Desc.Text
    Password = Txt_Usu_Pas.Text
    cargo = Txt_Usu_Cargo.Text
    
    If CmdPer.Text = "" Then
        MsgBox ("No deben haber campos vacíos")
        CmdPer.SetFocus
        Exit Sub
    End If
    
'********************************************
    Privilegios = "#"
    For i = 1 To Me.Trv_Menu.Nodes.count
        'Privilegios = Privilegios + IIf(Me.Trv_Menu.Nodes.Item(i).Checked, "1", "0")
        nom_control = Trv_Menu.Nodes.Item(i).Text
        opcion_control = "&" & Trv_Menu.Nodes.Item(i).Text
       
        'BUSCAR EL NOMBRE DEL CONTROL CON EL CAPTION
        For e = 0 To Form_main.Controls.count - 1
        aux2 = Form_main.Controls.Item(e).Name
        If TypeOf Form_main.Controls.Item(e) Is Menu Then
            aux3 = Form_main.Controls.Item(e).Caption
            If Form_main.Controls.Item(e).Caption = nom_control Or Form_main.Controls.Item(e).Caption = opcion_control Then
                Control = Form_main.Controls.Item(e).Name
            End If
        End If
        Next
        'FIN BUSCAR
        
        If Me.Trv_Menu.Nodes.Item(i).Checked = True Then
            Privilegios = Privilegios + Control + "|1#"
        Else
            Privilegios = Privilegios + Control + "|0#"
        End If
        
    Next
'*******************************************
    For i = 0 To 2
        Permisos = Permisos + IIf(Me.Check_Perm.Item(i).Value, "1", "0")
    Next
    If Len(Me.Txt_Usu_Cod.Text) <> 0 And Len(Me.Txt_Usu_Desc.Text) <> 0 And Len(Me.Txt_Usu_Pas.Text) <> 0 Then
        If Busqueda = 1 And Len(Txt_Usu_Desc.Text) <> 0 Then
            rs_Usu.CursorLocation = adUseClient
            rs_Usu.Open "SELECT * FROM usuarios where nombre_completo_usu =" & "'" & descripcion & "'"
            If rs_Usu.RecordCount > 0 Then
                rs_Usu.MoveLast
                rs_Usu.MoveFirst
                Me.Txt_Usu_Cod.Text = rs_Usu("aut_nombre_usuario")
                Me.Txt_Usu_Desc.Text = rs_Usu("nombre_completo_usu")
                Me.Txt_Usu_Pas.Text = rs_Usu("pas_usu")
                Me.Txt_Usu_Cargo.Text = rs_Usu("cargo_usu")
                Cuenta = rs_Usu("aut_nombre_usuario")
                Me.Label20.Caption = "Editando Registro Existente"
                Me.Btn_Usu_Eliminar.Enabled = True
                Me.lst_usu_desc.Visible = False
                
                Busqueda = 0
                Indi = 0
                Me.Txt_Usu_Desc.SetFocus
                SendKeys "{end}"
                rs_Usu.Close
            Else
                rs_Usu.Close
                If MsgBox("El registro no existe. ¿Desea crearlo?", vbYesNo + vbQuestion) = vbYes Then
                    Me.Txt_Usu_Cod.Enabled = True
                    Me.Txt_Usu_Cod.SetFocus
                    conn.Execute "INSERT INTO usuarios(aut_nombre_usuario, nombre_completo_usu, pas_usu, cargo_usu, priv_usu, Permiso_usu) values(" & "'" & Cuenta & "'" & "," & "'" & descripcion & "'" & "," & "'" & Password & "'" & "," & "'" & cargo & "'" & "," & "'" & Privilegios & "'" & "," & "'" & Permisos & "'" & ")"
                    MsgBox ("Registro Agregado")
                    Me.Txt_Usu_Cod = ""
                    Me.Txt_Usu_Desc = ""
                    Me.Txt_Usu_Pas = ""
                    Me.Txt_Usu_Cargo = ""
                    Me.Trv_Menu.Nodes.Clear
                    Me.Txt_Usu_Desc.SetFocus
                    Me.Label20.Caption = ""
                    Me.Check_Perm.Item(0).Value = False
                    Me.Check_Perm.Item(1).Value = False
                    Me.Check_Perm.Item(2).Value = False
                Else
                    Me.Txt_Usu_Desc.SetFocus
                    SendKeys "{home}+{end}"
                End If
            End If
        ElseIf Len(Me.Txt_Usu_Desc.Text) <> 0 Then
            If ingxcodigo = 1 Then
                'conn.Execute "INSERT INTO usuarios(aut_nombre_usuario, nombre_completo_usu, pas_usu, cargo_usu, priv_usu, Permiso_usu, Cod_per) values(" & "'" & Cuenta & "'" & "," & "'" & descripcion & "'" & "," & "'" & password & "'" & "," & "'" & cargo & "'" & "," & "'" & Privilegios & "'" & "," & "'" & Permisos & "'" & "," & "'" & Left(CmdPer.Text, 10) & "'" & ")"
conn.Execute "INSERT INTO usuarios(aut_nombre_usuario, nombre_completo_usu, pas_usu, cargo_usu, priv_usu, Permiso_usu) values(" & "'" & Cuenta & "'" & "," & "'" & descripcion & "'" & "," & "'" & Password & "'" & "," & "'" & cargo & "'" & "," & "'" & Privilegios & "'" & "," & "'" & Permisos & "'" & ")"
               
               MsgBox ("Registro Agregado")
                ingxcodigo = 0
            Else
                
                'a = "UPDATE usuarios Set nombre_completo_usu = " & "'" & descripcion & "'" & ", pas_usu = " & "'" & password & "'" & ", cargo_usu = " & "'" & cargo & "'" & ", priv_usu = " & "'" & Privilegios & "'" & ", permiso_usu = " & "'" & Permisos & "'" & ", cod_per = " & "'" & Left(CmdPer.Text, 10) & "'" & " where aut_nombre_usuario='" & Cuenta & "'"
                a = "UPDATE usuarios Set nombre_completo_usu = " & "'" & descripcion & "'" & ", pas_usu = " & "'" & Password & "'" & ", cargo_usu = " & "'" & cargo & "'" & ", priv_usu = " & "'" & Privilegios & "'" & ", permiso_usu = " & "'" & Permisos & "'" & " where aut_nombre_usuario='" & Cuenta & "'"
                
                conn.Execute a
                MsgBox ("Registro Modificado")
            End If
            Me.Txt_Usu_Cod.Enabled = True
            Me.Label20.Caption = ""
            Me.Txt_Usu_Desc.Text = ""
            Me.Txt_Usu_Cod.Text = ""
            Me.txt_des_mod.Text = ""
            Me.Txt_Usu_Pas = ""
            Me.Txt_Usu_Cargo = ""
            CmdPer.Text = ""
            'Me.Check_Perm.Item(0).Value = False
            'Me.Check_Perm.Item(1).Value = False
            'Me.Check_Perm.Item(2).Value = False
            'Me.Trv_Menu.Nodes.Clear
            Me.Txt_Usu_Desc.SetFocus
            Busqueda = 1
        End If
    Else
        MsgBox ("No deben haber campos vacíos")
    End If
    Me.Txt_Usu_Desc.SetFocus

SSTab1.TabEnabled(0) = True
Me.Trv_Menu.Nodes.Clear
End Sub

Private Sub Btn_Usu_Cancelar_Click()
Unload Me
End Sub

Private Sub Btn_Usu_Eliminar_Click()
If ExistReg("reg_ope", "aut_nombre_usuario ='" & Txt_Usu_Cod & "'", 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 usuarios WHERE aut_nombre_usuario ='" & Txt_Usu_Cod & "'"
        Txt_Usu_Cod = ""
        Txt_Usu_Desc = ""
        Txt_Usu_Pas = ""
        Txt_Usu_Cargo = ""
        Txt_Usu_Priv = ""
        Busqueda = 1
    End If
End If
Me.Label20.Caption = ""
Me.Txt_Usu_Desc.SetFocus
Me.Btn_Usu_Eliminar.Enabled = False
End Sub
Private Sub cmb_comuna_pro_Click()
Form_man_tab.cmb_ciu_pro.Visible = True
Me.cmb_ciu_pro.ListIndex = Me.cmb_comuna_pro.ListIndex
KeyAscii = 0
End Sub
Private Sub cmb_comuna_pro_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 And Len(Me.cmb_comuna_pro.Text) <> 0 Then
    Me.txt_fon_pro.Enabled = True
    Me.txt_fon_pro.SetFocus
End If
KeyAscii = 0
End Sub

Private Sub Cmb_jor_cur_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 And Len(Me.Cmb_jor_cur.Text) <> 0 Then
    Me.Cmb_prof_cur.Enabled = True
    Me.Cmb_prof_cur.SetFocus
End If
KeyAscii = 0
End Sub

'Private Sub cmb_mob_sal_KeyPress(KeyAscii As Integer)
'If KeyAscii = 13 And Len(Trim(Me.cmb_mob_sal.Text)) <> 0 Then
'    Me.txt_num_mes.Enabled = True
'    Me.txt_num_mes.SetFocus
'End If
'KeyAscii = 0
'End Sub

Private Sub cmb_mod_cur_Click()
If Len(Me.Cmb_mod_cur.Text) <> 0 Then
 nivel = DevuelveCampo("codigos_ensenanza", "des_ens", "num_gra_max", "des_ens = " & "'" & Me.Cmb_mod_cur.Text & "'", conn)
 Me.Cmb_num_gra_cur.Enabled = True
 Me.Cmb_num_gra_cur.Clear
 For t = 1 To val(nivel)
    Me.Cmb_num_gra_cur.AddItem t
 Next t
End If
End Sub

Private Sub Cmb_mod_cur_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 And Len(Me.Cmb_mod_cur.Text) <> 0 Then
    Me.Cmb_num_gra_cur.SetFocus
End If
KeyAscii = 0
End Sub

Private Sub Cmb_mod_cur_LostFocus()
If Me.Cmb_mod_cur.Text = "Verdadero" Then
    Me.Cmb_mod_cur.Text = ""
    Me.Cmb_mod_cur.SetFocus
End If

End Sub

Private Sub Cmb_num_gra_cur_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 And Len(Cmb_num_gra_cur.Text) <> 0 Then
    Me.txt_let_cur.Enabled = True
    Me.txt_let_cur.SetFocus
End If
KeyAscii = 0
End Sub

Private Sub cmb_numsal_cur_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 And Len(Trim(Me.cmb_numsal_cur.Text)) <> 0 Then
    Call btn_ace_cur_Click
End If
KeyAscii = 0
End Sub

Private Sub Cmb_prof_cur_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 And Len(Me.Cmb_prof_cur.Text) <> 0 Then
    Me.cmb_numsal_cur.Enabled = True
    Me.cmb_numsal_cur.SetFocus
End If
KeyAscii = 0
End Sub


Private Sub Form_Activate()
CentrarForma Me
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
If KeyAscii = Asc("-") Then Exit Sub
If KeyAscii = Asc("#") Then Exit Sub

KeyAscii = 0


End Sub

Private Sub Form_Unload(Cancel As Integer)
Call menuhabilitado(True)
Call Form_main.HideFRame
End Sub
Private Sub btn_can_lug_Click()
Unload Me
End Sub

Private Sub btn_can_mov_Click()
Unload Me
End Sub

Private Sub btn_can_pro_Click()
Unload Me
End Sub


Private Sub Form_Load()
Call menuhabilitado(False)
Form_man_tab.KeyPreview = True
Busqueda = 1
Set rs = New ADODB.Recordset
If ManTab = "mod" Then
    Call Form_main.HideFRame
    Form_man_tab.Caption = "Tipos de Enseñanza"
    Form_man_tab.Height = 3030
    Form_man_tab.Width = 8100
    Form_man_tab.Label16.Caption = ""
    Form_man_tab.Frame_Modalidades.Top = 20
    Form_man_tab.Frame_Modalidades.Left = 80
    Form_man_tab.Frame_Modalidades.Visible = True
    
    CentrarForma Me
    Form_man_tab.Show
    Form_man_tab.txt_des_mod.SetFocus
    Form_man_tab.Txt_Num_Gra_Max.Enabled = False
    Form_man_tab.Btn_eli_mod.Enabled = False

ElseIf ManTab = "tip_apo" Then
    Call Form_main.HideFRame
    Form_man_tab.Caption = "Tipos de Apoderados"
    Form_man_tab.Height = 3050
    Form_man_tab.Width = 8100
    Form_man_tab.Frame_Tip_Apo.Top = 20
    Form_man_tab.Frame_Tip_Apo.Left = 80
    Form_man_tab.Label12.Caption = ""
    Form_man_tab.Frame_Tip_Apo.Visible = True
    CentrarForma Me
    Form_man_tab.Show
    Form_man_tab.Txt_des_tipoapo.SetFocus
    Form_man_tab.Txt_cod_TipoApo.Enabled = False
    Form_man_tab.Btn_Tip_Eliminar.Enabled = False

ElseIf ManTab = "usu" Then
    Call Form_main.HideFRame
    Form_man_tab.Caption = "Perfiles y Usuarios"
    Form_man_tab.Label20.Caption = ""
    Form_man_tab.Height = 6200
    Form_man_tab.Width = 6570
    Form_man_tab.Frame_Usuarios.Top = 60
    Form_man_tab.Frame_Usuarios.Left = 120
    Form_man_tab.Frame_Usuarios.Visible = True
    CentrarForma Me
    Form_man_tab.Show
    Form_man_tab.Txt_Usu_Desc.SetFocus
    Form_man_tab.Btn_Usu_Eliminar.Enabled = False
    Form_man_tab.SSTab1.Tab = 0

    Form_man_tab.Trv_Menu.Nodes.Clear
    Set rs_Usu = New ADODB.Recordset

ElseIf ManTab = "prof" Then
    Form_man_tab.Caption = "Administración de Profesor"
    Form_man_tab.Label18.Caption = ""
    Form_man_tab.Height = 4400 '4880
    Form_man_tab.Width = 9200 '7695
    Call Form_main.HideFRame
    Form_man_tab.frame_pro.Top = 20
    Form_man_tab.frame_pro.Left = 80
    Form_man_tab.txt_nom_pro.Enabled = False
    Form_man_tab.txt_rut_pro.Enabled = False
    Form_man_tab.txt_dig_pro.Enabled = False
    Form_man_tab.txt_dir_pro.Enabled = False
    Form_man_tab.frame_pro.Visible = True
    rs.CursorLocation = adUseClient
    a = 2
    rs.Open "SELECT distinct Comuna, Provincia FROM codigos__geograficos ORDER BY COMUNA ASC", conn
    If rs.RecordCount > 0 Then
        For t = 0 To rs.RecordCount - 1
            Form_man_tab.cmb_comuna_pro.AddItem rs("Comuna")
            Form_man_tab.cmb_ciu_pro.AddItem rs("Provincia")
            rs.MoveNext
        Next t
    End If
    rs.Close
    
    'Perfiles por GesCol
    rs.Open "SELECT * FROM perfiles", conn
    If rs.RecordCount > 0 Then
        For t = 0 To rs.RecordCount - 1
            Form_man_tab.cmb_perfiles.AddItem rs("perfil")
            rs.MoveNext
        Next t
    End If
    rs.Close
        
    Form_man_tab.cmb_comuna_pro.Enabled = False
    Form_man_tab.cmb_ciu_pro.Text = ""
    Form_man_tab.cmb_ciu_pro.Enabled = False
    Form_man_tab.cmb_ciu_pro.Visible = False
    Form_man_tab.txt_hor_ate_pro.Enabled = False
    Form_man_tab.btn_eli_pro.Enabled = False
    CentrarForma Me
    Form_man_tab.Show
    Form_man_tab.txt_ape_pro.SetFocus
    Form_man_tab.btn_eli_pro.Enabled = False

ElseIf ManTab = "mob" Then
    Form_man_tab.Label12.Caption = ""
    Form_man_tab.Height = 3040
    Form_man_tab.Width = 8100 '6735
    Call Form_main.HideFRame
    Form_man_tab.frame_mov.Top = 20 '240
    Form_man_tab.frame_mov.Left = 80 '240
    Form_man_tab.frame_mov.Visible = True
    CentrarForma Me
    Form_man_tab.Show
    Form_man_tab.txt_des_mov.SetFocus
    Form_man_tab.txt_cod_mov.Enabled = False
    Form_man_tab.btn_eli_mov.Enabled = False

ElseIf ManTab = "lug_acc" Then
    Form_man_tab.Label12.Caption = ""
    Form_man_tab.Caption = "Lugares de Accidente"
    Form_man_tab.Height = 3050
    Form_man_tab.Width = 8100
    Call Form_main.HideFRame
    Form_man_tab.frame_acci.Top = 20
    Form_man_tab.frame_acci.Left = 80
    Form_man_tab.frame_acci.Visible = True
    CentrarForma Me
    Form_man_tab.Show
    Form_man_tab.txt_lug_lug.SetFocus
    Form_man_tab.txt_cod_lug.Enabled = False
    Form_man_tab.btn_eli_lug.Enabled = False

ElseIf ManTab = "sal" Then
    Form_man_tab.Height = 3200
    Form_man_tab.Width = 8100
    Form_man_tab.FRAME_SAL.Left = 80
    Form_man_tab.FRAME_SAL.Top = 20
    Call Form_main.HideFRame
    Form_man_tab.FRAME_SAL.Visible = True
    CentrarForma Me
    Form_man_tab.Show
    Form_man_tab.txt_num_sal.SetFocus
    Form_man_tab.txt_cap_sal.Enabled = False
    Form_man_tab.txt_pis_sal.Enabled = False
    'Call llenacombo(Form_man_tab.cmb_mob_sal, "MOBILIARIO", "des_mob", "", conn)
    'Form_man_tab.cmb_mob_sal.Enabled = False
    Form_man_tab.txt_num_mes.Enabled = False
    Form_man_tab.txt_num_sill.Enabled = False
    Form_man_tab.Btn_Sal_Eliminar.Enabled = False

ElseIf ManTab = "conv" Then
    Form_man_tab.Label33.Caption = ""
    Form_man_tab.Height = 3050
    Form_man_tab.Width = 8120
    Call Form_main.HideFRame
    Form_man_tab.Frame_conv.Top = 20
    Form_man_tab.Frame_conv.Left = 80
    Form_man_tab.Frame_conv.Visible = True
    Form_man_tab.Txt_cod_Conv.Enabled = False
    CentrarForma Me
    Form_man_tab.Show
    Form_man_tab.Txt_Des_Conv.SetFocus
    Form_man_tab.Btn_Eli_conv.Enabled = False

ElseIf ManTab = "tip_deu" Then
    Form_man_tab.Label12.Caption = ""
    Form_man_tab.Caption = "Tipos de Deuda"
    Form_man_tab.Height = 2700
    Form_man_tab.Width = 6400
    Call Form_main.HideFRame
    Form_man_tab.Frame_Tip_Deu.Top = 100
    Form_man_tab.Frame_Tip_Deu.Left = 100
    Form_man_tab.Frame_Tip_Deu.Visible = True
    CentrarForma Me
    Form_man_tab.Show
    Form_man_tab.Txt_Des_deu.SetFocus
    Form_man_tab.Txt_cod_deu.Enabled = False
    Form_man_tab.Btn_Deu_Eliminar.Enabled = False
    
ElseIf ManTab = "cur" Then
    conn.Execute "UPDATE usuarios SET cargo_usu = 'DOCENTE-#PJE#' WHERE rut_usu IN (SELECT rut_prof FROM cursos WHERE agno = " & Anno & ") AND cargo_usu = 'DOCENTE-#PRO#'"
    Form_man_tab.Label25.Caption = ""
    Form_man_tab.Caption = "Cursos"
    Form_man_tab.Height = 4600
    Form_man_tab.Width = 9080
    Call Form_main.HideFRame
    Form_man_tab.Frame_cur.Top = 20
    Form_man_tab.Frame_cur.Left = 80
    Form_man_tab.Frame_cur.Visible = True
    CentrarForma Me
    Form_man_tab.Show
    Form_man_tab.Cmb_num_gra_cur.Enabled = False
    Form_man_tab.Cmb_prof_cur.Enabled = False
    Form_man_tab.Cmb_jor_cur.Enabled = False
    Form_man_tab.cmb_numsal_cur.Enabled = False
    Form_man_tab.txt_vac_cur.Enabled = False
    Form_man_tab.Cmb_mod_cur.SetFocus
    Form_man_tab.Btn_eli_cur.Enabled = False
    Call LlenaCombo(Form_man_tab.Cmb_mod_cur, "codigos_ensenanza", "des_ens", "order by ord_ens", conn)
    Call LlenaCombo(Form_man_tab.Cmb_jor_cur, "jornadas", "des_jor", "order by des_jor", conn)
    LlenaCombo cmb_agno, "matriculas", "distinct anno_mat", "order by anno_mat desc", conn
'    Call combonombreconcomas(Form_man_tab.Cmb_prof_cur, "profesores", "Noms_prof", "Ape1_prof", "Ape2_prof")
    
    rs.CursorLocation = adUseClient
    rs.Open "SELECT * FROM profesores order by ape1_prof, ape2_prof, noms_prof", conn
    If rs.RecordCount > 0 Then
        ReDim aprofesores(rs.RecordCount)
        Indi = 0
        X = 0
        While Not rs.EOF
            Form_man_tab.Cmb_prof_cur.AddItem rs("ape1_prof") + " " + rs("ape2_prof") + " " + rs("noms_prof")
            aprofesores(X) = rs("rut_prof")
            rs.MoveNext
            X = X + 1
        Wend
    End If
    rs.Close
    Call LlenaCombo(Form_man_tab.cmb_numsal_cur, "salas", "num_sal", "order by num_sal", conn)
    Call LlenaCombo(Form_man_tab.cmb_cap_sala, "salas", "capacidad_sal", "", conn)
    Form_man_tab.txt_vac_cur.Text = 0

ElseIf ManTab = "com" Then
    Form_man_tab.Height = 3050
    Form_man_tab.Width = 8150
    Form_man_tab.frame_com.Left = 80
    Form_man_tab.frame_com.Top = 20
    Call Form_main.HideFRame
    Form_man_tab.frame_com.Visible = True
    CentrarForma Me
    Form_man_tab.Show
    Form_man_tab.txt_com_com.SetFocus
    Form_man_tab.txt_pro_com.Enabled = False
    Form_man_tab.txt_reg_com.Enabled = False
    Form_man_tab.txt_cod_com.Enabled = False
    Form_man_tab.BTN_ELI_COM.Enabled = False
End If

End Sub


Private Sub lst_ape_pro_DblClick()
Dim rutprof As String
Indi = 0
Busqueda = 0
RutProfe = aprofesores(lst_ape_pro.ListIndex)
a = "SELECT * FROM profesores where rut_prof = " & "'" & RutProfe & "'"
rs.CursorLocation = adUseClient
rs.Open a, conn
If rs.RecordCount > 0 Then
    apellido_p = rs("ape1_prof")
    apellido_m = rs("ape2_prof")
    nombres = rs("noms_prof")
    rutprof = rs("rut_prof")
    direccion = rs("dir_prof")
    Comuna = rs("comuna_prof")
    Form_man_tab.cmb_ciu_pro.Visible = True
    fono = rs("fon_prof")
    horario = rs("hor_ate_prof")
    perfil = rs("cod_perfil")
    rs.Close
    Me.txt_ape_pro.Text = apellido_p
    Me.txt_ape2_pro.Text = apellido_m
    Me.txt_nom_pro.Text = nombres
    Me.txt_rut_pro.Text = separarut(rutprof)
    Me.txt_dig_pro.Text = separadigito(rutprof)
    Me.txt_dir_pro.Text = direccion
    Me.cmb_comuna_pro.Text = DevuelveCampo("codigos__geograficos", "", "comuna", "cod_geo = '" & Comuna & "'", conn)
    Me.cmb_ciu_pro.Text = DevuelveCampo("codigos__geograficos", "", "provincia", "cod_geo = '" & Comuna & "'", conn)
    Me.txt_fon_pro.Text = fono
    Me.txt_hor_ate_pro.Text = horario
    Me.cmb_perfiles = DevuelveCampo("perfiles", "", "perfil", "cod_perfil = '" & perfil & "'", conn)
    Me.lst_ape_pro.Visible = False
    Me.Label18.Caption = "Editando Profesor Existente"
    Me.btn_eli_pro.Enabled = True
    Me.txt_ape_pro.SetFocus
    Me.txt_ape_pro.Enabled = True
    Me.txt_nom_pro.Enabled = True
    Me.txt_rut_pro.Enabled = False
    Me.txt_dig_pro.Enabled = False
    Me.txt_dir_pro.Enabled = True
    Me.cmb_comuna_pro.Enabled = True
    Me.txt_fon_pro.Enabled = True
    Me.txt_hor_ate_pro.Enabled = True
    SendKeys "{home}"
End If
Me.btn_ace_pro.Enabled = True
Me.btn_eli_pro.Enabled = True
End Sub

Private Sub lst_ape_pro_GotFocus()
Me.btn_ace_pro.Enabled = False
End Sub

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

End Sub

Private Sub lst_ape_pro_LostFocus()
Me.btn_ace_pro.Enabled = True
End Sub

Private Sub lst_com_com_DblClick()
Indi = 0
Busqueda = 0
comu = acomunas(lst_com_com.ListIndex)
a = "SELECT * FROM codigos__geograficos where comuna = " & "'" & comu & "'"
rs.CursorLocation = adUseClient
rs.Open a, conn
If rs.RecordCount > 0 Then
    codig = rs("cod_geo")
    regio = rs("region")
    provi = rs("provincia")
    comun = rs("comuna")
    rs.Close
    Me.txt_cod_com.Text = codig
    Me.txt_reg_com.Text = regio
    Me.txt_pro_com.Text = provi
    Me.txt_com_com.Text = comun
    Me.txt_cod_com.Enabled = False
    Me.lst_com_com.Visible = False
    Me.txt_com_com.Enabled = True
    Me.txt_reg_com.Enabled = True
    Me.txt_pro_com.Enabled = True
    Me.Label23.Caption = "Editando Comuna Existente"
    Me.BTN_ELI_COM.Enabled = True
    Me.txt_com_com.SetFocus
    SendKeys "{home}"
    End If

End Sub

Private Sub lst_com_com_GotFocus()
Me.btn_ace_com.Enabled = False
End Sub

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

End Sub

Private Sub lst_com_com_LostFocus()
Me.btn_ace_com.Enabled = True
End Sub

Private Sub Lst_conv_DblClick()
Indi = 0
Busqueda = 0
Me.Txt_Des_Conv.Text = Me.Lst_conv.Text
a = "SELECT * FROM convenios where des_conv= " & "'" & Txt_Des_Conv & "'" & " order by cod_conv ASC"
rs.CursorLocation = adUseClient
rs.Open a, conn
If rs.RecordCount > 0 Then
    Txt_cod_Conv.Text = rs("cod_conv")
    Me.Lst_conv.Visible = False
    Me.Label33.Caption = "Editando Convenio existente."
    Me.Btn_Eli_conv.Enabled = True
    Me.Txt_Des_Conv.SetFocus
    SendKeys "{end}"
End If
rs.Close

End Sub

Private Sub Lst_conv_GotFocus()
Me.Btn_Ace_conv.Enabled = False
End Sub

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

End Sub

Private Sub Lst_conv_LostFocus()
Me.Btn_Ace_conv.Enabled = True
End Sub

Private Sub lst_des_deu_DblClick()
Indi = 0
Busqueda = 0
Me.Txt_Des_deu.Text = Me.lst_des_deu.Text
a = "SELECT * FROM tipo_deuda where des_tip_deu = " & "'" & Txt_Des_deu & "'" & " order by cod_tip_deu ASC"
rs.CursorLocation = adUseClient
rs.Open a, conn
If rs.RecordCount > 0 Then
    Txt_cod_deu.Text = rs(0)
    Me.lst_des_deu.Visible = False
    Me.Label14.Caption = "Editando Tipo de Deuda existente."
    Me.Btn_Deu_Eliminar.Enabled = True
    Me.Txt_Des_deu.SetFocus
    SendKeys "{end}"
End If
rs.Close
End Sub

Private Sub lst_des_deu_GotFocus()
Me.Btn_Deu_Aceptar.Enabled = False
End Sub

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

Private Sub lst_des_deu_LostFocus()
Me.Btn_Deu_Aceptar.Enabled = True
End Sub

Private Sub lst_des_mod_DblClick()
    Indi = 0
    Busqueda = 0
    Me.txt_des_mod.Text = Me.lst_des_mod.Text
    a = "SELECT * FROM codigos_ensenanza where des_ens = " & "'" & txt_des_mod & "'" & " order by cod_ens ASC"
    rs.CursorLocation = adUseClient
    rs.Open a, conn
    
    If rs.RecordCount > 0 Then
        Txt_cod_mod.Text = rs(0)
        Txt_Num_Gra_Max.Text = rs(2)
        Me.lst_des_mod.Visible = False
        Me.Label16.Caption = "Editando Tipo de Enseñanza Existente"
        Me.Txt_Num_Gra_Max.Enabled = True
        Me.Btn_eli_mod.Enabled = True
        Me.txt_des_mod.SetFocus
        SendKeys "{end}"
        ingxcodigo = 0
    End If
    rs.Close
End Sub

Private Sub lst_des_mod_GotFocus()
    Me.Btn_ace_mod.Enabled = False
End Sub

Private Sub lst_des_mod_KeyPress(KeyAscii As Integer)
    If KeyAscii = 13 Then
    Call lst_des_mod_DblClick
    End If
End Sub

Private Sub lst_des_mod_LostFocus()
    Me.Btn_ace_mod.Enabled = True
End Sub

Private Sub lst_des_mov_DblClick()
    Indi = 0
    Busqueda = 0
    Me.txt_des_mov.Text = Me.lst_des_mov.Text
    a = "SELECT * FROM mobiliario where des_mob = " & "'" & txt_des_mov & "'" & " order by cod_mob ASC"
    rs.CursorLocation = adUseClient
    rs.Open a, conn
    If rs.RecordCount > 0 Then
        txt_cod_mov.Text = rs(0)
        Me.lst_des_mov.Visible = False
        Me.Label13.Caption = "Modificando registro..."
        Me.btn_eli_mov.Enabled = True
        Me.txt_des_mov.SetFocus
        SendKeys "{end}"
    End If
    rs.Close
End Sub

Private Sub lst_des_mov_GotFocus()
    Me.btn_ace_mov.Enabled = False
End Sub

Private Sub lst_des_mov_KeyPress(KeyAscii As Integer)
    If KeyAscii = 13 Then
        Call lst_des_mov_DblClick
    End If
End Sub

Private Sub lst_des_mov_LostFocus()
Me.btn_ace_mov.Enabled = True
End Sub

Private Sub Lst_des_tipoapo_DblClick()
Indi = 0
Busqueda = 0
Me.Txt_des_tipoapo.Text = Me.Lst_des_tipoapo.Text
a = "SELECT * FROM tipo_apo where des_tipo_apo = " & "'" & Txt_des_tipoapo & "'" & " order by cod_tipo_apo ASC"
rs.CursorLocation = adUseClient
rs.Open a, conn
If rs.RecordCount > 0 Then
    Txt_cod_TipoApo.Text = rs(0)
    Me.Lst_des_tipoapo.Visible = False
    Me.Label12.Caption = "Modificando Tipo de Apoderado existente"
    Me.Btn_Tip_Eliminar.Enabled = True
    Me.Txt_des_tipoapo.SetFocus
    SendKeys "{end}"
End If
rs.Close

End Sub

Private Sub Lst_des_tipoapo_GotFocus()
Me.Btn_Tip_Aceptar.Enabled = False
End Sub

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

Private Sub Lst_des_tipoapo_LostFocus()
Me.Btn_Tip_Aceptar.Enabled = True
End Sub

Private Sub lst_lug_lug_DblClick()
Indi = 0
Busqueda = 0
Me.txt_lug_lug.Text = Me.lst_lug_lug.Text
a = "SELECT * FROM  lugar_accidente where lug_lug = " & "'" & txt_lug_lug & "'" & " order by cod_lug ASC"
rs.CursorLocation = adUseClient
rs.Open a, conn
If rs.RecordCount > 0 Then
    txt_cod_lug.Text = rs(0)
    Me.lst_lug_lug.Visible = False
    Me.Label12.Caption = "Modificando Lugar de Accidente existente"
    Me.btn_eli_lug.Enabled = True
    Me.txt_lug_lug.SetFocus
    SendKeys "{end}"
End If
rs.Close

End Sub

Private Sub lst_lug_lug_GotFocus()
    Me.btn_ace_lug.Enabled = False
End Sub

Private Sub lst_lug_lug_KeyPress(KeyAscii As Integer)
    If KeyAscii = 13 Then
        Call lst_lug_lug_DblClick
    End If
End Sub

Private Sub lst_lug_lug_LostFocus()
    Me.btn_ace_lug.Enabled = True
End Sub

Private Sub lst_usu_desc_DblClick()
    Dim texto As String, CuentaCont As Integer
    Indi = 0
    Busqueda = 0
    Me.Txt_Usu_Desc.Text = Me.lst_usu_desc.Text
    a = "SELECT * FROM usuarios where nombre_completo_usu = " & "'" & Txt_Usu_Desc & "'" & " order by nombre_completo_usu ASC"
    Set rs_Usu = New ADODB.Recordset
    rs_Usu.CursorLocation = adUseClient
    rs_Usu.Open a, conn
    If rs_Usu.RecordCount > 0 Then
        Crea_Tree_Usu '*
        Txt_Usu_Cod.Text = rs_Usu("aut_nombre_usuario")
        Txt_Usu_Pas = rs_Usu("pas_usu")
        Txt_Usu_Cargo = rs_Usu("cargo_usu")
        texto = rs_Usu("priv_usu")
        TextoRS = texto
        
        '*******
        CuentaCont = 1
        For i = 1 To Form_main.Controls.count - 1
            If TypeOf Form_main.Controls.Item(i) Is Menu Then
                If Left(Form_main.Controls.Item(i).Caption, 1) = "-" Then
                Else
                ncontrol1 = Form_main.Controls.Item(i).Name
                MiPos = InStr(1, texto, ncontrol1)
                If MiPos > 0 Then
                    activ = ""
                    MiPos = InStr(MiPos, texto, "#")
                    MiPos = MiPos - 1
                    activ = Mid(texto, MiPos, MiPos + 1)
                    activ = Left(activ, 1)
                    If activ = 1 Then
                        Me.Trv_Menu.Nodes.Item(CuentaCont).Checked = True
                    End If
                End If
                CuentaCont = CuentaCont + 1
                End If
            End If
        Next
        If IsNull(rs_Usu("permiso_usu")) Then
            permiso = "000"
        Else
           permiso = rs_Usu("permiso_usu")
        End If
        Me.Check_Perm.Item(0).Value = val(Left(permiso, 1))
        Me.Check_Perm.Item(1).Value = val(Mid(permiso, 2, 1))
        Me.Check_Perm.Item(2).Value = val(Mid(permiso, 3, 1))
        '****
        
        Me.lst_usu_desc.Visible = False
        Me.Label20.Caption = "Editando Registro Existente..."
        Me.Btn_Usu_Eliminar.Enabled = True
        Me.Btn_Usu_Aceptar.Enabled = True
        Me.Txt_Usu_Desc.SetFocus
        SendKeys "{end}"
        SSTab1.TabEnabled(0) = False
    End If
    rs_Usu.Close


End Sub

Private Sub lst_usu_desc_GotFocus()
Me.Btn_Usu_Aceptar.Enabled = False
End Sub

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

End Sub

Private Sub lst_usu_desc_LostFocus()
Me.Btn_Usu_Aceptar.Enabled = True
End Sub


Private Sub txt_ape_pro_Change()
If Busqueda = 1 Then
rs.CursorLocation = adUseClient
'fetch the initial table ..
'rs.Open "SELECT * FROM tipo_apo", conn
lst_ape_pro.Clear
If Not ((Chr(KeyAscii) >= "A" And Chr(KeyAscii) <= "Z") Or (Chr(KeyAscii) >= "a" And Chr(KeyAscii) <= "z")) Then
    KeyAscii = 0
    If Me.txt_ape_pro.Text <> "" Then
      Criterio = "'" + Me.txt_ape_pro.Text + Consulta + "%'"
      rs.CursorLocation = adUseClient
      rs.Open "SELECT * FROM profesores where ape1_prof like " & Criterio & " order by ape1_prof", conn
      'rs.FindFirst "des_pre like " + Criterio
            'rs.MoveFirst
        lst_ape_pro.Visible = False
        'Me.Txt_cod_TipoApo.Text = ""
        If rs.RecordCount > 0 Then
            ReDim aprofesores(rs.RecordCount)
            Indi = 0
            X = 0
            While Not rs.EOF
                'Me.Txt_cod_TipoApo.Text = rs(0)
                lst_ape_pro.AddItem rs("ape1_prof") + " " + rs("ape2_prof") + " " + rs("noms_prof")
                aprofesores(X) = rs("rut_prof")
                lst_ape_pro.Visible = True
                rs.MoveNext
                X = X + 1
            Wend
        Else
            Me.Label18.Caption = "Ingresando Nuevo Profesor"
            Indi = 0
        End If
        rs.Close
    Else
    lst_ape_pro.Visible = False
    End If
End If
End If

End Sub

Private Sub txt_ape_pro_KeyPress(KeyAscii As Integer)
If KeyAscii = 27 Then
    Me.txt_ape_pro.Text = ""
    Me.txt_nom_pro.Text = ""
    Me.txt_rut_pro.Text = ""
    lst_ape_pro.Visible = False
    KeyAscii = 0
ElseIf KeyAscii = 13 And Len(Trim(Me.txt_ape_pro.Text)) <> 0 And Busqueda = 0 Then
    Me.txt_ape2_pro.Enabled = True
    Me.txt_ape2_pro.SetFocus
    Me.lst_ape_pro.Visible = False
ElseIf KeyAscii = 13 And Len(Trim(Me.txt_ape_pro.Text)) <> 0 And Busqueda = 1 And Not valorenlista(Form_man_tab.lst_ape_pro, txt_ape_pro.Text) Then
    Me.txt_ape2_pro.Enabled = True
    Me.txt_ape2_pro.SetFocus
    Me.lst_ape_pro.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_tipoapo.Text = "" Then
        If KeyAscii = 37 Then Exit Sub
End If

End Sub

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

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


Private Sub txt_cod_com_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 And Len(Trim(Me.txt_cod_com.Text)) <> 0 Then
    Call btn_ace_com_Click
End If
End Sub

Private Sub Txt_cod_mod_KeyPress(KeyAscii As Integer)
rs.CursorLocation = adUseClient

If KeyAscii = 13 And Len(Trim(Me.Txt_cod_mod.Text)) <> 0 Then
    If Len(Trim(Me.txt_des_mod.Text)) <> 0 Then
        If ExistReg("codigos_ensenanza", "cod_ens='" & Txt_cod_mod & "'", conn) Then
            MsgBox ("Código de Enseñanza ya existe")
            Me.Txt_cod_mod.SetFocus
            SendKeys "{home}+{end}"
        Else
            Me.Txt_Num_Gra_Max.Enabled = True
            Me.Txt_Num_Gra_Max.SetFocus
        End If
    Else
        rs.CursorLocation = adUseClient
        rs.Open "SELECT * FROM codigos_ensenanza where cod_ens = '" & Me.Txt_cod_mod.Text & "'", conn
        If rs.RecordCount > 0 Then
            Busqueda = 0
            Me.Txt_cod_mod.Enabled = False
            Me.Txt_Num_Gra_Max.Enabled = True
            Me.txt_des_mod.Text = rs("des_ens")
            Me.Txt_Num_Gra_Max.Text = rs("num_gra_max")
            Me.Label16.Caption = "Editando Tipo de Enseñanza Existente"
            Me.Btn_eli_mod.Enabled = True
            Me.txt_des_mod.SetFocus
        Else
            Busqueda = 0
            Me.txt_des_mod.SetFocus
            Me.Label16.Caption = "Ingresando Nuevo Tipo de Enseñanza"
            Me.Btn_eli_mod.Enabled = False
            ingxcodigo = 1
        End If
        rs.Close
    End If
ElseIf (Chr(KeyAscii) >= "0" And Chr(KeyAscii) <= "9") Then Exit Sub
ElseIf KeyAscii = 8 Then Exit Sub
ElseIf KeyAscii = 32 Then Exit Sub
End If
KeyAscii = 0
End Sub

Private Sub txt_com_com_Change()
If Busqueda = 1 Then
rs.CursorLocation = adUseClient
lst_com_com.Clear
If Not ((Chr(KeyAscii) >= "A" And Chr(KeyAscii) <= "Z") Or (Chr(KeyAscii) >= "a" And Chr(KeyAscii) <= "z")) Then
    KeyAscii = 0
    If Len(Trim(Me.txt_com_com.Text)) <> 0 Then
      Criterio = "'" + Me.txt_com_com.Text + Consulta + "%'"
       rs.Open "SELECT * FROM codigos__geograficos where comuna like " & Criterio & " order by comuna", conn
        lst_com_com.Visible = False
        If rs.RecordCount > 0 Then
            ReDim acomunas(rs.RecordCount)
            Indi = 0
            X = 0
            While Not rs.EOF
                lst_com_com.AddItem rs("comuna")
                acomunas(X) = rs("comuna")
                lst_com_com.Visible = True
                rs.MoveNext
                X = X + 1
            Wend
        Else
            Me.Label23.Caption = "Ingresando Nueva Comuna"
            Indi = 0
        End If
        rs.Close
    Else
    lst_com_com.Visible = False
    End If
End If
End If


End Sub

Private Sub txt_com_com_KeyPress(KeyAscii As Integer)
'busqueda = 1
If KeyAscii = 27 Then
    txt_com_com.Text = ""
    lst_com_com.Visible = False
    txt_pro_com.Text = ""
    txt_reg_com.Text = ""
    txt_cod_com.Text = ""
    KeyAscii = 0

ElseIf KeyAscii = 13 And Len(Trim(Me.txt_com_com.Text)) <> 0 And Busqueda = 0 Then
    Me.txt_pro_com.Enabled = True
    Me.txt_pro_com.SetFocus
    Me.lst_com_com.Visible = False

ElseIf KeyAscii = 13 And Len(Trim(Me.txt_com_com.Text)) <> 0 And Busqueda = 1 And Not valorenlista(Form_man_tab.lst_com_com, txt_com_com.Text) Then
    Me.txt_pro_com.Enabled = True
    Me.txt_pro_com.SetFocus
    Me.lst_com_com.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_com_com.Text = "" Then
        If KeyAscii = 37 Then Exit Sub
End If
    KeyAscii = 0: Exit Sub

End Sub

Private Sub Txt_Des_Conv_Change()
If Busqueda = 1 Then
  rs.CursorLocation = adUseClient
Lst_conv.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_Conv.Text <> "" Then
      Criterio = "'" + Me.Txt_Des_Conv.Text + Consulta + "%'"
      rs.CursorLocation = adUseClient
      rs.Open "SELECT * FROM convenios where des_conv like " & Criterio & " order by cod_conv", conn
        Lst_conv.Visible = False
        Me.Txt_cod_Conv.Text = ""
        If rs.RecordCount > 0 Then
            Indi = 0
            While Not rs.EOF
                Me.Txt_cod_Conv.Enabled = False
                Lst_conv.AddItem rs("des_conv")
                Lst_conv.Visible = True
                rs.MoveNext
            Wend
        Else
            Me.Label33.Caption = "Ingresando Nuevo Convenio."
            Indi = 0
        End If
        rs.Close
    Else
    Lst_conv.Visible = False
    Me.Txt_cod_Conv.Enabled = True
    Me.Txt_cod_Conv.Text = ""
    End If
End If
End If
End Sub

Private Sub Txt_Des_Conv_KeyPress(KeyAscii As Integer)
If KeyAscii = 27 Then
    Txt_Des_Conv.Text = ""
    Lst_conv.Visible = False
    KeyAscii = 0
ElseIf KeyAscii = 13 And Len(Trim(Me.Txt_Des_Conv.Text)) <> 0 And Busqueda = 0 Then
    Call Btn_Ace_conv_Click
ElseIf KeyAscii = 13 And Len(Trim(Me.Txt_Des_Conv.Text)) <> 0 And Busqueda = 1 And Not valorenlista(Form_man_tab.Lst_conv, Txt_Des_Conv.Text) Then
    Me.Lst_conv.Visible = False
    Call Btn_Ace_conv_Click

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_Conv.Text = "" Then
        If KeyAscii = 37 Then Exit Sub
End If
    KeyAscii = 0: Exit Sub

End Sub

Private Sub Txt_Des_deu_Change()
If Busqueda = 1 Then
  rs.CursorLocation = adUseClient
lst_des_deu.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_deu.Text <> "" Then
      Criterio = "'" + Me.Txt_Des_deu.Text + Consulta + "%'"
      rs.CursorLocation = adUseClient
      rs.Open "SELECT * FROM tipo_deuda where des_tip_deu like " & Criterio & " order by cod_tip_deu", conn
        lst_des_deu.Visible = False
        Me.Txt_cod_deu.Text = ""
        If rs.RecordCount > 0 Then
            Indi = 0
            While Not rs.EOF
                Me.Txt_cod_deu.Enabled = False
                lst_des_deu.AddItem rs(1)
                lst_des_deu.Visible = True
                rs.MoveNext
            Wend
        Else
            Me.Label14.Caption = "Editando Tipo de Deuda."
            Indi = 0
        End If
        rs.Close
    Else
    lst_des_deu.Visible = False
    Me.Txt_cod_deu.Enabled = True
    Me.Txt_cod_deu.Text = ""
    End If
End If
End If
End Sub


Private Sub Txt_Des_deu_KeyPress(KeyAscii As Integer)
If KeyAscii = 27 Then
    Txt_Des_deu.Text = ""
    lst_des_deu.Visible = False
    KeyAscii = 0
ElseIf KeyAscii = 13 And Len(Trim(Me.Txt_Des_deu.Text)) <> 0 Then
        Call Btn_Deu_Aceptar_Click
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_deu.Text = "" Then
        If KeyAscii = 37 Then Exit Sub
End If
    KeyAscii = 0: Exit Sub
End Sub

Private Sub txt_des_mod_Change()
If Busqueda = 1 Then
  rs.CursorLocation = adUseClient
lst_des_mod.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_mod.Text <> "" Then
      Criterio = "'" + Me.txt_des_mod.Text + Consulta + "%'"
      rs.CursorLocation = adUseClient
      rs.Open "SELECT * FROM codigos_ensenanza where des_ens like " & Criterio & " order by cod_ens", conn
        lst_des_mod.Visible = False
        If rs.RecordCount > 0 Then
            Me.Label16.Caption = ""
            Indi = 0
            While Not rs.EOF
                Me.Txt_cod_mod.Enabled = False
                lst_des_mod.AddItem rs(1)
                lst_des_mod.Visible = True
                rs.MoveNext
            Wend
        Else
            Me.Label16.Caption = "Ingresando Nuevo Tipo de Enseñanza"
            Me.Btn_eli_mod.Enabled = False
            Indi = 0
        End If
        rs.Close
    Else
    lst_des_mod.Visible = False
    Me.Txt_cod_mod.Enabled = True
    Me.Txt_cod_mod.Text = ""
    End If
End If
End If
End Sub

Private Sub txt_des_mod_KeyPress(KeyAscii As Integer)
    If KeyAscii = 27 Then
        txt_des_mod.Text = ""
        lst_des_mod.Visible = False
        KeyAscii = 0

    ElseIf KeyAscii = 13 And Len(Trim(Me.txt_des_mod.Text)) <> 0 And Busqueda = 0 Then
        Me.Txt_Num_Gra_Max.Enabled = True
        Me.Txt_Num_Gra_Max.SetFocus
        Me.lst_des_mod.Visible = False

    ElseIf KeyAscii = 13 And Len(Trim(Me.txt_des_mod.Text)) <> 0 And Busqueda = 1 And Not valorenlista(Form_man_tab.lst_des_mod, txt_des_mod.Text) Then
        Me.Txt_cod_mod.Enabled = True
        Me.Txt_cod_mod.SetFocus
     Me.lst_des_mod.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_mod.Text = "" Then
        If KeyAscii = 37 Then Exit Sub
    End If
End Sub

Private Sub txt_des_mov_Change()
If Busqueda = 1 Then
    rs.CursorLocation = adUseClient
lst_des_mov.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_mov.Text <> "" Then
      Criterio = "'" + Me.txt_des_mov.Text + Consulta + "%'"
      rs.CursorLocation = adUseClient
      rs.Open "SELECT * FROM mobiliario where des_mob like " & Criterio & " order by cod_mob", conn
        lst_des_mov.Visible = False
        Me.txt_cod_mov.Text = ""
        If rs.RecordCount > 0 Then
            Indi = 0
            While Not rs.EOF
                Me.txt_cod_mov.Enabled = False
                lst_des_mov.AddItem rs(1)
                lst_des_mov.Visible = True
                rs.MoveNext
            Wend
        Else
            Me.Label13.Caption = "Ingresando nuevo Mobiliario."
            Indi = 0
        End If
        rs.Close
    Else
    lst_des_mov.Visible = False
    Me.txt_cod_mov.Enabled = True
    Me.txt_cod_mov.Text = ""
    End If
End If
End If
End Sub

Private Sub txt_des_mov_KeyPress(KeyAscii As Integer)
If KeyAscii = 27 Then
    txt_des_mov.Text = ""
    lst_des_mov.Visible = False
    KeyAscii = 0
ElseIf KeyAscii = 13 And Len(Trim(Me.txt_des_mov.Text)) <> 0 Then
        Call btn_ace_mov_Click
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_mov.Text = "" Then
        If KeyAscii = 37 Then Exit Sub
End If
End Sub

Private Sub Txt_des_tipoapo_Change()
If Busqueda = 1 Then
  rs.CursorLocation = adUseClient
Lst_des_tipoapo.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_tipoapo.Text <> "" Then
      Criterio = "'" + Me.Txt_des_tipoapo.Text + Consulta + "%'"
      rs.CursorLocation = adUseClient
      rs.Open "SELECT * FROM tipo_apo where des_tipo_apo like " & Criterio & " order by cod_tipo_apo", conn
        Lst_des_tipoapo.Visible = False
        Me.Txt_cod_TipoApo.Text = ""
        If rs.RecordCount > 0 Then
            Indi = 0
            While Not rs.EOF
                Me.Txt_cod_TipoApo.Enabled = False
                Lst_des_tipoapo.AddItem rs(1)
                Lst_des_tipoapo.Visible = True
                rs.MoveNext
            Wend
        Else
            Me.Label12.Caption = "Ingresando Nuevo Tipo de Apoderado"
            Indi = 0
        End If
        rs.Close
    Else
    Lst_des_tipoapo.Visible = False
    Me.Txt_cod_TipoApo.Enabled = True
    Me.Txt_cod_TipoApo.Text = ""
    End If
End If
End If

End Sub

Private Sub Txt_des_tipoapo_KeyPress(KeyAscii As Integer)
If KeyAscii = 27 Then
    Txt_des_tipoapo.Text = ""
    Lst_des_tipoapo.Visible = False
    KeyAscii = 0
ElseIf KeyAscii = 13 And Len(Trim(Me.Txt_des_tipoapo.Text)) <> 0 And Busqueda = 0 Then
    Call Btn_Tip_Aceptar_Click
ElseIf KeyAscii = 13 And Len(Trim(Me.Txt_des_tipoapo.Text)) <> 0 And Busqueda = 1 And Not valorenlista(Form_man_tab.Lst_des_tipoapo, Txt_des_tipoapo.Text) Then
    Call Btn_Tip_Aceptar_Click

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_tipoapo.Text = "" Then
        If KeyAscii = 37 Then Exit Sub
End If
End Sub

Private Sub txt_dig_pro_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 And Len(Trim(Me.txt_dig_pro.Text)) <> 0 Then
    If txt_dig_pro.Text = digito(txt_rut_pro.Text) Then
        Me.txt_dir_pro.Enabled = True
        Me.txt_dir_pro.SetFocus
    Else
        MsgBox "El rut ingresado no es válido", vbOKOnly, "Atención"
        Me.txt_dig_pro.SetFocus
        SendKeys "{home}+{end}"
    End If
End If
End Sub

Private Sub txt_dig_pro_LostFocus()
    If ExistReg("profesores", "rut_prof = '" & Me.txt_rut_pro & "-" & Me.txt_dig_pro & "'", conn) Then
        MsgBox ("El rut del alumno ya existe en el sistema")
        Me.txt_rut_pro.SetFocus
        SendKeys "{home}+{end}"
    End If
End Sub

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

Private Sub txt_fon_pro_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
    Me.txt_hor_ate_pro.Enabled = True
    Me.txt_hor_ate_pro.SetFocus
ElseIf (Chr(KeyAscii) >= "0" And Chr(KeyAscii) <= "9") Then Exit Sub
ElseIf KeyAscii = 8 Then Exit Sub
ElseIf KeyAscii = 32 Then Exit Sub
End If
KeyAscii = 0
End Sub

Private Sub txt_hor_ate_pro_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
    btn_ace_pro_Click
End If
End Sub

Private Sub txt_let_cur_KeyPress(KeyAscii As Integer)
    Dim str As String
    If cmb_agno.Text = "" Then MsgBox "Ingrese el año de Proceso": txt_let_cur.Text = "": Exit Sub
    If KeyAscii = 13 And Len(Trim(Me.txt_let_cur.Text)) <> 0 And Busqueda = 1 Then
        Codens = DevuelveCampo("codigos_ensenanza", "des_ens", "cod_ens", "des_ens =" & "'" & Me.Cmb_mod_cur.Text & "'", conn)
        nivel = Me.Cmb_num_gra_cur.Text
        letra = UCase(Me.txt_let_cur.Text)
        numsala = Me.cmb_numsal_cur.Text
        Capacidad = Me.cmb_cap_sala.Text
        str = "cod_ens= " & "'" & Codens & "'" & " and num_gra = " & "'" & nivel & "'" & "and let_cur = " & "'" & letra & "' and agno = " & cmb_agno.Text & ""
        If ExistReg("cursos", str, conn) Then
            rs.CursorLocation = adUseClient
            rs.Open "select * from cursos where cod_ens= " & "'" & Codens & "'" & " and num_gra = " & "'" & Me.Cmb_num_gra_cur.Text & "'" & "and let_cur = " & "'" & Trim(Me.txt_let_cur.Text) & "' and agno = " & cmb_agno.Text & ""
            If rs.RecordCount > 0 Then
                CodJornada = rs("cod_jor")
                RutProfe = rs("rut_prof")
                numerosala = IIf(IsNull(rs("num_sal")), 0, rs("num_sal"))
                Vacantes = IIf(IsNull(rs("vacantes_cur")), 0, rs("vacantes_cur"))
                rs.Close
                Me.cmb_cap_sala = DevuelveCampo("salas", "", "capacidad_sal", "num_sal = '" & numerosala & "'", conn)
                jornada = DevuelveCampo("jornadas", "", "des_jor", "cod_jor = '" & CodJornada & "'", conn)
                rs.CursorLocation = adUseClient
                rs.Open "select ape1_prof, ape2_prof, noms_prof from profesores where rut_prof = '" & RutProfe & "'", conn
                    If rs.RecordCount > 0 Then
                        profe = rs("ape1_prof") + " " + rs("ape2_prof") + " " + rs("noms_prof")
                    End If
                rs.Close
                Me.Cmb_jor_cur.Text = jornada
                Me.Cmb_prof_cur.Text = profe
                Me.cmb_numsal_cur.Text = numerosala
                Set RsAux = New ADODB.Recordset
                RsAux.CursorLocation = adUseClient
                AF = "select p.ci_alu from  postulantes p, alu_x_cur a where p.ci_alu = a.ci_alu and a.activo_alu='SI' and a.cod_ens = '" & Codens & " ' and a.num_gra = '" & nivel & "' and a.let_cur ='" & letra & "' and a.agno='" & val(cmb_agno.Text) & "' order by ape_pat_alu, ape_mat_alu, nom_alu, ci_alu ASC"
                ' LA INSTRUCCION MENCIONADA RECIÉN ES UN TRUCO PARA EVITAR LA CAÍDA DE
                ' LA TABLA ALU_X_CUR Y QUE NO ARROJE EL FAMOSISIMO ERROR QUE ME HA HECHO
                ' SOÑAR NOCHE TRAS NOCHE......"E-FAIL" al parecer el select * lo bota
                ' creo que es conveniente mencionar los campos
                RsAux.Open AF, conn
                OCUPADOS = RsAux.RecordCount
                RsAux.Close
                DISPONIBLES = Vacantes - OCUPADOS
                Capacidad = val(Me.cmb_cap_sala.Text)
                
                Me.txt_alu_vac.Text = OCUPADOS
                Me.txt_vac_cur.Text = DISPONIBLES
                Me.txt_vac_ini.Text = Vacantes
                Me.Cmb_mod_cur.Enabled = False
                Me.Cmb_num_gra_cur.Enabled = False
                Me.txt_let_cur.Enabled = False
                Me.cmb_numsal_cur.Enabled = True
                Me.Cmb_prof_cur.Enabled = True
                Me.txt_vac_cur.Enabled = False
                
                Me.Cmb_jor_cur.Enabled = True
                Me.Cmb_jor_cur.SetFocus
                Me.Label25.Caption = "Modificando Curso"
                Busqueda = 0
                Me.Btn_eli_cur.Enabled = True
               
            
            
            End If
    '        Call btn_ace_cur_Click
        Else
            Me.Label25.Caption = "Ingresando Nuevo Curso"
            Me.Cmb_jor_cur.Enabled = True
            Me.Cmb_jor_cur.SetFocus
            Me.Cmb_prof_cur.Enabled = True
            Me.cmb_numsal_cur.Enabled = True
            Me.txt_cap_sal.Text = 0
            Me.txt_alu_vac.Text = 0
            Me.txt_vac_ini.Text = 0
            Me.txt_vac_cur.Text = 0
        End If
    ElseIf (Chr(KeyAscii) >= "A" And Chr(KeyAscii) <= "Z") Then Exit Sub
    ElseIf KeyAscii = 8 Then Exit Sub
    ElseIf KeyAscii = 32 Then Exit Sub
    End If
    KeyAscii = 0
End Sub

Private Sub txt_lug_lug_Change()

If Busqueda = 1 Then
  rs.CursorLocation = adUseClient
'fetch the initial table ..
'rs.Open "SELECT * FROM tipo_apo", conn
lst_lug_lug.Clear
If Not ((Chr(KeyAscii) >= "A" And Chr(KeyAscii) <= "Z") Or (Chr(KeyAscii) >= "a" And Chr(KeyAscii) <= "z")) Then
    KeyAscii = 0
    If Me.txt_lug_lug.Text <> "" Then
      Criterio = "'" + Me.txt_lug_lug.Text + Consulta + "%'"
      rs.CursorLocation = adUseClient
      rs.Open "SELECT * FROM lugar_accidente where lug_lug like " & Criterio & " order by cod_lug", conn
      'rs.FindFirst "des_pre like " + Criterio
            'rs.MoveFirst
        lst_lug_lug.Visible = False
        Me.txt_cod_lug.Text = ""
        If rs.RecordCount > 0 Then
            Indi = 0
            While Not rs.EOF
                'Me.Txt_cod_TipoApo.Text = rs(0)
                Me.txt_cod_lug.Enabled = False
                lst_lug_lug.AddItem rs(1)
                lst_lug_lug.Visible = True
                rs.MoveNext
            Wend
        Else
            Me.Label15.Caption = "Ingresando nuevo Lugar de Accidente."
            Indi = 0
        End If
        rs.Close
    Else
    lst_lug_lug.Visible = False
    Me.txt_cod_lug.Enabled = True
    Me.txt_cod_lug.Text = ""
    End If
End If
End If
End Sub

Private Sub txt_lug_lug_KeyPress(KeyAscii As Integer)
'busqueda = 1
If KeyAscii = 27 Then
    txt_lug_lug.Text = ""
    lst_lug_lug.Visible = False
    KeyAscii = 0
ElseIf KeyAscii = 13 And Len(Trim(Me.txt_lug_lug.Text)) <> 0 Then
        Call btn_ace_lug_Click
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_lug_lug.Text = "" Then
        If KeyAscii = 37 Then Exit Sub
End If
    'KeyAscii = 0: Exit Sub



End Sub

Private Sub txt_nom_pro_KeyPress(KeyAscii As Integer)
If KeyAscii = 27 Then
    txt_nom_pro.Text = ""
    lst_ape_pro.Visible = False
    KeyAscii = 0
ElseIf KeyAscii = 13 And Len(Trim(Me.txt_nom_pro.Text)) <> 0 Then
    If Busqueda = 1 Then
        Me.txt_rut_pro.Enabled = True
        Me.txt_rut_pro.SetFocus
        Me.lst_ape_pro.Visible = False
    Else
        Me.lst_ape_pro.Visible = False
        Me.txt_dir_pro.SetFocus
    End If
'ElseIf KeyAscii = 13 And Len(Me.txt_des_mod.Text) <> 0 And Busqueda = 1 Then
'    Call Btn_ace_mod_Click
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_Usu_Desc.Text = "" Then
        If KeyAscii = 37 Then Exit Sub
End If
    'KeyAscii = 0: Exit Sub

End Sub


Private Sub Txt_Num_Gra_Max_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 And Len(Trim(Me.Txt_Num_Gra_Max.Text)) <> 0 Then
    Call Btn_ace_mod_Click
ElseIf (Chr(KeyAscii) >= "0" And Chr(KeyAscii) <= "9") Then Exit Sub
ElseIf KeyAscii = 8 Then Exit Sub
ElseIf KeyAscii = 32 Then Exit Sub
End If
KeyAscii = 0
End Sub

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

Private Sub txt_num_sal_KeyPress(KeyAscii As Integer)
'busqueda = 1
If KeyAscii = 27 Then
    txt_num_sal.Text = ""
    KeyAscii = 0
ElseIf KeyAscii = 13 And Len(Trim(Me.txt_num_sal.Text)) <> 0 And Busqueda = 1 Then
rs.CursorLocation = adUseClient
rs.Open "select * from salas where num_sal =" & Trim(Me.txt_num_sal.Text), conn
    If rs.RecordCount > 0 Then
        pisosala = rs("piso_sal")
        capacsala = rs("capacidad_sal")
        'mobiliario = rs("cod_mob")
        nummesas = rs("num_mesa_sal")
        numsillas = rs("num_silla_sal")
        
        rs.Close
        Me.txt_pis_sal.Text = pisosala
        Me.txt_cap_sal.Text = capacsala
        rs.CursorLocation = adUseClient
        rs.Open "select cod_ens, num_gra, let_cur , cod_jor from cursos where num_sal ='" & Me.txt_num_sal.Text & "'", conn
        If rs.RecordCount > 0 Then
            Codens = rs("cod_ens")
            NumGra = rs("num_gra")
            LetCur = rs("let_cur")
            codjor = rs("cod_jor")
            rs.Close
            cursoensala = NumGra + "º " + LetCur + " " + DevuelveCampo("codigos_ensenanza", "", "des_ens", "cod_ens = '" & Codens & "'", conn) + Chr(13) + "Jornada : " + DevuelveCampo("jornadas", "", "des_jor", "cod_jor = '" & codjor & "'", conn)
            rs.CursorLocation = adUseClient
            rs.Open "select ci_alu from alu_x_cur a where cod_ens = '" & Codens & "'and num_gra = '" & NumGra & "' and let_cur = '" & LetCur & "' and a.activo_alu ='SI'", conn
            alumnosensala = rs.RecordCount
            rs.Close
        End If
        
        
        'a = "select  a.ci_alu from alu_x_cur a, cursos c, salas s where a.cod_ens = c.cod_ens and a.num_gra = c.num_gra and a.let_cur = c.let_cur and a.activo_alu = 'SI' and c.num_sal= '" & Me.txt_num_sal.Text & "'"
        'rs.Open a, conn
        
        'rs.Close
        'aluensala = CuentaReg("alu_x_cur a, cursos c, salas s", "a.cod_ens = c.cod_ens and a.num_gra = c.num_gra and a.let_cur = c.let_cur and a.activo_alu = 'SI' and c.num_sal= '" & Me.txt_num_sal.Text & "'")
        
        
        Busqueda = 0
        
        Me.txt_num_sal.Enabled = False
        Me.txt_pis_sal.Enabled = True
        Me.txt_cap_sal.Enabled = True
        
        'Me.cmb_mob_sal = devuelvecampo("mobiliario", "", "des_mob", "cod_mob = '" & mobiliario & "'", conn)
'        If Len(Trim(Me.cmb_mob_sal.Text)) <> 0 Then
'            'Me.cmb_mob_sal.Enabled = True
'            Me.txt_num_mes.Enabled = True
'            Me.txt_num_sill.Enabled = True
'        Else
'            'Me.cmb_mob_sal.Enabled = False
'            Me.txt_num_mes.Enabled = False
'            Me.txt_num_sill.Enabled = False
'        End If
        Me.txt_num_mes.Text = nummesas
        Me.txt_num_sill.Text = numsillas
        Me.Btn_Sal_Eliminar.Enabled = True
        Me.Label19.Caption = "Modificando Sala existente."
    
    Else
        rs.Close
        Me.Label19.Caption = "Ingresando Nueva Sala."
        Me.Btn_Sal_Eliminar.Enabled = False
        Me.txt_num_sal.SetFocus
        Busqueda = 1
    End If
        Me.txt_pis_sal.Enabled = True
         Me.txt_pis_sal.SetFocus
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_num_sal = "" Then
        If KeyAscii = 37 Then Exit Sub
End If
    KeyAscii = 0: Exit Sub
End Sub

Private Sub txt_num_sill_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 And Len(Trim(Me.txt_num_sill.Text)) <> 0 Then
    Call Btn_Sal_Aceptar_Click
ElseIf (Chr(KeyAscii) >= "0" And Chr(KeyAscii) <= "9") Then Exit Sub
ElseIf KeyAscii = 8 Then Exit Sub
ElseIf KeyAscii = 32 Then Exit Sub
End If
KeyAscii = 0
End Sub

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


Private Sub txt_pro_com_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
    Me.txt_reg_com.Enabled = True
    txt_reg_com.SetFocus
End If
End Sub



Private Sub txt_reg_com_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 And Len(Trim(Me.txt_reg_com.Text)) <> 0 Then
    If Busqueda = 1 Then
        Me.txt_cod_com.Enabled = True
        Me.txt_cod_com.SetFocus
    Else
        btn_ace_com_Click
    End If
End If
End Sub

Private Sub txt_rut_pro_KeyPress(KeyAscii As Integer)
If KeyAscii >= Asc("0") And KeyAscii <= Asc("9") Then Exit Sub
If KeyAscii = 8 Then Exit Sub
If KeyAscii = 32 Then Exit Sub
If KeyAscii = 13 Then
If IsNumeric(txt_rut_pro.Text) And Len(Trim(txt_rut_pro.Text)) > 0 Then
    txt_rut_pro = Format(txt_rut_pro, "00000000")
    Me.txt_dig_pro.Enabled = True
    Me.txt_dig_pro.SetFocus
ElseIf Len(Trim(Me.txt_rut_pro.Text)) >= 1 And Len(Trim(Me.txt_rut_pro.Text)) <= 6 Then
  MsgBox "El rut ingresado no es válido", vbOKOnly, "Atención"
    Me.txt_dig_pro.Text = ""
    txt_rut_pro.Text = ""
    Me.txt_rut_pro.SetFocus
    SendKeys "{home}+{end}"
End If
End If
KeyAscii = 0
End Sub

Private Sub txt_rut_pro_LostFocus()
'If Len(Trim(Me.txt_rut_pro.Text)) > 0 And Len(Trim(Me.txt_rut_pro.Text)) <= 9 Then
'Else
'    Me.txt_rut_pro.Enabled = True
'    Me.txt_rut_pro.SetFocus
'End If
End Sub

Private Sub Txt_Usu_Cargo_KeyPress(KeyAscii As Integer)
    'If KeyAscii = 13 And Len(Me.Txt_Usu_Cargo.Text) <> 0 Then
    '    Me.Txt_Usu_Priv.SetFocus
    'End If

End Sub

Private Sub Txt_Usu_Cod_KeyPress(KeyAscii As Integer)
rs.CursorLocation = adUseClient
If KeyAscii = 13 And Len(Me.Txt_Usu_Cod.Text) <> 0 Then
    If Len(Me.Txt_Usu_Desc.Text) <> 0 Then
        If ExistReg("usuarios", "aut_nombre_usuario='" & Txt_Usu_Cod & "'", conn) Then
            MsgBox ("Nombre de Usuario ya existe")
            Me.Txt_Usu_Cod.SetFocus
            SendKeys "{home}+{end}"
        Else
            Me.Txt_Usu_Pas.Enabled = True
            Me.Txt_Usu_Pas.SetFocus
        End If
    Else
        rs.Open "SELECT * FROM usuarios where aut_nombre_usuario = '" & Me.Txt_Usu_Cod.Text & "'", conn
        If rs.RecordCount > 0 Then
            Busqueda = 0
            Me.Txt_Usu_Cod.Enabled = False
            Me.Txt_Usu_Desc.Text = rs("nombre_completo_usu")
            Me.Txt_Usu_Pas.Text = rs("pas_usu")
            Me.Txt_Usu_Cargo.Text = rs("cargo_usu")
            Me.Label20.Caption = "Editando Registro Existente"
            Me.Btn_Usu_Eliminar.Enabled = True
            Me.Txt_Usu_Desc.SetFocus
        Else
            Busqueda = 0
            Me.Txt_Usu_Desc.SetFocus
            Me.Label20.Caption = "Ingresando Nuevo Registro"
            Me.Btn_Usu_Eliminar.Enabled = False
            ingxcodigo = 1
        End If
        rs.Close
    End If
End If

End Sub

Private Sub Txt_Usu_Desc_Change()
    If Busqueda = 1 Then
        rs_Usu.CursorLocation = adUseClient
               lst_usu_desc.Clear
        If Not ((Chr(KeyAscii) >= "A" And Chr(KeyAscii) <= "Z") Or (Chr(KeyAscii) >= "a" And Chr(KeyAscii) <= "z")) Then
            KeyAscii = 0
            If Me.Txt_Usu_Desc.Text <> "" Then
                Criterio = "'" + Me.Txt_Usu_Desc.Text + Consulta + "%'"
                rs_Usu.Open "SELECT * FROM usuarios where nombre_completo_usu like " & Criterio & " order by nombre_completo_usu", conn
                lst_usu_desc.Visible = False
                If rs_Usu.RecordCount > 0 Then
                    Me.Label20.Caption = ""
                    Indi = 0
                    While Not rs_Usu.EOF
                        Me.Txt_Usu_Cod.Enabled = False
                        lst_usu_desc.AddItem rs_Usu(2)
                        lst_usu_desc.Visible = True
                        rs_Usu.MoveNext
                    Wend
                Else
                    Me.Label20.Caption = "Ingresando Nuevo Registro"
                    Me.Btn_Usu_Eliminar.Enabled = False
                    Indi = 0
                End If
                rs_Usu.Close
            Else
                lst_usu_desc.Visible = False
                Me.Txt_Usu_Cod.Enabled = True
                Me.Txt_Usu_Cod.Text = ""
            End If
        End If
    End If

End Sub

Private Sub Txt_Usu_Desc_KeyPress(KeyAscii As Integer)
    'busqueda = 1
    If KeyAscii = 27 Then
        Txt_Usu_Desc.Text = ""
        lst_usu_cod.Visible = False
        KeyAscii = 0
    ElseIf KeyAscii = 13 And Len(Me.Txt_Usu_Desc.Text) <> 0 And Not valorenlista(Form_man_tab.lst_usu_desc, Txt_Usu_Desc.Text) Then
        Crea_Tree_Usu
        If Busqueda = 1 Then
            Me.Txt_Usu_Cod.Enabled = True
            Me.Txt_Usu_Cod.SetFocus
            Me.lst_usu_desc.Visible = False
        Else
            Me.Txt_Usu_Pas.Enabled = True
            Me.Txt_Usu_Pas.SetFocus
            Me.lst_usu_desc.Visible = False
        End If
    ElseIf ((Chr(KeyAscii) >= "A" And Chr(KeyAscii) <= "Z") Or (Chr(KeyAscii) >= "a" And Chr(KeyAscii) <= "z")) Then Exit Sub
    ElseIf (Chr(KeyAscii) >= "0" And Chr(KeyAscii) <= "9") Then Exit Sub
    ElseIf KeyAscii = 8 Then Exit Sub
    ElseIf KeyAscii = 32 Then Exit Sub
    ElseIf Me.Txt_Usu_Desc.Text = "" Then
            If KeyAscii = 37 Then Exit Sub
    End If
End Sub

Private Sub Txt_Usu_Pas_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 And Len(Trim(Me.Txt_Usu_Pas.Text)) <> 0 Then
    Me.Txt_Usu_Cargo.SetFocus
End If

End Sub


Private Sub txt_vac_cur_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 And Len(Trim(Me.txt_vac_cur.Text)) Then
    Call btn_ace_cur_Click
ElseIf (Chr(KeyAscii) >= "0" And Chr(KeyAscii) <= "9") Then Exit Sub
ElseIf KeyAscii = 8 Then Exit Sub
ElseIf KeyAscii = 32 Then Exit Sub
End If
KeyAscii = 0
End Sub

Private Sub TxtNomPer_Change()
    If Busqueda = 1 Then
        rs_Usu.CursorLocation = adUseClient
               LstPer.Clear
        If Not ((Chr(KeyAscii) >= "A" And Chr(KeyAscii) <= "Z") Or (Chr(KeyAscii) >= "a" And Chr(KeyAscii) <= "z")) Then
            KeyAscii = 0
            If Me.TxtNomPer <> "" Then
                Criterio = "'" + Me.TxtNomPer + Consulta + "%'"
                rs_Usu.Open "SELECT * FROM usuarios where nombre_completo_usu like " & Criterio & " and pas_usu ='#P#' order by nombre_completo_usu", conn
                LstPer.Visible = False
                If rs_Usu.RecordCount > 0 Then
                    Me.Label20.Caption = ""
                    Indi = 0
                    While Not rs_Usu.EOF
                        'Me.Txt_Usu_Cod.Enabled = False
                        LstPer.AddItem rs_Usu(2)
                        LstPer.Visible = True
                        rs_Usu.MoveNext
                    Wend
                Else
                    Me.Label20.Caption = "Ingresando Nuevo Registro"
                    Me.BtnEliPer = False
                    Indi = 0
                End If
                rs_Usu.Close
            Else
                LstPer.Visible = False
                'Me.Txt_Usu_Cod.Enabled = True
                'Me.Txt_Usu_Cod.Text = ""
            End If
        End If
    End If


End Sub

Private Sub TxtNomPer_KeyPress(KeyAscii As Integer)
    'busqueda = 1
    If KeyAscii = 27 Then
        TxtNomPer.Text = ""
        lst_usu_cod.Visible = False
        KeyAscii = 0
    ElseIf KeyAscii = 13 And Len(Me.TxtNomPer.Text) <> 0 And Not valorenlista(Form_man_tab.LstPer, TxtNomPer.Text) Then
        Crea_Tree_Usu
        If Busqueda = 1 Then
            'Me.Txt_Usu_Cod.Enabled = True
            'Me.Txt_Usu_Cod.SetFocus
            Me.LstPer.Visible = False
        Else
            Me.Txt_Usu_Pas.Enabled = True
            Me.Txt_Usu_Pas.SetFocus
            Me.LstPer.Visible = False
        End If
    ElseIf ((Chr(KeyAscii) >= "A" And Chr(KeyAscii) <= "Z") Or (Chr(KeyAscii) >= "a" And Chr(KeyAscii) <= "z")) Then Exit Sub
    ElseIf (Chr(KeyAscii) >= "0" And Chr(KeyAscii) <= "9") Then Exit Sub
    ElseIf KeyAscii = 8 Then Exit Sub
    ElseIf KeyAscii = 32 Then Exit Sub
    ElseIf Me.TxtNomPer.Text = "" Then
            If KeyAscii = 37 Then Exit Sub
    End If

End Sub
