VERSION 5.00
Object = "{5E9E78A0-531B-11CF-91F6-C2863C385E30}#1.0#0"; "MSFLXGRD.OCX"
Object = "{86CF1D34-0C5F-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCT2.OCX"
Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.2#0"; "MSCOMCTL.OCX"
Object = "{F39CBE5C-2D1B-11D6-8D4A-0050043A2E60}#2.0#0"; "ProgBarProzent.ocx"
Object = "{9E070136-0FB6-11D3-A1BD-B0EC48C10000}#9.0#0"; "ACXPP.ocx"
Begin VB.Form Form_EstadPost 
   BorderStyle     =   1  'Fixed Single
   ClientHeight    =   10860
   ClientLeft      =   45
   ClientTop       =   330
   ClientWidth     =   15675
   Icon            =   "Form_EstadPost.frx":0000
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MDIChild        =   -1  'True
   MinButton       =   0   'False
   Moveable        =   0   'False
   ScaleHeight     =   10860
   ScaleWidth      =   15675
   Begin VB.Frame Frame_HMayores 
      Caption         =   "Listado de Hermanos Mayores por curso"
      BeginProperty Font 
         Name            =   "Arial"
         Size            =   8.25
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H00C00000&
      Height          =   7095
      Left            =   8280
      TabIndex        =   93
      Top             =   120
      Width           =   7215
      Begin VB.CommandButton Btn_Generar_Listado 
         Caption         =   "Generar Reporte"
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   375
         Left            =   5400
         TabIndex        =   105
         Top             =   1080
         Width           =   1575
      End
      Begin VB.Frame Frame_general 
         Height          =   1815
         Left            =   120
         TabIndex        =   99
         Top             =   240
         Width           =   5055
         Begin VB.ComboBox cmb_mod_cob 
            BeginProperty Font 
               Name            =   "Arial"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   330
            Left            =   120
            TabIndex        =   102
            Top             =   480
            Width           =   3255
         End
         Begin VB.ListBox lst_cursosinf 
            BeginProperty Font 
               Name            =   "Arial"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   1020
            Left            =   3480
            Style           =   1  'Checkbox
            TabIndex        =   101
            Top             =   480
            Width           =   1335
         End
         Begin VB.CheckBox chk_todos_cob 
            Caption         =   "Todos los cursos"
            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        =   100
            Top             =   1200
            Width           =   1575
         End
         Begin VB.Label Label24 
            Caption         =   "Tipo de Enseñanza"
            BeginProperty Font 
               Name            =   "Arial"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   255
            Left            =   120
            TabIndex        =   104
            Top             =   240
            Width           =   1695
         End
         Begin VB.Label Label21 
            Caption         =   "Cursos"
            BeginProperty Font 
               Name            =   "Arial"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   255
            Left            =   3480
            TabIndex        =   103
            Top             =   240
            Width           =   615
         End
      End
      Begin VB.Frame Fram_GrdHermanos 
         Caption         =   "Información"
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H00C00000&
         Height          =   3855
         Left            =   120
         TabIndex        =   96
         Top             =   2640
         Width           =   6975
         Begin MSFlexGridLib.MSFlexGrid Grd_Apod_Cob 
            Height          =   3495
            Left            =   120
            TabIndex        =   97
            Top             =   240
            Width           =   6735
            _ExtentX        =   11880
            _ExtentY        =   6165
            _Version        =   393216
            BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
               Name            =   "Arial"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
         End
      End
      Begin VB.CommandButton btn_impri_HM 
         Caption         =   "Imprimir"
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   375
         Left            =   5640
         TabIndex        =   95
         Top             =   6600
         Width           =   1455
      End
      Begin VB.CommandButton btn_can_cob 
         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            =   5400
         TabIndex        =   94
         Top             =   1680
         Width           =   1575
      End
      Begin ProgBarProzent.ProgBar Prgbar_Cob 
         Height          =   375
         Left            =   120
         TabIndex        =   98
         Top             =   2160
         Width           =   6975
         _ExtentX        =   12303
         _ExtentY        =   661
      End
      Begin VB.Frame Frame_destino 
         Height          =   495
         Left            =   120
         TabIndex        =   106
         Top             =   6480
         Width           =   3300
         Begin VB.OptionButton Opt_destinoHM 
            Caption         =   "Pantalla"
            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            =   1800
            TabIndex        =   108
            Top             =   160
            Width           =   1215
         End
         Begin VB.OptionButton Opt_destinoHM 
            Caption         =   "Impresora"
            BeginProperty Font 
               Name            =   "Arial"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   255
            Index           =   0
            Left            =   240
            TabIndex        =   107
            Top             =   160
            Width           =   1215
         End
      End
   End
   Begin VB.Frame Frame_ranking 
      ForeColor       =   &H00FF0000&
      Height          =   3735
      Left            =   120
      TabIndex        =   71
      Top             =   120
      Width           =   6015
      Begin VB.OptionButton opt_destino_rank 
         Caption         =   "Impresora"
         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            =   1200
         TabIndex        =   89
         Top             =   3250
         Width           =   1335
      End
      Begin VB.OptionButton opt_destino_rank 
         Caption         =   "Pantalla"
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   255
         Index           =   0
         Left            =   120
         TabIndex        =   88
         Top             =   3250
         Width           =   1455
      End
      Begin VB.Frame Frame7 
         Caption         =   "Tipo de informe"
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H00C00000&
         Height          =   2655
         Left            =   120
         TabIndex        =   74
         Top             =   240
         Width           =   2175
         Begin VB.OptionButton Opt_Tinf_Rank 
            Caption         =   "Promedios  por rango"
            Enabled         =   0   'False
            BeginProperty Font 
               Name            =   "Arial"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   255
            Index           =   3
            Left            =   120
            TabIndex        =   92
            Top             =   1440
            Width           =   1935
         End
         Begin VB.ComboBox cmb_desde_rank 
            Enabled         =   0   'False
            BeginProperty Font 
               Name            =   "Arial"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   330
            Left            =   120
            TabIndex        =   86
            Top             =   2160
            Width           =   855
         End
         Begin VB.ComboBox cmb_hasta_rank 
            Enabled         =   0   'False
            BeginProperty Font 
               Name            =   "Arial"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   330
            Left            =   1150
            TabIndex        =   84
            Top             =   2160
            Width           =   855
         End
         Begin VB.OptionButton Opt_Tinf_Rank 
            Caption         =   "Promedios deficientes"
            Enabled         =   0   'False
            BeginProperty Font 
               Name            =   "Arial"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   255
            Index           =   2
            Left            =   120
            TabIndex        =   83
            Top             =   1080
            Width           =   1935
         End
         Begin VB.OptionButton Opt_Tinf_Rank 
            Caption         =   "Ranking por nivel"
            BeginProperty Font 
               Name            =   "Arial"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   255
            Index           =   1
            Left            =   120
            TabIndex        =   82
            Top             =   720
            Width           =   1935
         End
         Begin VB.OptionButton Opt_Tinf_Rank 
            Caption         =   "Ranking por curso"
            BeginProperty Font 
               Name            =   "Arial"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   255
            Index           =   0
            Left            =   120
            TabIndex        =   81
            Top             =   360
            Width           =   1815
         End
         Begin VB.Line linesep1 
            BorderColor     =   &H80000005&
            X1              =   15
            X2              =   2160
            Y1              =   1815
            Y2              =   1815
         End
         Begin VB.Label Label23 
            Alignment       =   2  'Center
            Caption         =   "Desde"
            Enabled         =   0   'False
            BeginProperty Font 
               Name            =   "Arial"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   255
            Left            =   120
            TabIndex        =   87
            Top             =   1920
            Width           =   855
         End
         Begin VB.Label Label22 
            Alignment       =   2  'Center
            Caption         =   "Hasta"
            Enabled         =   0   'False
            BeginProperty Font 
               Name            =   "Arial"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   255
            Left            =   1200
            TabIndex        =   85
            Top             =   1920
            Width           =   735
         End
         Begin VB.Line linesep0 
            BorderColor     =   &H8000000C&
            X1              =   15
            X2              =   2160
            Y1              =   1800
            Y2              =   1800
         End
      End
      Begin VB.CommandButton btn_gen_rep_rank 
         Caption         =   "Generar Informe"
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   375
         Left            =   2640
         TabIndex        =   73
         Top             =   3200
         Width           =   1575
      End
      Begin VB.CommandButton btn_can_rank 
         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            =   4320
         TabIndex        =   72
         Top             =   3200
         Width           =   1575
      End
      Begin VB.Frame Frame5 
         Caption         =   "Criterios"
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H00C00000&
         Height          =   2655
         Left            =   2400
         TabIndex        =   75
         Top             =   240
         Width           =   3495
         Begin VB.ComboBox cb_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            =   1080
            TabIndex        =   109
            Text            =   "Combo1"
            Top             =   1920
            Width           =   2295
         End
         Begin VB.ComboBox cmb_per_rank 
            Appearance      =   0  'Flat
            BeginProperty Font 
               Name            =   "Arial"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   330
            Left            =   1080
            TabIndex        =   90
            Top             =   1320
            Width           =   2295
         End
         Begin VB.ComboBox cmd_mod_rank 
            Appearance      =   0  'Flat
            BeginProperty Font 
               Name            =   "Arial"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   330
            Left            =   120
            TabIndex        =   78
            Top             =   480
            Width           =   3255
         End
         Begin VB.ListBox lst_cursos_rank 
            BeginProperty Font 
               Name            =   "Arial"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   1020
            Left            =   120
            Style           =   1  'Checkbox
            TabIndex        =   77
            Top             =   1320
            Width           =   855
         End
         Begin VB.CheckBox chk_todos_rank 
            Caption         =   "Todos los cursos"
            BeginProperty Font 
               Name            =   "Arial"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   255
            Left            =   1080
            TabIndex        =   76
            Top             =   2280
            Width           =   1575
         End
         Begin VB.Label Label25 
            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            =   1080
            TabIndex        =   110
            Top             =   1680
            Width           =   375
         End
         Begin VB.Label Label18 
            Caption         =   "Periodo"
            BeginProperty Font 
               Name            =   "Arial"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   255
            Left            =   1080
            TabIndex        =   91
            Top             =   1080
            Width           =   615
         End
         Begin VB.Line Line11 
            BorderColor     =   &H8000000C&
            X1              =   20
            X2              =   3485
            Y1              =   960
            Y2              =   960
         End
         Begin VB.Line Line12 
            BorderColor     =   &H80000005&
            X1              =   0
            X2              =   3485
            Y1              =   975
            Y2              =   975
         End
         Begin VB.Label Label19 
            Caption         =   "Cursos"
            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        =   80
            Top             =   1080
            Width           =   615
         End
         Begin VB.Label Label20 
            Caption         =   "Tipo de Enseñanza"
            BeginProperty Font 
               Name            =   "Arial"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   255
            Left            =   120
            TabIndex        =   79
            Top             =   240
            Width           =   1575
         End
      End
      Begin VB.Line Line16 
         BorderColor     =   &H80000005&
         X1              =   15
         X2              =   5900
         Y1              =   3015
         Y2              =   3015
      End
      Begin VB.Line Line15 
         BorderColor     =   &H8000000C&
         X1              =   15
         X2              =   5900
         Y1              =   3000
         Y2              =   3000
      End
   End
   Begin VB.Frame Frame_estadisticas 
      Caption         =   "Generación de estadistícas de postulación"
      BeginProperty Font 
         Name            =   "Arial"
         Size            =   8.25
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H00C00000&
      Height          =   4695
      Left            =   120
      TabIndex        =   33
      Top             =   120
      Width           =   8055
      Begin VB.Frame Frame_fechas_est 
         Caption         =   "Fecha de exámen"
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H00C00000&
         Height          =   1455
         Index           =   0
         Left            =   4200
         TabIndex        =   44
         Top             =   960
         Width           =   3735
         Begin VB.ComboBox cmb_fechaexa_est 
            BeginProperty Font 
               Name            =   "Arial"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   330
            Left            =   1080
            TabIndex        =   24
            Top             =   360
            Width           =   2295
         End
         Begin VB.CheckBox chk_fecha 
            Caption         =   "Consultar desde el primer examen del año de postulación  hasta esta fecha"
            BeginProperty Font 
               Name            =   "Arial"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   375
            Left            =   240
            TabIndex        =   25
            Top             =   840
            Width           =   3375
         End
         Begin VB.Label Label2 
            Caption         =   "Del"
            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        =   47
            Top             =   360
            Width           =   735
         End
      End
      Begin VB.CommandButton btn_EnviarxMail 
         Caption         =   "Enviar por E-Mail"
         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        =   68
         Top             =   3480
         Width           =   1455
      End
      Begin VB.CommandButton btn_rep_cursos 
         Caption         =   "Generar Informe"
         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        =   67
         Top             =   2880
         Width           =   1455
      End
      Begin VB.CommandButton btn_can_cursos 
         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        =   66
         Top             =   4080
         Width           =   1455
      End
      Begin MSComctlLib.ProgressBar Progbar_estad 
         Height          =   255
         Left            =   120
         TabIndex        =   38
         Top             =   4200
         Width           =   6255
         _ExtentX        =   11033
         _ExtentY        =   450
         _Version        =   393216
         Appearance      =   1
      End
      Begin VB.ComboBox cmb_anho_est 
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   330
         Left            =   6480
         TabIndex        =   20
         Top             =   360
         Width           =   1335
      End
      Begin VB.ComboBox cmb_mod_est 
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   330
         Left            =   1800
         TabIndex        =   19
         Top             =   360
         Width           =   3135
      End
      Begin VB.Frame Frame4 
         Caption         =   "Salida"
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H00C00000&
         Height          =   1095
         Left            =   120
         TabIndex        =   35
         Top             =   2760
         Width           =   3495
         Begin VB.OptionButton Opt_destino 
            Caption         =   "Pantalla"
            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            =   2160
            TabIndex        =   31
            Top             =   240
            Width           =   1215
         End
         Begin VB.OptionButton Opt_destino 
            Caption         =   "Impresora"
            BeginProperty Font 
               Name            =   "Arial"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   255
            Index           =   0
            Left            =   120
            TabIndex        =   30
            Top             =   240
            Width           =   1215
         End
         Begin VB.ComboBox cmb_printers 
            BeginProperty Font 
               Name            =   "Arial"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   330
            Left            =   120
            TabIndex        =   32
            Top             =   600
            Width           =   3255
         End
      End
      Begin VB.Frame Frame_tipobusqueda 
         Caption         =   "Tipo de búsqueda"
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H00C00000&
         Height          =   1455
         Left            =   120
         TabIndex        =   23
         Top             =   960
         Width           =   3855
         Begin VB.OptionButton opt_tipobusqueda 
            Caption         =   "Por fecha unica"
            BeginProperty Font 
               Name            =   "Arial"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   195
            Index           =   0
            Left            =   240
            TabIndex        =   21
            Top             =   360
            Width           =   2655
         End
         Begin VB.OptionButton opt_tipobusqueda 
            Caption         =   "Por rango de fechas manuales"
            BeginProperty Font 
               Name            =   "Arial"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   195
            Index           =   2
            Left            =   240
            TabIndex        =   52
            Top             =   1080
            Width           =   2535
         End
         Begin VB.OptionButton opt_tipobusqueda 
            Caption         =   "Por rango de fechas automaticas"
            BeginProperty Font 
               Name            =   "Arial"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   195
            Index           =   1
            Left            =   240
            TabIndex        =   22
            Top             =   720
            Width           =   3015
         End
      End
      Begin VB.Frame Frame_fechas_est 
         Caption         =   "Seleccione el Rango de fechas de exámenes"
         ForeColor       =   &H00FF0000&
         Height          =   1455
         Index           =   1
         Left            =   4200
         TabIndex        =   45
         Top             =   960
         Width           =   3735
         Begin VB.ComboBox cmb_fechaexa2_est 
            Height          =   315
            Left            =   1080
            TabIndex        =   27
            Top             =   840
            Width           =   2295
         End
         Begin VB.ComboBox cmb_fechaexa1_est 
            Height          =   315
            Left            =   1080
            TabIndex        =   26
            Top             =   360
            Width           =   2295
         End
         Begin VB.Label Label11 
            Caption         =   "Al"
            Height          =   255
            Left            =   240
            TabIndex        =   49
            Top             =   840
            Width           =   495
         End
         Begin VB.Label Label10 
            Caption         =   "Del"
            Height          =   255
            Left            =   240
            TabIndex        =   48
            Top             =   360
            Width           =   495
         End
      End
      Begin VB.Frame Frame_fechas_est 
         Caption         =   "Ingrese el rango de fecha"
         ForeColor       =   &H00FF0000&
         Height          =   1455
         Index           =   2
         Left            =   4200
         TabIndex        =   46
         Top             =   960
         Width           =   3735
         Begin MSComCtl2.DTPicker dtp_fecha1_est 
            Height          =   375
            Left            =   1080
            TabIndex        =   28
            Top             =   360
            Width           =   2295
            _ExtentX        =   4048
            _ExtentY        =   661
            _Version        =   393216
            Format          =   53018625
            CurrentDate     =   37861
         End
         Begin MSComCtl2.DTPicker dtp_fecha2_est 
            Height          =   375
            Left            =   1080
            TabIndex        =   29
            Top             =   840
            Width           =   2295
            _ExtentX        =   4048
            _ExtentY        =   661
            _Version        =   393216
            Format          =   53018625
            CurrentDate     =   37861
         End
         Begin VB.Label Label12 
            Caption         =   "Del"
            Height          =   255
            Left            =   240
            TabIndex        =   50
            Top             =   360
            Width           =   855
         End
         Begin VB.Label Label13 
            Caption         =   "Al"
            Height          =   255
            Left            =   240
            TabIndex        =   51
            Top             =   840
            Width           =   1095
         End
      End
      Begin VB.Label Label8 
         Caption         =   "Nota : Para enviar la estadistíca por E-Mail es necesario generar el informe antes."
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   615
         Left            =   3840
         TabIndex        =   111
         Top             =   3000
         Width           =   2295
      End
      Begin VB.Line Line3 
         BorderColor     =   &H80000005&
         X1              =   15
         X2              =   8040
         Y1              =   2655
         Y2              =   2655
      End
      Begin VB.Line Line2 
         BorderColor     =   &H8000000C&
         X1              =   15
         X2              =   8040
         Y1              =   2640
         Y2              =   2640
      End
      Begin VB.Line Line5 
         BorderColor     =   &H8000000C&
         X1              =   15
         X2              =   8040
         Y1              =   840
         Y2              =   840
      End
      Begin VB.Line Line1 
         BorderColor     =   &H80000005&
         X1              =   15
         X2              =   8040
         Y1              =   855
         Y2              =   855
      End
      Begin VB.Label Label1 
         Caption         =   "Año Postulación"
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   255
         Left            =   5160
         TabIndex        =   37
         Top             =   360
         Width           =   1335
      End
      Begin VB.Label Label3 
         Caption         =   "Tipo de Enseñanza"
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   255
         Left            =   240
         TabIndex        =   36
         Top             =   360
         Width           =   1575
      End
   End
   Begin VB.Frame frame_postulantes 
      Caption         =   "Registro de Postulantes"
      BeginProperty Font 
         Name            =   "Arial"
         Size            =   8.25
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H00C00000&
      Height          =   5775
      Left            =   120
      TabIndex        =   0
      Top             =   4920
      Width           =   8055
      Begin VB.CheckBox chk_mostrarfono 
         Caption         =   "Imprimir Teféfono del postulante"
         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        =   69
         Top             =   5280
         Width           =   3135
      End
      Begin VB.Frame Frame3 
         Caption         =   "Criterios"
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H00C00000&
         Height          =   3015
         Left            =   2520
         TabIndex        =   39
         Top             =   360
         Width           =   5415
         Begin VB.ComboBox cmb_jor_reg 
            BeginProperty Font 
               Name            =   "Arial"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   330
            Left            =   1320
            TabIndex        =   10
            Top             =   1320
            Width           =   3975
         End
         Begin VB.ComboBox cmb_anho_reg 
            BeginProperty Font 
               Name            =   "Arial"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   330
            Left            =   3480
            TabIndex        =   8
            Top             =   480
            Width           =   1815
         End
         Begin VB.ComboBox cmb_mod_reg 
            BeginProperty Font 
               Name            =   "Arial"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   330
            Left            =   120
            TabIndex        =   7
            Top             =   480
            Width           =   3255
         End
         Begin VB.ListBox lst_niveles_reg 
            BeginProperty Font 
               Name            =   "Arial"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   1500
            Left            =   120
            Style           =   1  'Checkbox
            TabIndex        =   9
            Top             =   1320
            Width           =   1095
         End
         Begin VB.CheckBox chk_todos_niveles_reg 
            Caption         =   "Todos los niveles"
            BeginProperty Font 
               Name            =   "Arial"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   255
            Left            =   1320
            TabIndex        =   11
            Top             =   2520
            Width           =   1575
         End
         Begin VB.Line Line6 
            BorderColor     =   &H8000000C&
            X1              =   15
            X2              =   5400
            Y1              =   960
            Y2              =   960
         End
         Begin VB.Line Line4 
            BorderColor     =   &H80000005&
            X1              =   15
            X2              =   4920
            Y1              =   975
            Y2              =   975
         End
         Begin VB.Label Label9 
            Caption         =   "Jornada"
            BeginProperty Font 
               Name            =   "Arial"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   255
            Left            =   1320
            TabIndex        =   43
            Top             =   1080
            Width           =   1575
         End
         Begin VB.Label Label7 
            Caption         =   "Niveles"
            BeginProperty Font 
               Name            =   "Arial"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   255
            Left            =   120
            TabIndex        =   42
            Top             =   1080
            Width           =   615
         End
         Begin VB.Label Label6 
            Caption         =   "Tipo de Enseñanza"
            BeginProperty Font 
               Name            =   "Arial"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   255
            Left            =   120
            TabIndex        =   41
            Top             =   240
            Width           =   1575
         End
         Begin VB.Label Label4 
            Caption         =   "Año Postulación"
            BeginProperty Font 
               Name            =   "Arial"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   255
            Left            =   3480
            TabIndex        =   40
            Top             =   240
            Width           =   1215
         End
      End
      Begin VB.Frame Frame_tipobusqueda_reg 
         Caption         =   "Tipo de búsqueda"
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H00C00000&
         Height          =   1455
         Left            =   120
         TabIndex        =   53
         Top             =   3600
         Width           =   3375
         Begin VB.OptionButton opt_tipobusqueda_reg 
            Caption         =   "Por rango de fechas manuales"
            BeginProperty Font 
               Name            =   "Arial"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   255
            Index           =   2
            Left            =   120
            TabIndex        =   14
            Top             =   1080
            Width           =   2895
         End
         Begin VB.OptionButton opt_tipobusqueda_reg 
            Caption         =   "Por rango de fechas automáticas"
            BeginProperty Font 
               Name            =   "Arial"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   255
            Index           =   1
            Left            =   120
            TabIndex        =   13
            Top             =   720
            Width           =   2895
         End
         Begin VB.OptionButton opt_tipobusqueda_reg 
            Caption         =   "Por fecha única"
            BeginProperty Font 
               Name            =   "Arial"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   255
            Index           =   0
            Left            =   120
            TabIndex        =   12
            Top             =   360
            Width           =   2895
         End
      End
      Begin VB.CommandButton Command1 
         Caption         =   "Cancelar"
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   375
         Left            =   5760
         TabIndex        =   18
         Top             =   5280
         Width           =   1575
      End
      Begin VB.CommandButton btn_gen_reporte 
         Caption         =   "Generar Informe"
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   375
         Left            =   3840
         TabIndex        =   17
         Top             =   5280
         Width           =   1575
      End
      Begin VB.Frame Frame1 
         Caption         =   "Situación Final"
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H00C00000&
         Height          =   3015
         Left            =   120
         TabIndex        =   34
         Top             =   360
         Width           =   2295
         Begin VB.OptionButton Opt_tipopostulante 
            Caption         =   "Matriculados"
            BeginProperty Font 
               Name            =   "Arial"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   255
            Index           =   6
            Left            =   120
            TabIndex        =   70
            Top             =   2640
            Width           =   2055
         End
         Begin VB.OptionButton Opt_tipopostulante 
            Caption         =   "Ausentes"
            BeginProperty Font 
               Name            =   "Arial"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   255
            Index           =   3
            Left            =   120
            TabIndex        =   4
            Top             =   1440
            Width           =   1455
         End
         Begin VB.OptionButton Opt_tipopostulante 
            Caption         =   "Sin situación final"
            BeginProperty Font 
               Name            =   "Arial"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   255
            Index           =   5
            Left            =   120
            TabIndex        =   6
            Top             =   2280
            Width           =   2055
         End
         Begin VB.OptionButton Opt_tipopostulante 
            Caption         =   "Todos los inscritos"
            BeginProperty Font 
               Name            =   "Arial"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   255
            Index           =   4
            Left            =   120
            TabIndex        =   5
            Top             =   1800
            Width           =   1695
         End
         Begin VB.OptionButton Opt_tipopostulante 
            Caption         =   "Pendientes"
            BeginProperty Font 
               Name            =   "Arial"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   255
            Index           =   2
            Left            =   120
            TabIndex        =   3
            Top             =   1080
            Width           =   1335
         End
         Begin VB.OptionButton Opt_tipopostulante 
            Caption         =   "Reprobados"
            BeginProperty Font 
               Name            =   "Arial"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   255
            Index           =   1
            Left            =   120
            TabIndex        =   2
            Top             =   720
            Width           =   1455
         End
         Begin VB.OptionButton Opt_tipopostulante 
            Caption         =   "Aceptados"
            BeginProperty Font 
               Name            =   "Arial"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   255
            Index           =   0
            Left            =   120
            TabIndex        =   1
            Top             =   360
            Width           =   1215
         End
         Begin VB.Line Line10 
            BorderColor     =   &H80000005&
            X1              =   15
            X2              =   2280
            Y1              =   2175
            Y2              =   2175
         End
         Begin VB.Line Line9 
            BorderColor     =   &H8000000C&
            X1              =   15
            X2              =   2280
            Y1              =   2160
            Y2              =   2160
         End
      End
      Begin VB.Frame Frame_fechas_reg 
         Caption         =   "Fecha de exámen"
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H00C00000&
         Height          =   1455
         Index           =   0
         Left            =   3720
         TabIndex        =   54
         Top             =   3600
         Width           =   4215
         Begin VB.CheckBox chk_fecha_reg 
            Caption         =   "Consultar desde el primer examen del año de postulación  hasta esta fecha"
            BeginProperty Font 
               Name            =   "Arial"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   375
            Left            =   240
            TabIndex        =   16
            Top             =   840
            Width           =   3735
         End
         Begin VB.ComboBox cmb_fechaexa_reg 
            BeginProperty Font 
               Name            =   "Arial"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   330
            Left            =   1080
            TabIndex        =   15
            Top             =   360
            Width           =   2895
         End
         Begin VB.Label Label5 
            Caption         =   "Del"
            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        =   55
            Top             =   360
            Width           =   735
         End
      End
      Begin VB.Frame Frame_fechas_reg 
         Caption         =   "Ingrese el rango de fecha"
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H00C00000&
         Height          =   1455
         Index           =   2
         Left            =   3720
         TabIndex        =   61
         Top             =   3600
         Width           =   4215
         Begin MSComCtl2.DTPicker Dtp_fecha1_reg 
            Height          =   375
            Left            =   1080
            TabIndex        =   62
            Top             =   360
            Width           =   2895
            _ExtentX        =   5106
            _ExtentY        =   661
            _Version        =   393216
            BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
               Name            =   "Arial"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Format          =   53018625
            CurrentDate     =   37861
         End
         Begin MSComCtl2.DTPicker Dtp_fecha2_reg 
            Height          =   375
            Left            =   1080
            TabIndex        =   63
            Top             =   840
            Width           =   2895
            _ExtentX        =   5106
            _ExtentY        =   661
            _Version        =   393216
            BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
               Name            =   "Arial"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Format          =   53018625
            CurrentDate     =   37861
         End
         Begin VB.Label Label17 
            Caption         =   "Al"
            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        =   65
            Top             =   840
            Width           =   855
         End
         Begin VB.Label Label16 
            Caption         =   "Del"
            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        =   64
            Top             =   360
            Width           =   855
         End
      End
      Begin VB.Frame Frame_fechas_reg 
         Caption         =   "Seleccione el Rango de fechas de exámenes"
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H00C00000&
         Height          =   1455
         Index           =   1
         Left            =   3720
         TabIndex        =   56
         Top             =   3600
         Width           =   4215
         Begin VB.ComboBox cmb_fechaexa1_reg 
            BeginProperty Font 
               Name            =   "Arial"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   330
            Left            =   1080
            TabIndex        =   58
            Top             =   360
            Width           =   2895
         End
         Begin VB.ComboBox cmb_fechaexa2_reg 
            BeginProperty Font 
               Name            =   "Arial"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   330
            Left            =   1080
            TabIndex        =   57
            Top             =   840
            Width           =   2895
         End
         Begin VB.Label Label15 
            Caption         =   "Del"
            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        =   60
            Top             =   360
            Width           =   495
         End
         Begin VB.Label Label14 
            Caption         =   "Al"
            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        =   59
            Top             =   840
            Width           =   495
         End
      End
      Begin VB.Line Line8 
         BorderColor     =   &H8000000C&
         X1              =   15
         X2              =   8040
         Y1              =   3480
         Y2              =   3480
      End
      Begin VB.Line Line7 
         BorderColor     =   &H80000005&
         X1              =   15
         X2              =   7560
         Y1              =   3495
         Y2              =   3495
      End
   End
   Begin ACXPP.PP PP1 
      Left            =   10200
      Top             =   5640
      _ExtentX        =   847
      _ExtentY        =   847
      PageSize        =   3
      PageWidth       =   12240
      PageHeight      =   15840
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "MS Sans Serif"
         Size            =   8.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ScaleHeight     =   15810
      ScaleWidth      =   12210
   End
End
Attribute VB_Name = "Form_EstadPost"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim Fila As Long, SelCursos As String ' hMNOS mAYORES
Dim nivel As String, letra As String, Jorn As String
Sub GeneraRank(titulo As String)
    
    titulo = titulo & " " & cb_agno.Text
    Form_main.CrystalReport.WindowTitle = titulo
    Form_main.CrystalReport.Formulas(0) = "nomcol = '" & Nombrecol & "'"
    Form_main.CrystalReport.Formulas(1) = "dircol = '" & Direccol & "'"
    Form_main.CrystalReport.Formulas(2) = "comunacol = '" & ComunaCol & "'"
    Form_main.CrystalReport.Formulas(3) = "titulo= '" & UCase(titulo) & "'"
    Form_main.CrystalReport.Formulas(4) = "hora = '" & Time & "'"
    Form_main.CrystalReport.Formulas(5) = "Tipens = '" & Me.cmd_mod_rank & "'"
    Form_main.CrystalReport.Formulas(6) = "Periodo = '" & Me.cmb_per_rank & "'"

    Form_main.CrystalReport.Formulas(7) = "Curso = '" & nivel & "º" & letra & "'"
    Form_main.CrystalReport.Formulas(8) = "Jornada= '" & Jorn & "'"
    
    Form_main.CrystalReport.ReportFileName = DirAplicacion & "\rpt\SelRanking.rpt"
    Form_main.CrystalReport.DataFiles(0) = DirAplicacion & "\GesTemp.mdb"
    Form_main.CrystalReport.WindowState = crptMaximized
    Form_main.CrystalReport.ReplaceSelectionFormula ("")
    Form_main.CrystalReport.Action = 1
    Form_main.CrystalReport.ReplaceSelectionFormula ("")
    Call LimpiaFormulas(Form_main.CrystalReport, 30)
    'Kill (DirAplicacion + "GesTemp.mdb")
 
End Sub

Private Sub Btn_Can_Cob_Click()
Unload Me
End Sub

Private Sub btn_can_cursos_Click()
Unload Me
End Sub

Private Sub btn_can_rank_Click()
Unload Me
End Sub

Private Sub btn_EnviarxMail_Click()
'**************************************
' Variables Boletin
'**************************************
Dim color As String
Dim NomCol, DirCol, ComunaCol As String
Set rs = New ADODB.Recordset
rs.CursorLocation = adUseClient
a = "select nom_est, dir_est, localidad_est from establecimientos"
rs.Open a, conn
If rs.RecordCount > 0 Then
NomCol = rs(0)
DirCol = rs(1)
ComunaCol = rs(2)
End If
rs.Close
'**************************************
     
   Dim BdBoletin As Database
   Dim RsContenido As Recordset
   Dim RsTotales As Recordset
   'RsContenido As ADODB.Recordset
   Set BdBoletin = OpenDatabase(DirAplicacion & "\GesTemp.mdb")
   Set RsContenido = BdBoletin.OpenRecordset("SELECT * FROM Contenido")
   Set RsTotales = BdBoletin.OpenRecordset("SELECT * FROM Totales")
        
If RsContenido.RecordCount > 0 Then
        'Open "C:\Documents and Settings\ADMINISTRADOR\Escritorio\Bol_EstIns.htm" For Output As #1
        Open "C:\Bol_EstIns.htm" For Output As #8
        '**************************************
        ' Encabezado Documento
        '**************************************
        Print #8, "<html>"
        Print #8, "<head>"
        Print #8, "<meta http-equiv='Content-Language' content='es'>"
        Print #8, "<meta http-equiv='Content-Type' content='text/html; charset=windows-1252'>"
        Print #8, "<meta name='GENERATOR' content='Microsoft FrontPage 4.0'>"
        Print #8, "<meta name='ProgId' content='FrontPage.Editor.Document'>"
        Print #8, "<title>Boletín&nbsp; - Estadísticas de Inscritos 2004</title>"
        Print #8, "</head>"
        Print #8, "<body bgcolor='#C0C0C0'>"
        Print #8, "<div align='center'>"
        Print #8, "<center>"
        Print #8, "<table border='1' width='100%'>"
            Print #8, "<tr>"
            Print #8, "<td width='100%' bgcolor='#000080' bordercolorlight='#800000' bordercolor='#FFFFFF'>"
                Print #8, "<p align='center'><font color='#FFFFFF'><b><font size='5'>Boletín&nbsp; - Estadísticas"
                Print #8, "de Inscritos 2004</font></b><br><font size='4'>" & NomCol & "</font>"
                Print #8, "</font>"
            Print #8, "</td>"
            Print #8, "</tr>"
        Print #8, "</table>"
        Print #8, "</center>"
        Print #8, "</div>"
        Print #8, "<p align='left'><font color='#800000'>Fecha&nbsp;&nbsp; : " & Date & "<br>Hora&nbsp;&nbsp;&nbsp;&nbsp; : " & Time & "</font></p>"
        Print #8, "<hr>"
        Print #8, "<div align='center'>"
        Print #8, "<center>"
        Print #8, "<table border='1' width='100%' cellspacing='3' bordercolorlight='#FFFFFF'>"
            Print #8, "<tr>"
            Print #8, "<td width='14%' align='center' rowspan='2' bgcolor='#000080' bordercolor='#FFFFFF' bordercolorlight='#800000'>"
            Print #8, "<p align='center'><b><font color='#FFFFFF'>Curso</font></b></td>"
            Print #8, "<td width='14%' align='center' colspan='3' bgcolor='#000080' bordercolor='#FFFFFF' bordercolorlight='#800000'><b><font color='#FFFFFF'>Inscritos</font></b></td>"
            Print #8, "<td width='14%' align='center' colspan='3' bgcolor='#000080' bordercolor='#FFFFFF' bordercolorlight='#800000'><b><font color='#FFFFFF'>Aceptados</font></b></td>"
            Print #8, "<td width='14%' align='center' colspan='3' bgcolor='#000080' bordercolor='#FFFFFF' bordercolorlight='#800000'><b><font color='#FFFFFF'>Pendientes</font></b></td>"
            Print #8, "<td width='14%' align='center' colspan='3' bgcolor='#000080' bordercolor='#FFFFFF' bordercolorlight='#800000'><b><font color='#FFFFFF'>Reprobados</font></b></td>"
            Print #8, "<td width='14%' align='center' colspan='3' bgcolor='#000080' bordercolor='#FFFFFF' bordercolorlight='#800000'><b><font color='#FFFFFF'>Ausentes</font></b></td>"
            Print #8, "<td width='14%' align='center' colspan='3' bgcolor='#000080' bordercolor='#FFFFFF' bordercolorlight='#800000'><b><font color='#FFFFFF'>Matriculados</font></b></td>"
            Print #8, "</tr>"
            Print #8, "<tr>"
            Print #8, "<td width='5%' align='center' bgcolor='#000080' bordercolor='#FFFFFF' bordercolorlight='#800000'><font color='#FFFFFF'>H</font></td>"
            Print #8, "<td width='5%' align='center' bgcolor='#000080' bordercolor='#FFFFFF' bordercolorlight='#800000'><font color='#FFFFFF'>M</font></td>"
            Print #8, "<td width='5%' align='center' bgcolor='#000080' bordercolor='#FFFFFF' bordercolorlight='#800000'><font color='#FFFFFF'>T</font></td>"
            Print #8, "<td width='5%' align='center' bgcolor='#000080' bordercolor='#FFFFFF' bordercolorlight='#800000'><font color='#FFFFFF'>H</font></td>"
            Print #8, "<td width='5%' align='center' bgcolor='#000080' bordercolor='#FFFFFF' bordercolorlight='#800000'><font color='#FFFFFF'>M</font></td>"
            Print #8, "<td width='5%' align='center' bgcolor='#000080' bordercolor='#FFFFFF' bordercolorlight='#800000'><font color='#FFFFFF'>T</font></td>"
            Print #8, "<td width='5%' align='center' bgcolor='#000080' bordercolor='#FFFFFF' bordercolorlight='#800000'><font color='#FFFFFF'>H</font></td>"
            Print #8, "<td width='5%' align='center' bgcolor='#000080' bordercolor='#FFFFFF' bordercolorlight='#800000'><font color='#FFFFFF'>M</font></td>"
            Print #8, "<td width='5%' align='center' bgcolor='#000080' bordercolor='#FFFFFF' bordercolorlight='#800000'><font color='#FFFFFF'>T</font></td>"
            Print #8, "<td width='5%' align='center' bgcolor='#000080' bordercolor='#FFFFFF' bordercolorlight='#800000'><font color='#FFFFFF'>H</font></td>"
            Print #8, "<td width='5%' align='center' bgcolor='#000080' bordercolor='#FFFFFF' bordercolorlight='#800000'><font color='#FFFFFF'>M</font></td>"
            Print #8, "<td width='5%' align='center' bgcolor='#000080' bordercolor='#FFFFFF' bordercolorlight='#800000'><font color='#FFFFFF'>T</font></td>"
            Print #8, "<td width='5%' align='center' bgcolor='#000080' bordercolor='#FFFFFF' bordercolorlight='#800000'><font color='#FFFFFF'>H</font></td>"
            Print #8, "<td width='5%' align='center' bgcolor='#000080' bordercolor='#FFFFFF' bordercolorlight='#800000'><font color='#FFFFFF'>M</font></td>"
            Print #8, "<td width='5%' align='center' bgcolor='#000080' bordercolor='#FFFFFF' bordercolorlight='#800000'><font color='#FFFFFF'>T</font></td>"
            Print #8, "<td width='5%' align='center' bgcolor='#000080' bordercolor='#FFFFFF' bordercolorlight='#800000'><font color='#FFFFFF'>H</font></td>"
            Print #8, "<td width='5%' align='center' bgcolor='#000080' bordercolor='#FFFFFF' bordercolorlight='#800000'><font color='#FFFFFF'>M</font></td>"
            Print #8, "<td width='5%' align='center' bgcolor='#000080' bordercolor='#FFFFFF' bordercolorlight='#800000'><font color='#FFFFFF'>T</font></td>"
            Print #8, "</tr>"
        Print #8, "</center>"
        Print #8, "<!--  DETALLE -->"
        While Not RsContenido.EOF
        R = R + 1
        '#C0C0C0'
            If R Mod 3 = 0 Then
                color = "'#C0C0C0'"
            Else
                color = "'#99CCFF'"
            End If
          Print #8, "<tr>"
            Print #8, "<td width='14%' bgcolor=" & color & "align='center' bordercolor='#FFFFFF' bordercolorlight='#800000'>"
            Print #8, "<p align='left'><font color='#800000'>" & RsContenido(0) & "</font></td>"
            Print #8, "<td width='5%' bgcolor=" & color & " align='center' bordercolor='#FFFFFF' bordercolorlight='#800000'><font color='#800000'>" & RsContenido(1) & "</font></td>"
            Print #8, "<td width='5%' bgcolor=" & color & " align='center' bordercolor='#FFFFFF' bordercolorlight='#800000'><font color='#800000'>" & RsContenido(2) & "</font></td>"
            Print #8, "<td width='5%' bgcolor=" & color & " align='center' bordercolor='#FFFFFF' bordercolorlight='#800000'><font color='#800000'>" & RsContenido(3) & "</font></td>"
            Print #8, "<td width='5%' bgcolor=" & color & " align='center' bordercolor='#FFFFFF' bordercolorlight='#800000'><font color='#800000'>" & RsContenido(4) & "</font></td>"
            Print #8, "<td width='5%' bgcolor=" & color & " align='center' bordercolor='#FFFFFF' bordercolorlight='#800000'><font color='#800000'>" & RsContenido(5) & "</font></td>"
            Print #8, "<td width='5%' bgcolor=" & color & " align='center' bordercolor='#FFFFFF' bordercolorlight='#800000'><font color='#800000'>" & RsContenido(6) & "</font></td>"
            Print #8, "<td width='5%' bgcolor=" & color & " align='center' bordercolor='#FFFFFF' bordercolorlight='#800000'><font color='#800000'>" & RsContenido(7) & "</font></td>"
            Print #8, "<td width='5%' bgcolor=" & color & " align='center' bordercolor='#FFFFFF' bordercolorlight='#800000'><font color='#800000'>" & RsContenido(8) & "</font></td>"
            Print #8, "<td width='5%' bgcolor=" & color & " align='center' bordercolor='#FFFFFF' bordercolorlight='#800000'><font color='#800000'>" & RsContenido(9) & "</font></td>"
            Print #8, "<td width='5%' bgcolor=" & color & " align='center' bordercolor='#FFFFFF' bordercolorlight='#800000'><font color='#800000'>" & RsContenido(10) & "</font></td>"
            Print #8, "<td width='5%' bgcolor=" & color & " align='center' bordercolor='#FFFFFF' bordercolorlight='#800000'><font color='#800000'>" & RsContenido(11) & "</font></td>"
            Print #8, "<td width='5%' bgcolor=" & color & " align='center' bordercolor='#FFFFFF' bordercolorlight='#800000'><font color='#800000'>" & RsContenido(12) & "</font></td>"
            Print #8, "<td width='5%' bgcolor=" & color & " align='center' bordercolor='#FFFFFF' bordercolorlight='#800000'><font color='#800000'>" & RsContenido(13) & "</font></td>"
            Print #8, "<td width='5%' bgcolor=" & color & " align='center' bordercolor='#FFFFFF' bordercolorlight='#800000'><font color='#800000'>" & RsContenido(14) & "</font></td>"
            Print #8, "<td width='5%' bgcolor=" & color & " align='center' bordercolor='#FFFFFF' bordercolorlight='#800000'><font color='#800000'>" & RsContenido(15) & "</font></td>"
            Print #8, "<td width='5%' bgcolor=" & color & " align='center' bordercolor='#FFFFFF' bordercolorlight='#800000'><font color='#800000'>" & RsContenido(16) & "</font></td>"
            Print #8, "<td width='5%' bgcolor=" & color & " align='center' bordercolor='#FFFFFF' bordercolorlight='#800000'><font color='#800000'>" & RsContenido(17) & "</font></td>"
            Print #8, "<td width='5%' bgcolor=" & color & " align='center' bordercolor='#FFFFFF' bordercolorlight='#800000'><font color='#800000'>" & RsContenido(18) & "</font></td>"
          Print #8, "</tr>"
            
            
            RsContenido.MoveNext
        Wend
        
        Print #8, "<!--  TOTALES -->"
        Print #8, "<tr>"
            Print #8, "<td width='14%' bgcolor='#000080' align='center' bordercolor='#FFFFFF' bordercolorlight='#800000'>"
            Print #8, "<p align='center'><font color='#FFFFFF'><b>Totales</b></font></td>"
            Print #8, "<td width='5%' bgcolor='#000080' align='center' bordercolor='#FFFFFF' bordercolorlight='#800000'><font color='#FFFFFF'>" & RsTotales(1) & "</font></td>"
            Print #8, "<td width='5%' bgcolor='#000080' align='center' bordercolor='#FFFFFF' bordercolorlight='#800000'><font color='#FFFFFF'>" & RsTotales(2) & "</font></td>"
            Print #8, "<td width='5%' bgcolor='#000080' align='center' bordercolor='#FFFFFF' bordercolorlight='#800000'><font color='#FFFFFF'>" & RsTotales(3) & "</font></td>"
            Print #8, "<td width='5%' bgcolor='#000080' align='center' bordercolor='#FFFFFF' bordercolorlight='#800000'><font color='#FFFFFF'>" & RsTotales(4) & "</font></td>"
            Print #8, "<td width='5%' bgcolor='#000080' align='center' bordercolor='#FFFFFF' bordercolorlight='#800000'><font color='#FFFFFF'>" & RsTotales(5) & "</font></td>"
            Print #8, "<td width='5%' bgcolor='#000080' align='center' bordercolor='#FFFFFF' bordercolorlight='#800000'><font color='#FFFFFF'>" & RsTotales(6) & "</font></td>"
            Print #8, "<td width='5%' bgcolor='#000080' align='center' bordercolor='#FFFFFF' bordercolorlight='#800000'><font color='#FFFFFF'>" & RsTotales(7) & "</font></td>"
            Print #8, "<td width='5%' bgcolor='#000080' align='center' bordercolor='#FFFFFF' bordercolorlight='#800000'><font color='#FFFFFF'>" & RsTotales(8) & "</font></td>"
            Print #8, "<td width='5%' bgcolor='#000080' align='center' bordercolor='#FFFFFF' bordercolorlight='#800000'><font color='#FFFFFF'>" & RsTotales(9) & "</font></td>"
            Print #8, "<td width='5%' bgcolor='#000080' align='center' bordercolor='#FFFFFF' bordercolorlight='#800000'><font color='#FFFFFF'>" & RsTotales(10) & "</font></td>"
            Print #8, "<td width='5%' bgcolor='#000080' align='center' bordercolor='#FFFFFF' bordercolorlight='#800000'><font color='#FFFFFF'>" & RsTotales(11) & "</font></td>"
            Print #8, "<td width='5%' bgcolor='#000080' align='center' bordercolor='#FFFFFF' bordercolorlight='#800000'><font color='#FFFFFF'>" & RsTotales(12) & "</font></td>"
            Print #8, "<td width='5%' bgcolor='#000080' align='center' bordercolor='#FFFFFF' bordercolorlight='#800000'><font color='#FFFFFF'>" & RsTotales(13) & "</font></td>"
            Print #8, "<td width='5%' bgcolor='#000080' align='center' bordercolor='#FFFFFF' bordercolorlight='#800000'><font color='#FFFFFF'>" & RsTotales(14) & "</font></td>"
            Print #8, "<td width='5%' bgcolor='#000080' align='center' bordercolor='#FFFFFF' bordercolorlight='#800000'><font color='#FFFFFF'>" & RsTotales(15) & "</font></td>"
            Print #8, "<td width='5%' bgcolor='#000080' align='center' bordercolor='#FFFFFF' bordercolorlight='#800000'><font color='#FFFFFF'>" & RsTotales(16) & "</font></td>"
            Print #8, "<td width='5%' bgcolor='#000080' align='center' bordercolor='#FFFFFF' bordercolorlight='#800000'><font color='#FFFFFF'>" & RsTotales(17) & "</font></td>"
            Print #8, "<td width='5%' bgcolor='#000080' align='center' bordercolor='#FFFFFF' bordercolorlight='#800000'><font color='#FFFFFF'>" & RsTotales(18) & "</font></td>"
        Print #8, "</tr>"
        Print #8, "</table>"
        Print #8, "</center>"
        Print #8, "</div>"
        Print #8, "<hr>"
        Print #8, "<p align='center'><font size='1' color='#800000'>Reporte generado por GesCol Ver. 1.0</font></p>"
        Print #8, "</body>"
        Print #8, "</html>"

        Close #8
End If

RsContenido.Close
BdBoletin.Close
'Dim Discodrive, Direc, Fichero, Ax, Hayax, Saliente, Rte, A As String
Dim ax, hayax As Boolean
Discodrive = ""
Direc = ""
fichero = ""
'Ax = ""
'hayax = ""
Saliente = ""
Rte = ""
a = ""
   
   Open DirAplicacion & "\correo.cfg" For Append As #2
   Close #2
   Open DirAplicacion & "\correo.cfg" For Input As #2
   If EOF(2) Then
      Close #2
      Discodrive = "c:"
      Direc = "c:\"
      fichero = "Bol_EstIns.htm"
      ax = True
      hayax = True
      'Config.Show 1 ' debo enviar a la pantalla de llenado con el archivo ya adjunto
      'o mejor dicho escribir en el archivo el fichero anexo
      'Load correo
   Else
      Input #2, Cfg.Disco, Cfg.Directorio, Cfg.FicheroAnexo, Cfg.AnexoVisible, Cfg.HayAnexo, Cfg.Smtp, Cfg.De, Cfg.Para
       Discodrive = Cfg.Disco
       Direc = Cfg.Directorio
       fichero = "Bol_EstIns.htm"
       ax = Cfg.AnexoVisible
       hayax = Cfg.HayAnexo
       Saliente = Cfg.Smtp
       Rte = Cfg.De
       a = Cfg.Para
      Close #2
   End If
   Cfg.Disco = Discodrive
   Cfg.Directorio = Direc
   Cfg.FicheroAnexo = fichero
   Cfg.AnexoVisible = ax
   Cfg.HayAnexo = hayax
   Cfg.Smtp = Saliente
   Cfg.De = Rte
   Cfg.Para = a
      

   Open DirAplicacion & "\correo.cfg" For Output As #2
    Write #2, Cfg.Disco, Cfg.Directorio, Cfg.FicheroAnexo, Cfg.AnexoVisible, Cfg.HayAnexo, Cfg.Smtp, Cfg.De, Cfg.Para
   Close #2
   Cfg.AnexoVisible = True
Load correo
   
   
   'NFich = Cfg.Directorio
   'If Right(NFich, 1) = "\" Then
   '   NFich = Mid(NFich, 1, Len(NFich) - 1)
   'End If
   'NFich = NFich & "\" & Cfg.FicheroAnexo
   'ConexionEstablecida = False
End Sub

Private Sub btn_gen_rep_rank_Click()
Dim rango As String
If Me.cmd_mod_rank.Text <> "" And Me.lst_cursos_rank.SelCount > 0 And Me.cmb_per_rank <> "" Then
    modalidad = DevuelveCampo("codigos_ensenanza", "", "cod_ens", "des_ens = '" & Me.cmd_mod_rank & "'", conn)
    PERIODOS = CuentaReg("periodos", "num_per <>''", conn)
    If UCase(Me.cmb_per_rank.Text) <> "ANUAL" Then
        nperiodo = Me.cmb_per_rank.ListIndex + 1
        Orden = "rp" & nperiodo
        Per = "p" & nperiodo
    Else
        nperiodo = Me.cmb_per_rank.ListIndex + 1
        Orden = "rpg"
        Per = "pg"
    End If
    If Me.Opt_Tinf_Rank(0).Value Then
    
    ElseIf Me.Opt_Tinf_Rank(1).Value Then
    
    ElseIf Me.Opt_Tinf_Rank(2).Value Then
    
    ElseIf Me.Opt_Tinf_Rank(3).Value Then
        rango = " and rp1 < " & 4# & " and rp2 < " & 4# & " and rp3 < " & 4# & " and rpg < " & 4#
    ElseIf Me.Opt_Tinf_Rank(4).Value Then
        'single
        rango = " and rp1 < " & 4# & " and rp2 < " & 4# & " and rp3 < " & 4# & " and rpg < " & 4#
    End If
        
    nivel = "": letra = "": Consulta = ""
    rs.CursorLocation = adUseClient
    For t = 0 To Me.lst_cursos_rank.ListCount - 1
        If Me.lst_cursos_rank.Selected(t) Then
            nivel = Anuevocurso(t, 1)
            letra = Anuevocurso(t, 2)
            Jorn = Anuevocurso(t, 3)
'            'Consulta = "select p.ape_pat_alu, p.ape_mat_alu, p.nom_alu, p.ci_alu, avg(p1) as rp1, avg(p2) as rp2 , avg(p3) as rp3, avg(pg) as rpg  from promedios pr, postulantes p where  p.ci_alu = pr.ci_alu and pr.cod_ens ='" & modalidad & "' and pr.num_gra ='" & nivel & "' and pr.letra_curso ='" & Letra & "' " & rango & " and pr.cod_asi <>'13' and " & Per & " > 0 and agno = " & Anno & " group by p.ci_alu order by '" & Orden & "' desc"
'            Consulta = "select p.ape_pat_alu, p.ape_mat_alu, p.nom_alu, p.ci_alu, avg(p1) as rp1, avg(p2) as rp2 , avg(p3) as rp3, avg(pg) as rpg  from promedios pr, postulantes p where  p.ci_alu = pr.ci_alu and pr.cod_ens ='" & modalidad & "' and pr.num_gra ='" & nivel & "' and pr.letra_curso ='" & Letra & "' " & rango & " and pr.cod_asi <>'13' and " & Per & " > 0 and agno = " & cb_agno.Text & " group by p.ci_alu order by '" & Orden & "' desc"
            If Me.Opt_Tinf_Rank(0).Value Then
            Consulta = "select p.ape_pat_alu, p.ape_mat_alu, p.nom_alu, p.ci_alu, avg(p1) as rp1, avg(p2) as rp2 , avg(p3) as rp3, avg(nf) as rpg  from promedios pr, postulantes p where  p.ci_alu = pr.ci_alu and pr.cod_ens ='" & modalidad & "' and pr.num_gra ='" & nivel & "' and pr.letra_curso ='" & letra & "' " & rango & " and pr.cod_asi <>'13' and pr.cod_asi <>'22' and " & Per & " > 0 and agno = " & cb_agno.Text & " AND p.ci_alu IN (SELECT ci_alu FROM alu_x_cur WHERE agno = " & cb_agno.Text & " AND activo_alu = 'SI') group by p.ci_alu order by '" & Orden & "' desc"
            ElseIf Me.Opt_Tinf_Rank(1).Value Then
            Consulta = "select p.ape_pat_alu, p.ape_mat_alu, p.nom_alu, p.ci_alu, avg(p1) as rp1, avg(p2) as rp2 , avg(p3) as rp3, avg(nf) as rpg  from promedios pr, postulantes p where  p.ci_alu = pr.ci_alu and pr.cod_ens ='" & modalidad & "' and pr.num_gra ='" & nivel & "'" & rango & " and pr.cod_asi <>'13' and pr.cod_asi <>'22' and " & Per & " > 0 and agno = " & cb_agno.Text & " AND p.ci_alu IN (SELECT ci_alu FROM alu_x_cur WHERE agno = " & cb_agno.Text & " AND activo_alu = 'SI') group by p.ci_alu order by '" & Orden & "' desc"
            ElseIf Me.Opt_Tinf_Rank(2).Value Then
    
            ElseIf Me.Opt_Tinf_Rank(3).Value Then
                'rango = " and rp1 < " & 4# & " and rp2 < " & 4# & " and rp3 < " & 4# & " and rpg < " & 4#
            ElseIf Me.Opt_Tinf_Rank(4).Value Then
                'single
                'rango = " and rp1 < " & 4# & " and rp2 < " & 4# & " and rp3 < " & 4# & " and rpg < " & 4#
            End If
            rs.Open Consulta, conn
            lugar = 1
            If rs.RecordCount > 0 Then
                Call CreaBD(DirAplicacion & "\GesTemp.mdb")
                Set Rendim = DBEngine.Workspaces(0).OpenDatabase(DirAplicacion & "\GesTemp.mdb")
                Call CreaTabla(DirAplicacion & "\GesTemp.mdb", "Detalles", "7,10")
                While Not rs.EOF
                    nombres = rs(0) & " " & rs(1) & " " & rs(2)
                    If UCase(Me.cmb_per_rank.Text) = "ANUAL" Then
                        If Not IsNull(rs(7)) Then
                            Promedio = IIf(Len(CStr(rs(7))) = 1, Format(rs(7), ".00"), Mid(CStr(rs(7)), 1, 4))
                            Pos = lugar
                            lugar = lugar + 1
                        Else
                            Promedio = "---"
                            Pos = "-"
                        End If
                    Else
                        If Not IsNull(rs(nperiodo + 3)) Then
                            Promedio = IIf(Len(CStr(rs(nperiodo + 3))) = 1, Format(rs(nperiodo + 3), ".00"), Mid(CStr(rs(nperiodo + 3)), 1, 4))
                            Pos = lugar
                            lugar = lugar + 1
                         Else
                            Promedio = "---"
                            Pos = "-"
                        End If
                    End If
                
                'MmG = MmG & Format(rsaux(0), "0.0")
                'MmG = MmG & Format(Int(Round(rsaux(0) * 10, 1)) / 10, "0.0")
                'Pgcurso = IIf(Len(CStr(Pgcurso)) = 1, Format(Pgcurso, ".0"), Mid(CStr(Pgcurso), 1, 3))
                'nombre = Me.CoolFlex1(1).TextMatrix(f, 1) 'Trim(Mid(Me.CoolFlex1(1).TextMatrix(f, 1), 11, Len(Me.CoolFlex1(1).TextMatrix(f, 1))))
                If nombres <> "" Then
                    Posi = InStr(1, nombres, "'")
                    If Posi <> 0 Then
                        nombres1 = Mid(nombres, 1, Posi) & "'" & Mid(nombres, Posi + 1, Len(nombres))
                        nombres = nombres1
                    End If
                        nombres = "'" & nombres & "'"
                Else
                        nombres = "Null"
                End If

                Sql1 = " insert into Detalles (C1, C2, C3, C4, C5, C6 ,C7) values ('" & Pos & "' ," & nombres & ", '" & Promedio & "' , 'h' , 'h', 'H', 'H')"
                Rendim.Execute Sql1
                rs.MoveNext
            Wend
            Rendim.Close
            Call GeneraRank("Ranking de Calificaciones por curso")
        End If
        rs.Close
        End If
    Next t
Else
    MsgBox ("Faltan opciones por seleccionar")
End If
End Sub

Private Sub btn_gen_reporte_Click()
Dim Faltancampos As Boolean, fechainicio As String, fechafin As String
Dim mat As Boolean
'On Error GoTo Errorimpresion
Faltancampos = True: mat = False
If Me.opt_tipobusqueda_reg(0) Then
    If Me.cmb_fechaexa_reg.Text <> "" Then: Faltancampos = False
ElseIf Me.opt_tipobusqueda_reg(1) Then
    If Me.cmb_fechaexa1_reg.Text <> "" And Me.cmb_fechaexa2_reg.Text <> "" Then: Faltancampos = False
ElseIf Me.opt_tipobusqueda_reg(2) Then
    If Me.Dtp_fecha1_reg.Value <> "" And Me.Dtp_fecha2_reg.Value <> "" Then: Faltancampos = False
End If

If Me.cmb_mod_reg.Text <> "" And Me.cmb_anho_reg.Text <> "" And Me.lst_niveles_reg.SelCount > 0 And Me.cmb_jor_reg.Text <> "" And Not Faltancampos Then
    Codens = "{postulantes.cod_ens}='" & DevuelveCampo("codigos_ensenanza", "", "cod_ens", "des_ens ='" & Me.cmb_mod_reg.Text & "'", conn) & "'"
    Anho = "and {postulaciones.anno_pos_alu} = '" & Me.cmb_anho_reg.Text & "'"
    If Me.Opt_tipopostulante(0).Value Then
        Situacion = "and UpperCase({postulaciones.VIII_SIT_FIN_ALU}) = 'A'"
        Tipo = "APROBADOS"
    ElseIf Me.Opt_tipopostulante(1).Value Then
        Situacion = "and UpperCase({postulaciones.VIII_SIT_FIN_ALU}) = 'R'"
        Tipo = "REPROBADOS"
    ElseIf Me.Opt_tipopostulante(2).Value Then
        Situacion = "and UpperCase({postulaciones.VIII_SIT_FIN_ALU}) = 'P'"
        Tipo = "PENDIENTES"
    ElseIf Me.Opt_tipopostulante(3).Value Then
        Situacion = "and UpperCase({postulaciones.VIII_SIT_FIN_ALU}) = 'F'"
        Tipo = "AUSENTES"
    ElseIf Me.Opt_tipopostulante(4).Value Then
        Situacion = ""
        Tipo = "INSCRITOS"
    ElseIf Me.Opt_tipopostulante(5).Value Then
        Situacion = "and isnull({postulaciones.VIII_SIT_FIN_ALU})"
        'situacion = "and (UpperCase({postulaciones.VIII_SIT_FIN_ALU}) <> 'A'  and Uppercase({postulaciones.VIII_SIT_FIN_ALU}) <> 'R' and Uppercase({postulaciones.VIII_SIT_FIN_ALU}) <> 'P' and Uppercase({postulaciones.VIII_SIT_FIN_ALU}) <> 'F')"
        Tipo = "SIN SITUACIÓN FINAL"
    ElseIf Me.Opt_tipopostulante(6).Value Then
        Situacion = ""
        mat = True
        '"and {postulantes.CI_ALU}={matriculas.CI_ALU} and {postulantes.COD_ENS}={matriculas.COD_ENS}"
        'situacion = "and {postulantes.matriculado_ALU}=1"
        'situacion = "and (UpperCase({postulaciones.VIII_SIT_FIN_ALU}) <> 'A'  and Uppercase({postulaciones.VIII_SIT_FIN_ALU}) <> 'R' and Uppercase({postulaciones.VIII_SIT_FIN_ALU}) <> 'P' and Uppercase({postulaciones.VIII_SIT_FIN_ALU}) <> 'F')"
        Tipo = "MATRICULADOS"
    End If
    If Me.cmb_jor_reg.Text <> "Todas" Then
        jornada = "and {postulaciones.cod_jor}='" & DevuelveCampo("jornadas", "", "cod_jor", "des_jor ='" & Me.cmb_jor_reg.Text & "'", conn) & "'"
    Else
        jornada = ""
    End If
    
    If (Me.opt_tipobusqueda_reg(0)) Then
    
    'If (rs.RecordCount > 0) Then
        If Me.cmb_fechaexa_reg.Text = "Todas" Then
            fechainicio = Me.cmb_fechaexa_reg.List(1)
            fechafin = Me.cmb_fechaexa_reg.List(Me.cmb_fechaexa_reg.ListCount - 1)
        Else
            If Me.chk_fecha_reg.Value = 1 Then
                ' tomar la primera fecha de examen para ese año
                fechainicio = Me.cmb_fechaexa_reg.List(1)
                fechafin = Me.cmb_fechaexa_reg.Text
            Else
                fechainicio = Me.cmb_fechaexa_reg.Text
                fechafin = Me.cmb_fechaexa_reg.Text
            End If
        End If

   ' Else
   '     MsgBox "No hay postulaciones para este periodo", vbInformation, "Atención"
   '     Exit Sub
   ' End If
        
    ElseIf Me.opt_tipobusqueda_reg(1) Then
    

        fechainicio = Me.cmb_fechaexa1_reg.Text
        fechafin = Me.cmb_fechaexa2_reg.Text
    ElseIf Me.opt_tipobusqueda_reg(2) Then
        fechainicio = Me.Dtp_fecha1_reg.Value
        fechafin = Me.Dtp_fecha2_reg.Value
    End If
    fechas = fechainicio & " al " & fechafin
 
    If (fechainicio <> "") Then
        fecha1 = Format(CDate(fechainicio), "yyyy-mm-dd")
    Else
       MsgBox "No hay postulaciones para este periodo", vbInformation = vbOKOnly, "Atención"
        Exit Sub
    End If
    
    fecha2 = Format(CDate(fechafin), "yyyy-mm-dd")
    fechainicio = Year(fecha1) & "," & Month(fecha1) & "," & Day(fecha1)
    fechafin = Year(fecha2) & "," & Month(fecha2) & "," & Day(fecha2)
    RangoFechas = "and (Date (Year({postulaciones.VII_HOR_EVAL}),Month({postulaciones.VII_HOR_EVAL}),Day({postulaciones.VII_HOR_EVAL})) >= (Date(" & fechainicio & "))) and " & _
                  "(Date (Year({postulaciones.VII_HOR_EVAL}),Month({postulaciones.VII_HOR_EVAL}),Day({postulaciones.VII_HOR_EVAL})) <= (Date(" & fechafin & ")))"
                   

    Con = 0
    SelCursos = ""
    If Me.lst_niveles_reg.SelCount >= 0 Then
        For t = 0 To Me.lst_niveles_reg.ListCount - 1
            If Me.lst_niveles_reg.Selected(t) Then
                Con = t
            End If
        Next t
        For t = 0 To Me.lst_niveles_reg.ListCount - 1
            If Me.lst_niveles_reg.Selected(t) Then
                If t = Con Then
                    SelCursos = SelCursos & "{postulantes.num_gra}  = '" & Me.lst_niveles_reg.List(t) & "'"
                    Niveles = Niveles & t + 1
                Else
                    SelCursos = SelCursos & "{postulantes.num_gra}  = '" & Me.lst_niveles_reg.List(t) & "' or "
                    Niveles = Niveles & t + 1 & "-"
                End If '{}
            End If
        Next
        SelCursos = "(" & SelCursos & ")"
   End If
    titulo = "REGISTRO DE POSTULANTES " & Tipo & " PERIODO ESCOLAR " & Me.cmb_anho_reg.Text
    'Cadena = Codens & " and " & SelCursos & " " & Jornada & " " & Anho & " " & Situacion & " " & RangoFechas
    'Dim a As Boolean
    Call LimpiaFormulas(Form_main.CrystalReport, 30)
'    If mat Then
'
'    Else
'
'    End If
    Direccol = DevuelveCampo("establecimientos", "", "dir_est", "dir_est <> ''", conn)
    ComunaCol = DevuelveCampo("establecimientos", "", "localidad_est", "localidad_est <> ''", conn)
    Form_main.CrystalReport.WindowTitle = "Registro de postulantes"
    Form_main.CrystalReport.Formulas(0) = "nombrecolegio = '" & Nombrecol & "'"
    Form_main.CrystalReport.Formulas(1) = "direccioncolegio = '" & Direccol & "'"
    Form_main.CrystalReport.Formulas(2) = "comunacolegio = '" & ComunaCol & "'"
    Form_main.CrystalReport.Formulas(3) = "titulo= '" & titulo & "'"
    Form_main.CrystalReport.Formulas(4) = "hora = '" & Time & "'"
    Form_main.CrystalReport.Formulas(5) = "modalidad = '" & Me.cmb_mod_reg.Text & "'"
    Form_main.CrystalReport.Formulas(6) = "rangofechas = '" & fechas & "'"
    Form_main.CrystalReport.Formulas(7) = "jornada = '" & Me.cmb_jor_reg.Text & "'"
    Form_main.CrystalReport.Formulas(8) = "niveles = '" & Niveles & "'"
    If Me.chk_mostrarfono.Value = 1 Then
        Form_main.CrystalReport.Formulas(9) = "confono = 'SI'"
    Else
        Form_main.CrystalReport.Formulas(9) = "confono = 'NO'"
    End If
    
    If mat Then
        Form_main.CrystalReport.ReportFileName = DirAplicacion & "\rpt\postulantesmat.rpt"
        Cadena = Codens & " and " & SelCursos & " " & jornada & " " & Anho & " " & Situacion & " " & RangoFechas & " and {matriculas.anno_mat} = '" & cmb_anho_reg.Text & "'"
    Else
        Form_main.CrystalReport.ReportFileName = DirAplicacion & "\rpt\postulantes.rpt"
        Cadena = Codens & " and " & SelCursos & " " & jornada & " " & Anho & " " & Situacion & " " & RangoFechas ' & " and {matriculas.anno_mat} = " & cmb_anho_reg.Text & ""
    End If
    Form_main.CrystalReport.ReplaceSelectionFormula ("")
    Form_main.CrystalReport.ReplaceSelectionFormula (Cadena)
    Form_main.CrystalReport.WindowState = crptMaximized
    Form_main.CrystalReport.Destination = crptToWindow
    Form_main.CrystalReport.Action = 1
    Form_main.CrystalReport.ReplaceSelectionFormula ("")
    Call LimpiaFormulas(Form_main.CrystalReport, 30)
Else
    MsgBox ("Faltan opciones por seleccionar")
End If
Exit Sub
Errorimpresion:
If Err.Number = 482 Then MsgBox "Hubo un problema al imprimir."
If Err.Number = 380 Then
    If Me.Opt_destino(0) Then
        MsgBox "Error en los parámetros de impresión" & Chr(13) & "La impresora no es compatible con el tipo del papel." & Chr(13) & "Seleccione otra impresora."
    Else
        MsgBox "No es posible generar la vista preliminar con el tipo de letra seleccionado" & Chr(13) & "Seleccione otro tipo."
    End If
Else
    MsgBox (Err.Number & " " & Err.Description)
End If

End Sub

Private Sub Btn_Generar_Listado_Click()
Dim Mayor As Boolean
If Me.lst_cursosinf.SelCount > 0 Then
    Call IniGrillaLista
    Abarra = 0
    Me.Prgbar_Cob.ShowProgress 0
    Me.Prgbar_Cob.Zusatztext = "% Terminado"
    Call ArmaCursos
    Set rs = New ADODB.Recordset
    rs.CursorLocation = adUseClient
    
    
    var_sql = "DROP TABLE IF EXISTS temp_mayor;"
    conn.Execute var_sql
    
    var_sql = "CREATE TABLE temp_mayor TYPE = MYISAM" _
            & " SELECT b.rut_apo, MAX(b.orden),agno,curso,ci_alu,cod_ens,num_gra,COUNT(ci_alu),let_cur" _
            & " From" _
            & " (" _
            & " SELECT rut_apo,m.ci_alu,m.agno,CONCAT(CAST(m.num_gra AS CHAR),' ',let_cur,' ',IF(m.cod_ens='996','PRE-KINDER',IF(m.cod_ens='010','KINDER',IF(m.cod_ens='110','BASICO',IF(m.cod_ens='310','MEDIA','PLAY-GROUP'))))) AS curso," _
            & "CONCAT(ord_ens,m.num_gra,fec_nacalu,m.ci_alu) AS orden,m.cod_ens,m.num_gra,m.let_cur" _
            & " FROM apo_x_alu a,alu_x_cur m,codigos_ensenanza e,postulantes p" _
            & " WHERE a.ci_alu = m.ci_alu AND a.agno = m.agno AND m.agno = 2014 AND m.cod_ens = e.cod_ens AND m.ci_alu = p.ci_alu AND m.activo_alu = 'SI'" _
            & " ORDER BY rut_apo,ord_ens DESC,m.num_gra DESC,fec_nacalu ASC,m.ci_alu ASC" _
            & " ) AS b" _
            & " GROUP BY b.rut_apo" _
            & " ORDER BY curso;"
    conn.Execute var_sql
    
    var_sql = "SELECT ac.ci_alu,ape_pat_alu,ape_mat_alu,nom_alu,ac.num_gra,ac.let_cur,cod_des,ape1_apo,ape2_apo,noms_apo,ac.rut_apo" _
            & " FROM temp_mayor AS ac,apoderados AS a,postulantes AS p,codigos_ensenanza ce" _
            & " Where ac.rut_apo = a.rut_apo And ac.ci_alu = p.ci_alu And ac.Cod_Ens = ce.Cod_Ens " & SelCursos _
            & " ORDER BY ac.cod_ens,ac.num_gra,ac.let_cur,ape_pat_alu,ape_mat_alu,nom_alu"
    rs.Open var_sql, conn
    
    
    'rs.Open "select pos.ci_alu, pos.ape_pat_alu, pos.ape_mat_alu, pos.nom_alu, ac.num_gra, ac.let_cur, co.cod_des, a.ape1_apo, a.ape2_apo, a.noms_apo, a.rut_apo from apoderados a, apo_x_alu ap, postulantes pos, alu_x_cur ac, matriculas m, codigos_ensenanza co where a.rut_apo=ap.rut_apo and ap.ci_alu=pos.ci_alu and pos.ci_alu= m.ci_alu and m.ci_alu = ac.ci_alu and (ac.activo_alu = m.activo_alu or (ac.activo_alu <> m.activo_alu and ac.fec_cam <>'1111-11-11')) AND m.fec_mat=ac.fec_mat and ac.cod_ens=co.cod_ens " & SelCursos & " and ac.activo_alu='SI'order by ac.cod_ens, ac.num_gra, ac.let_cur, pos.ape_pat_alu, pos.ape_mat_alu, pos.nom_alu", conn
    ' Esta consulta trae lo mismo anteriormente mas los alumnos
    ' select po.ci_alu, po.ape_pat_alu, po.ape_mat_alu, a.rut_apo, a.noms_apo, a.ape1_apo, a.ape2_apo, sum(d.monto) from anualidad_x_apo d, apoderados a, apo_x_alu ap, alu_x_cur ac , matriculas m, postulantes po where d.rut_apo=a.rut_apo and a.rut_apo = ap.rut_apo and ap.ci_alu= m.ci_alu and m.ci_alu = ac.ci_alu and (ac.activo_alu = m.activo_alu or (ac.activo_alu <> m.activo_alu and ac.fec_cam <>'1111-11-11')) AND m.fec_mat=ac.fec_mat and m.ind_beca='0' and ((ac.num_gra  = '6' and ac.let_cur = 'A' and ac.cod_ens ='110')) and ac.ci_alu=po.ci_alu group by a.rut_apo order by ac.cod_ens, ac.num_gra, ac.let_cur, po.ape_pat_alu, po.ape_mat_alu, ac.fec_ing_curso
    Me.Prgbar_Cob.MaxValue = rs.RecordCount
    Fila = 0: c = 0
    If rs.RecordCount > 0 Then
        While Not rs.EOF
                c = c + 1
                'Mayor = EselMayor(rs!RUT_APO, rs!Ci_alu, Anno)
''''''''                Mayor = EselMayor(rs!ci_alu, Anno)
''''''''                If Mayor Then
                    'If Val(Pagado) < Val(rs(4)) Then
                    Me.Grd_Apod_Cob.AddItem ""
                    Fila = Fila + 1
                    Me.Grd_Apod_Cob.TextMatrix(Fila, 0) = Fila
                    If UCase(rs!cod_des) = "PG" Or UCase(rs!cod_des) = "K" Or UCase(rs!cod_des) = "PK" Then
                        curso = UCase(rs!cod_des) & "º" & UCase(rs!Let_Cur)
                    ElseIf UCase(rs!cod_des) = "EB" Or UCase(rs!cod_des) = "EM" Then
                        curso = UCase(rs!Num_Gra) & "º" & UCase(rs!Let_Cur) & " " & UCase(rs!cod_des)
                    End If
                    Me.Grd_Apod_Cob.TextMatrix(Fila, 1) = curso
                    Me.Grd_Apod_Cob.TextMatrix(Fila, 2) = rs!ape_pat_alu & " " & rs!ape_mat_alu & " " & rs!Nom_Alu
                    Me.Grd_Apod_Cob.TextMatrix(Fila, 3) = rs!ape1_apo & " " & rs!ape1_apo & " " & rs!Noms_Apo
                    Me.Grd_Apod_Cob.TextMatrix(Fila, 4) = rs!rut_apo
                    Me.Grd_Apod_Cob.Refresh
                    Me.btn_impri_HM.Enabled = True
''''''''            End If
            rs.MoveNext
            Me.Prgbar_Cob.ShowProgress c
            DoEvents
        Wend
    End If
    rs.Close
Else
    MsgBox ("Faltan opciones por seleccionar")
End If
Set rs = Nothing
End Sub

Private Sub btn_impri_HM_Click()
Call CreaBD(DirAplicacion & "\rpt\gestemp.mdb")
Call CreaTabla(DirAplicacion & "\rpt\gestemp.mdb", "Detalles", "5,10")
Call RptGrillaText(Grd_Apod_Cob, Fila, "\rpt\gestemp.mdb", "Detalles")
titulo = "Hermanos Mayores por Curso"
Nombrecol = DevuelveCampo("establecimientos", "", "nom_est", "nom_est <> ''", conn)
Direccol = DevuelveCampo("establecimientos", "", "dir_est", "dir_est <> ''", conn)
ComunaCol = DevuelveCampo("establecimientos", "", "localidad_est", "localidad_est <> ''", conn)
Form_main.CrystalReport.WindowTitle = titulo
Form_main.CrystalReport.Formulas(0) = "nomcol = '" & Nombrecol & "'"
Form_main.CrystalReport.Formulas(1) = "dircol = '" & Direccol & "'"
Form_main.CrystalReport.Formulas(2) = "comunacol = '" & ComunaCol & "'"
Form_main.CrystalReport.Formulas(3) = "hora = '" & Time & "'"
Form_main.CrystalReport.Formulas(4) = "titulo = '" & UCase(titulo) & "'"
Form_main.CrystalReport.ReportFileName = DirAplicacion & "\rpt\hmnosmay.rpt"
Form_main.CrystalReport.DataFiles(0) = DirAplicacion & "\rpt\GesTemp.mdb"
Form_main.CrystalReport.WindowState = crptMaximized
'Form_Main.CrystalReport.ReplaceSelectionFormula ("")
Form_main.CrystalReport.Action = 1
Call LimpiaFormulas(Form_main.CrystalReport, 20)
'Form_Main.CrystalReport.ReplaceSelectionFormula ("")
'Kill (DirAplicacion & "\rpt\GesTemp.mdb")
End Sub

Private Sub btn_rep_cursos_Click()
Dim jornadas() As String, valores(1, 20) As String, fechainicio As Date, fechafin As Date
Dim Fila As Integer, Indice As Integer, contenido() As Variant, Totales(1, 20) As Variant
Dim Faltancampos As Boolean
Dim Largocontenido As Integer
Largocontenido = 0
Indice = 0
On Error GoTo Errorimpresion
Faltancampos = True

If Me.opt_tipobusqueda(0) Then
    If Me.cmb_fechaexa_est.Text <> "" Then: Faltancampos = False
ElseIf Me.opt_tipobusqueda(1) Then
    If Me.cmb_fechaexa1_est.Text <> "" And Me.cmb_fechaexa2_est.Text <> "" Then: Faltancampos = False
ElseIf Me.opt_tipobusqueda(2) Then
    If Me.dtp_fecha1_est.Value <> "" And Me.dtp_fecha2_est.Value <> "" Then: Faltancampos = False
End If

If Me.cmb_mod_est.Text <> "" And Me.cmb_anho_est.Text <> "" And Me.cmb_printers.Text <> "" And Not Faltancampos Then
    Codens = DevuelveCampo("codigos_ensenanza", "", "cod_ens", "des_ens ='" & Me.cmb_mod_est.Text & "'", conn)
    Totalniveles = DevuelveCampo("codigos_ensenanza", "", "num_gra_max", "des_ens = '" & Me.cmb_mod_est.Text & "'", conn)
    rs.CursorLocation = adUseClient
    rs.Open "select cod_jor, des_jor from jornadas order by des_jor", conn
    If rs.RecordCount > 0 Then ' AQUI LLENO UNA MATRIZ CON LAS JORNADAS
        ReDim jornadas(rs.RecordCount, 2)
        c = 1
        While Not rs.EOF
            jornadas(c, 1) = Mid(rs("cod_jor"), 1, 10)
            jornadas(c, 2) = Mid(rs("des_jor"), 1, 10)
            rs.MoveNext
            c = c + 1
        Wend
    End If
    If Me.opt_tipobusqueda(0) Then
        If Me.cmb_fechaexa_est.Text = "Todas" Then
            fechainicio = Me.cmb_fechaexa_est.List(1)
            fechafin = Me.cmb_fechaexa_est.List(Me.cmb_fechaexa_est.ListCount - 1)
        Else
            If Me.Chk_Fecha.Value = 1 Then
                ' tomar la primera fecha de examen para ese año
                fechainicio = Me.cmb_fechaexa_est.List(1)
                fechafin = Me.cmb_fechaexa_est.Text
            Else
                fechainicio = Me.cmb_fechaexa_est.Text
                fechafin = Me.cmb_fechaexa_est.Text
            End If
        End If
    ElseIf Me.opt_tipobusqueda(1) Then
        fechainicio = Me.cmb_fechaexa1_est.Text
        fechafin = Me.cmb_fechaexa2_est.Text
    ElseIf Me.opt_tipobusqueda(2) Then
        fechainicio = Me.dtp_fecha1_est.Value
        fechafin = Me.dtp_fecha2_est.Value
    End If
    
    totaljornadas = rs.RecordCount
    rs.Close
    If Me.Opt_destino(1).Value Then
        PP1.FontName = "Arial"
        'If Me.opt_tipopapel(0).Value = True Then
            PP1.PageSize = ppLetter ' 1 es Carta
        'ElseIf Me.opt_tipopapel(1).Value = True Then
            'PP1.PageSize = ppLegal ' Es Oficio
        'End If
        Call encabezadopantalla(PP1, True)
        PP1.FontBold = True
        PP1.FontSize = 10
        Call centrarenpantalla(PP1, 1000, "ESTADISTICAS DE INSCRITOS PARA EL AÑO " & Me.cmb_anho_est.Text)
        PP1.FontBold = False
        PP1.FontSize = 9
        PP1.CurrentX = 100: PP1.CurrentY = 1300: PP1.PrintText ("Tipo de enseñanza  : " & Me.cmb_mod_est.Text)
        PP1.CurrentX = 100: PP1.CurrentY = 1550: PP1.PrintText ("Fecha de examen    : " & fechainicio & " al " & fechafin)
        Call PP1.DrawBox(50, 2000, 11500, 2700) ', , B ' ESTE ES EL PRIMER BOX DEL INFORME
        Call PP1.DrawLine(1720, 2400, 11500, 2400)
        PP1.FontSize = 9
        PP1.CurrentX = 480: PP1.CurrentY = 2150: PP1.PrintText ("CURSO")
        PP1.CurrentX = 2023: PP1.CurrentY = 2150: PP1.PrintText ("INSCRITOS")
        PP1.CurrentX = 3562: PP1.CurrentY = 2150: PP1.PrintText ("ACEPTADOS")
        PP1.CurrentX = 5180: PP1.CurrentY = 2150: PP1.PrintText ("PENDIENTES")
        PP1.CurrentX = 6785: PP1.CurrentY = 2150: PP1.PrintText ("RECHAZADOS")
        PP1.CurrentX = 8540: PP1.CurrentY = 2150: PP1.PrintText ("AUSENTES")
        PP1.CurrentX = 10008: PP1.CurrentY = 2150: PP1.PrintText ("MATRICULADOS")
        filat = 2440
        PP1.CurrentX = 1800: PP1.CurrentY = filat: PP1.PrintText ("H"): PP1.CurrentX = 2343: PP1.CurrentY = filat: PP1.PrintText ("M"):       PP1.CurrentX = 2886: PP1.CurrentY = filat: PP1.PrintText ("T")
           
        PP1.CurrentX = 3429: PP1.CurrentY = filat: PP1.PrintText ("H"): PP1.CurrentX = 3972: PP1.CurrentY = filat: PP1.PrintText ("M"): PP1.CurrentX = 4515: PP1.CurrentY = filat: PP1.PrintText ("T")
            
        PP1.CurrentX = 5058: PP1.CurrentY = filat: PP1.PrintText ("H"): PP1.CurrentX = 5601: PP1.CurrentY = filat: PP1.PrintText ("M"):       PP1.CurrentX = 6144: PP1.CurrentY = filat: PP1.PrintText ("T")
        
        PP1.CurrentX = 6687: PP1.CurrentY = filat: PP1.PrintText ("H"): PP1.CurrentX = 7230: PP1.CurrentY = filat: PP1.PrintText ("M"):       PP1.CurrentX = 7773: PP1.CurrentY = filat: PP1.PrintText ("T")
          
        PP1.CurrentX = 8316: PP1.CurrentY = filat: PP1.PrintText ("H"): PP1.CurrentX = 8859: PP1.CurrentY = filat: PP1.PrintText ("M"):       PP1.CurrentX = 9402: PP1.CurrentY = filat: PP1.PrintText ("T")
            
        PP1.CurrentX = 9945: PP1.CurrentY = filat: PP1.PrintText ("H"): PP1.CurrentX = 10488: PP1.CurrentY = filat: PP1.PrintText ("M"):       PP1.CurrentX = 11031: PP1.CurrentY = filat: PP1.PrintText ("T")
        
    Else
        Printer.FontName = "Arial"
        'If Me.opt_tipopapel(0).Value = True Then
            Printer.PaperSize = 1 ' 1 es Carta
        'ElseIf Me.opt_tipopapel(1).Value = True Then
        '    Printer.PaperSize = 5 ' 1 Es Oficio
        'End If
        Call encabezadopapel(True)
        Printer.FontBold = True
        Printer.FontSize = 10
        Call centrarenpapel(1000, "ESTADISTICAS DE INSCRITOS PARA EL AÑO " & Me.cmb_anho_est.Text)
        Printer.FontBold = False
        Printer.FontSize = 9
        Printer.CurrentX = 100: Printer.CurrentY = 1300: Printer.Print ("Tipo de enseñanza  : " & Me.cmb_mod_est.Text)
        Printer.CurrentX = 100: Printer.CurrentY = 1550: Printer.Print ("Fecha de examen    : " & fechainicio & " al " & fechafin)
        Printer.Line (50, 2000)-(11500, 2700), , B  ' ESTE ES EL PRIMER BOX DEL INFORME
        Printer.Line (1720, 2400)-(11500, 2400)
        Printer.FontSize = 9
        Printer.CurrentX = 480: Printer.CurrentY = 2150: Printer.Print ("CURSO")
        Printer.CurrentX = 2023: Printer.CurrentY = 2150: Printer.Print ("INSCRITOS")
        Printer.CurrentX = 3562: Printer.CurrentY = 2150: Printer.Print ("ACEPTADOS")
        Printer.CurrentX = 5180: Printer.CurrentY = 2150: Printer.Print ("PENDIENTES")
        Printer.CurrentX = 6785: Printer.CurrentY = 2150: Printer.Print ("RECHAZADOS")
        Printer.CurrentX = 8540: Printer.CurrentY = 2150: Printer.Print ("AUSENTES")
        Printer.CurrentX = 10008: Printer.CurrentY = 2150: Printer.Print ("MATRICULADOS")
        Filac = 2440
        Printer.CurrentX = 1800: Printer.CurrentY = Filac: Printer.Print ("H"): Printer.CurrentX = 2343: Printer.CurrentY = Filac: Printer.Print ("M"):       Printer.CurrentX = 2886: Printer.CurrentY = Filac: Printer.Print ("T")
          
        Printer.CurrentX = 3429: Printer.CurrentY = Filac: Printer.Print ("H"): Printer.CurrentX = 3972: Printer.CurrentY = Filac: Printer.Print ("M"):        Printer.CurrentX = 4515: Printer.CurrentY = Filac: Printer.Print ("T")
            
        Printer.CurrentX = 5058: Printer.CurrentY = Filac: Printer.Print ("H"): Printer.CurrentX = 5601: Printer.CurrentY = Filac: Printer.Print ("M"):       Printer.CurrentX = 6144: Printer.CurrentY = Filac: Printer.Print ("T")
            
        Printer.CurrentX = 6687: Printer.CurrentY = Filac: Printer.Print ("H"): Printer.CurrentX = 7230: Printer.CurrentY = Filac: Printer.Print ("M"):       Printer.CurrentX = 7773: Printer.CurrentY = Filac: Printer.Print ("T")
            
        Printer.CurrentX = 8316: Printer.CurrentY = Filac: Printer.Print ("H"): Printer.CurrentX = 8859: Printer.CurrentY = Filac: Printer.Print ("M"):       Printer.CurrentX = 9402: Printer.CurrentY = Filac: Printer.Print ("T")
            
        Printer.CurrentX = 9945: Printer.CurrentY = Filac: Printer.Print ("H"):        Printer.CurrentX = 10488: Printer.CurrentY = Filac: Printer.Print ("M"):        Printer.CurrentX = 11031: Printer.CurrentY = Filac: Printer.Print ("T")
    End If
    Fila = 2800
    Totalinscritos = 0: Totalinscritos1 = 0: Totalinscritos2 = 0
    Totalaceptados = 0: Totalaceptados1 = 0: Totalaceptados2 = 0
    Totalpendientes = 0: Totalpendientes1 = 0: Totalpendientes2 = 0
    Totalrechazados = 0: Totalrechazados1 = 0: Totalrechazados2 = 0
    Totalausentes = 0: Totalausentes1 = 0: Totalausentes2 = 0
    Totalmatriculados = 0: Totalmatriculados1 = 0: Totalmatriculados2 = 0
    Me.Progbar_estad.Value = 0
    Me.Progbar_estad.Max = Totalniveles
    Largocontenido = Totalniveles * (totaljornadas + 1)
    Columnas = 19
    ReDim contenido(Largocontenido, Columnas)
    For t = 1 To val(Totalniveles)
        
        Inscritos = 0: Inscritos1 = 0: Inscritos2 = 0
        Aceptados = 0: Aceptados1 = 0: Aceptados2 = 0
        Pendientes = 0: Pendientes1 = 0: Pendientes2 = 0
        Rechazados = 0: Rechazados1 = 0: Rechazados2 = 0
        Ausentes = 0: Ausentes1 = 0: Ausentes2 = 0
        Matriculados = 0: Matriculados1 = 0: Matriculados2 = 0
        Inscritosxnivel = 0: Inscritosxnivel1 = 0: Inscritosxnivel2 = 0
        Aceptadosxnivel = 0: Aceptadosxnivel1 = 0: Aceptadosxnivel2 = 0
        Pendientesxnivel = 0: Pendientesxnivel1 = 0: Pendientesxnivel2 = 0
        Rechazadosxnivel = 0: Rechazadosxnivel1 = 0: Rechazadosxnivel2 = 0
        Ausentesxnivel = 0: Ausentesxnivel1 = 0: Ausentesxnivel2 = 0
        Matriculadosxnivel = 0: Matriculadosxnivel1 = 0: Matriculadosxnivel2 = 0
        For te = 1 To totaljornadas
            Indice = Indice + 1
            valores(1, 1) = t
            valores(1, 2) = jornadas(te, 2)
            
                ' a continuacion contamos todos los inscritos hombres
              rs.CursorLocation = adUseClient: rs.Open "select count(nom_alu) from postulantes, postulaciones where postulantes.ci_alu = postulaciones.ci_alu and postulantes.num_gra = '" & t & "' and postulantes.cod_ens = '" & Codens & "' and postulantes.sex_alu ='1' and postulaciones.cod_jor = '" & jornadas(te, 1) & "' and postulaciones.anno_pos_alu = '" & Me.cmb_anho_est.Text & "' and date_format(postulaciones.vii_hor_eval,'%Y-%m-%d') >= '" & Format(fechainicio, "yyyy-mm-dd") & "' and date_format(postulaciones.vii_hor_eval,'%Y-%m-%d') <= '" & Format(fechafin, "yyyy-mm-dd") & "'", conn: Inscritos1 = rs(0): rs.Close
              
                valores(1, 3) = Inscritos1
                
                ' a continuacion contamos todos los inscritos mujeres
              
                rs.CursorLocation = adUseClient: rs.Open "select count(nom_alu) from postulantes, postulaciones where postulantes.ci_alu = postulaciones.ci_alu and postulantes.num_gra = '" & t & "' and postulantes.cod_ens = '" & Codens & "' and postulantes.sex_alu ='2' and postulaciones.cod_jor = '" & jornadas(te, 1) & "' and postulaciones.anno_pos_alu = '" & Me.cmb_anho_est.Text & "' and date_format(postulaciones.vii_hor_eval,'%Y-%m-%d') >= '" & Format(fechainicio, "yyyy-mm-dd") & "' and date_format(postulaciones.vii_hor_eval,'%Y-%m-%d') <= '" & Format(fechafin, "yyyy-mm-dd") & "'", conn: Inscritos2 = rs(0): rs.Close
                valores(1, 4) = Inscritos2
                
                Inscritos = Inscritos1 + Inscritos2
                valores(1, 5) = Inscritos
                
                ' a continuacion contamos todos los aceptados hombres
              
              rs.CursorLocation = adUseClient: rs.Open "select count(nom_alu) from postulantes, postulaciones where postulantes.ci_alu = postulaciones.ci_alu and postulantes.num_gra = '" & t & "' and postulantes.cod_ens = '" & Codens & "' and postulantes.sex_alu ='1' and postulaciones.cod_jor = '" & jornadas(te, 1) & "' and postulaciones.anno_pos_alu = '" & Me.cmb_anho_est.Text & "' and ucase(postulaciones.VIII_SIT_FIN_ALU) = 'A' and date_format(postulaciones.vii_hor_eval,'%Y-%m-%d') >= '" & Format(fechainicio, "yyyy-mm-dd") & "' and date_format(postulaciones.vii_hor_eval,'%Y-%m-%d') <= '" & Format(fechafin, "yyyy-mm-dd") & "'", conn: Aceptados1 = rs(0): rs.Close
                valores(1, 6) = Aceptados1
                
                ' a continuacion contamos todos los aceptados mujeres
                
                rs.CursorLocation = adUseClient: rs.Open "select count(nom_alu) from postulantes, postulaciones where postulantes.ci_alu = postulaciones.ci_alu and postulantes.num_gra = '" & t & "' and postulantes.cod_ens = '" & Codens & "' and postulantes.sex_alu ='2' and postulaciones.cod_jor = '" & jornadas(te, 1) & "' and postulaciones.anno_pos_alu = '" & Me.cmb_anho_est.Text & "' and ucase(postulaciones.VIII_SIT_FIN_ALU) = 'A' and date_format(postulaciones.vii_hor_eval,'%Y-%m-%d') >= '" & Format(fechainicio, "yyyy-mm-dd") & "' and date_format(postulaciones.vii_hor_eval,'%Y-%m-%d') <= '" & Format(fechafin, "yyyy-mm-dd") & "'", conn: Aceptados2 = rs(0): rs.Close
                valores(1, 7) = Aceptados2
                
                Aceptados = Aceptados1 + Aceptados2
                valores(1, 8) = Aceptados
                
                ' a continuacion contamos todos los pendientes hombres
                rs.CursorLocation = adUseClient: rs.Open "select count(nom_alu) from postulantes, postulaciones where postulantes.ci_alu = postulaciones.ci_alu and postulantes.num_gra = '" & t & "' and postulantes.cod_ens = '" & Codens & "' and postulantes.sex_alu ='1' and postulaciones.cod_jor = '" & jornadas(te, 1) & "' and postulaciones.anno_pos_alu = '" & Me.cmb_anho_est.Text & "' and ucase(postulaciones.VIII_SIT_FIN_ALU) = 'P' and date_format(postulaciones.vii_hor_eval,'%Y-%m-%d') >= '" & Format(fechainicio, "yyyy-mm-dd") & "' and date_format(postulaciones.vii_hor_eval,'%Y-%m-%d') <= '" & Format(fechafin, "yyyy-mm-dd") & "'", conn: Pendientes1 = rs(0): rs.Close
                valores(1, 9) = Pendientes1
                
                ' a continuacion contamos todos los pendientes mujeres
                
                rs.CursorLocation = adUseClient: rs.Open "select count(nom_alu) from postulantes, postulaciones where postulantes.ci_alu = postulaciones.ci_alu and postulantes.num_gra = '" & t & "' and postulantes.cod_ens = '" & Codens & "' and postulantes.sex_alu ='2' and postulaciones.cod_jor = '" & jornadas(te, 1) & "' and postulaciones.anno_pos_alu = '" & Me.cmb_anho_est.Text & "' and ucase(postulaciones.VIII_SIT_FIN_ALU) = 'P' and date_format(postulaciones.vii_hor_eval,'%Y-%m-%d') >= '" & Format(fechainicio, "yyyy-mm-dd") & "' and date_format(postulaciones.vii_hor_eval,'%Y-%m-%d') <= '" & Format(fechafin, "yyyy-mm-dd") & "'", conn: Pendientes2 = rs(0): rs.Close
                valores(1, 10) = Pendientes2
                
                Pendientes = Pendientes1 + Pendientes2
                valores(1, 11) = Pendientes
                
                ' a continuacion contamos todos los rechazados hombres
                
                rs.CursorLocation = adUseClient: rs.Open "select count(nom_alu) from postulantes, postulaciones where postulantes.ci_alu = postulaciones.ci_alu and postulantes.num_gra = '" & t & "' and postulantes.cod_ens = '" & Codens & "' and postulantes.sex_alu ='1' and postulaciones.cod_jor = '" & jornadas(te, 1) & "' and postulaciones.anno_pos_alu = '" & Me.cmb_anho_est.Text & "' and ucase(postulaciones.VIII_SIT_FIN_ALU) = 'R' and date_format(postulaciones.vii_hor_eval,'%Y-%m-%d') >= '" & Format(fechainicio, "yyyy-mm-dd") & "' and date_format(postulaciones.vii_hor_eval,'%Y-%m-%d') <= '" & Format(fechafin, "yyyy-mm-dd") & "'", conn: Rechazados1 = rs(0): rs.Close
                valores(1, 12) = Rechazados1
                
                ' a continuacion contamos todos los rechazados hombres
               
                 rs.CursorLocation = adUseClient: rs.Open "select count(nom_alu) from postulantes, postulaciones where postulantes.ci_alu = postulaciones.ci_alu and postulantes.num_gra = '" & t & "' and postulantes.cod_ens = '" & Codens & "' and postulantes.sex_alu ='2' and postulaciones.cod_jor = '" & jornadas(te, 1) & "' and postulaciones.anno_pos_alu = '" & Me.cmb_anho_est.Text & "' and ucase(postulaciones.VIII_SIT_FIN_ALU) = 'R' and date_format(postulaciones.vii_hor_eval,'%Y-%m-%d') >= '" & Format(fechainicio, "yyyy-mm-dd") & "' and date_format(postulaciones.vii_hor_eval,'%Y-%m-%d') <= '" & Format(fechafin, "yyyy-mm-dd") & "'", conn: Rechazados2 = rs(0): rs.Close
              
                valores(1, 13) = Rechazados2
                
                Rechazados = Rechazados1 + Rechazados2
                valores(1, 14) = Rechazados
                
                ' a continuacion contamos todos los ausentes hombres
                
                rs.CursorLocation = adUseClient: rs.Open "select count(nom_alu) from postulantes, postulaciones where postulantes.ci_alu = postulaciones.ci_alu and postulantes.num_gra = '" & t & "' and postulantes.cod_ens = '" & Codens & "' and postulantes.sex_alu ='1' and postulaciones.cod_jor = '" & jornadas(te, 1) & "' and postulaciones.anno_pos_alu = '" & Me.cmb_anho_est.Text & "' and ucase(postulaciones.VIII_SIT_FIN_ALU) = 'F' and date_format(postulaciones.vii_hor_eval,'%Y-%m-%d') >= '" & Format(fechainicio, "yyyy-mm-dd") & "' and date_format(postulaciones.vii_hor_eval,'%Y-%m-%d') <= '" & Format(fechafin, "yyyy-mm-dd") & "'", conn: Ausentes1 = rs(0): rs.Close
                valores(1, 15) = Ausentes1
                
                ' a continuacion contamos todos los ausentes hombres
                
                rs.CursorLocation = adUseClient: rs.Open "select count(nom_alu) from postulantes, postulaciones where postulantes.ci_alu = postulaciones.ci_alu and postulantes.num_gra = '" & t & "' and postulantes.cod_ens = '" & Codens & "' and postulantes.sex_alu ='2' and postulaciones.cod_jor = '" & jornadas(te, 1) & "' and postulaciones.anno_pos_alu = '" & Me.cmb_anho_est.Text & "' and ucase(postulaciones.VIII_SIT_FIN_ALU) = 'F' and date_format(postulaciones.vii_hor_eval,'%Y-%m-%d') >= '" & Format(fechainicio, "yyyy-mm-dd") & "' and date_format(postulaciones.vii_hor_eval,'%Y-%m-%d') <= '" & Format(fechafin, "yyyy-mm-dd") & "'", conn: Ausentes2 = rs(0): rs.Close
                valores(1, 16) = Ausentes2
                
                Ausentes = Ausentes1 + Ausentes2
                valores(1, 17) = Ausentes
                
                ' a continuacion contamos todos los matriculados hombres
                
                rs.CursorLocation = adUseClient: rs.Open "select count(nom_alu) from postulantes, postulaciones, matriculas where  postulaciones.ci_alu=postulantes.ci_alu and postulantes.ci_alu=matriculas.ci_alu and matriculas.num_gra = '" & t & "' and matriculas.cod_ens = '" & Codens & "' and matriculas.cod_jor = '" & jornadas(te, 1) & "' and matriculas.anno_mat = '" & Me.cmb_anho_est.Text & "' and postulantes.sex_alu ='1' and date_format(postulaciones.vii_hor_eval,'%Y-%m-%d') >= '" & Format(fechainicio, "yyyy-mm-dd") & "' and date_format(postulaciones.vii_hor_eval,'%Y-%m-%d') <= '" & Format(fechafin, "yyyy-mm-dd") & "'", conn: Matriculados1 = rs(0): rs.Close
                valores(1, 18) = Matriculados1
                ' Consulta antigua basada en matriculado alu
                
                               
                ' a continuacion contamos todos los matriculados mujeres
                
                 rs.CursorLocation = adUseClient: rs.Open "select count(nom_alu) from postulantes, postulaciones, matriculas where  postulaciones.ci_alu=postulantes.ci_alu and postulantes.ci_alu=matriculas.ci_alu and matriculas.num_gra = '" & t & "' and matriculas.cod_ens = '" & Codens & "' and matriculas.cod_jor = '" & jornadas(te, 1) & "' and matriculas.anno_mat = '" & Me.cmb_anho_est.Text & "' and postulantes.sex_alu ='2' and date_format(postulaciones.vii_hor_eval,'%Y-%m-%d') >= '" & Format(fechainicio, "yyyy-mm-dd") & "' and date_format(postulaciones.vii_hor_eval,'%Y-%m-%d') <= '" & Format(fechafin, "yyyy-mm-dd") & "'", conn: Matriculados2 = rs(0): rs.Close
                valores(1, 19) = Matriculados2
                ' Consulta antigua basada en matriculado alu
                
                
                
                ' Consulta antigua basada en matriculado alu
                
                ' a continuacion contamos todos los matriculados
                Matriculados = Matriculados1 + Matriculados2
                valores(1, 20) = Matriculados
            Aumento = 0
            If Me.Opt_destino(1).Value Then
                PP1.FontSize = 9
                For v = 1 To 20
                    PP1.CurrentX = 200
                    PP1.CurrentX = PP1.CurrentX + Aumento
                    PP1.CurrentY = Fila
                    PP1.PrintText (valores(1, v)):
                    If v = 1 Then
                        contenido(Indice, v) = valores(1, v)
                    ElseIf v = 2 Then
                        contenido(Indice, v - 1) = contenido(Indice, v - 1) & " " & valores(1, v)
                    Else
                        contenido(Indice, v - 1) = valores(1, v)
                    End If
                    If v = 1 Then
                        Aumento = Aumento + 200
                    ElseIf v = 2 Then
                        Aumento = Aumento + 1400 '1463
                    Else
                        Aumento = Aumento + 543 '543
                    End If
                Next v
            Else
                Printer.FontSize = 9
                For v = 1 To 20
                    Printer.CurrentX = 200
                    Printer.CurrentX = Printer.CurrentX + Aumento
                    Printer.CurrentY = Fila
                    Printer.Print (valores(1, v))
                    If v = 1 Then
                        contenido(Indice, v) = valores(1, v)
                    ElseIf v = 2 Then
                        contenido(Indice, v - 1) = contenido(Indice, v - 1) & " " & valores(1, v)
                    Else
                        contenido(Indice, v - 1) = valores(1, v)
                    End If
                    If v = 1 Then
                        Aumento = Aumento + 200
                    ElseIf v = 2 Then
                        Aumento = Aumento + 1400 '1463
                    Else
                        Aumento = Aumento + 543 '543
                    End If
                Next v
            End If
            Fila = Fila + 300
            Inscritosxnivel1 = Inscritosxnivel1 + Inscritos1
            Inscritosxnivel2 = Inscritosxnivel2 + Inscritos2
            Inscritosxnivel = Inscritosxnivel + Inscritos
            
            Aceptadosxnivel1 = Aceptadosxnivel1 + Aceptados1
            Aceptadosxnivel2 = Aceptadosxnivel2 + Aceptados2
            Aceptadosxnivel = Aceptadosxnivel + Aceptados
            
            Pendientesxnivel1 = Pendientesxnivel1 + Pendientes1
            Pendientesxnivel2 = Pendientesxnivel2 + Pendientes2
            Pendientesxnivel = Pendientesxnivel + Pendientes
            
            Rechazadosxnivel1 = Rechazadosxnivel1 + Rechazados1
            Rechazadosxnivel2 = Rechazadosxnivel2 + Rechazados2
            Rechazadosxnivel = Rechazadosxnivel + Rechazados
            
            Ausentesxnivel1 = Ausentesxnivel1 + Ausentes1
            Ausentesxnivel2 = Ausentesxnivel2 + Ausentes2
            Ausentesxnivel = Ausentesxnivel + Ausentes
            
            Matriculadosxnivel1 = Matriculadosxnivel1 + Matriculados1
            Matriculadosxnivel2 = Matriculadosxnivel2 + Matriculados2
            Matriculadosxnivel = Matriculadosxnivel + Matriculados
            
            Totalinscritos1 = Totalinscritos1 + Inscritos1
            Totalinscritos2 = Totalinscritos2 + Inscritos2
            Totalinscritos = Totalinscritos + Inscritos
            
            Totalaceptados1 = Totalaceptados1 + Aceptados1
            Totalaceptados2 = Totalaceptados2 + Aceptados2
            Totalaceptados = Totalaceptados + Aceptados
            
            Totalpendientes1 = Totalpendientes1 + Pendientes1
            Totalpendientes2 = Totalpendientes2 + Pendientes2
            Totalpendientes = Totalpendientes + Pendientes
            
            Totalrechazados1 = Totalrechazados1 + Rechazados1
            Totalrechazados2 = Totalrechazados2 + Rechazados2
            Totalrechazados = Totalrechazados + Rechazados
            
            Totalausentes1 = Totalausentes1 + Ausentes1
            Totalausentes2 = Totalausentes2 + Ausentes2
            Totalausentes = Totalausentes + Ausentes
            
            Totalmatriculados1 = Totalmatriculados1 + Matriculados1
            Totalmatriculados2 = Totalmatriculados2 + Matriculados2
            Totalmatriculados = Totalmatriculados + Matriculados
            
        Next te
        If Me.Opt_destino(1).Value Then
            Indice = Indice + 1
            PP1.CurrentX = 400: PP1.CurrentY = Fila: PP1.PrintText ("Subtotales"): contenido(Indice, 1) = "Subtotales"
            PP1.FontBold = True
            PP1.CurrentX = 1800: PP1.CurrentY = Fila: PP1.PrintText (CStr(Inscritosxnivel1)): contenido(Indice, 2) = Inscritosxnivel1
            PP1.CurrentX = 2343: PP1.CurrentY = Fila: PP1.PrintText (CStr(Inscritosxnivel2)): contenido(Indice, 3) = Inscritosxnivel2
            PP1.CurrentX = 2886: PP1.CurrentY = Fila: PP1.PrintText (CStr(Inscritosxnivel)): contenido(Indice, 4) = Inscritosxnivel
            
            PP1.CurrentX = 3429: PP1.CurrentY = Fila: PP1.PrintText (CStr(Aceptadosxnivel1)): contenido(Indice, 5) = Aceptadosxnivel1
            PP1.CurrentX = 3972: PP1.CurrentY = Fila: PP1.PrintText (CStr(Aceptadosxnivel2)): contenido(Indice, 6) = Aceptadosxnivel2
            PP1.CurrentX = 4515: PP1.CurrentY = Fila: PP1.PrintText (CStr(Aceptadosxnivel)): contenido(Indice, 7) = Aceptadosxnivel
            
            PP1.CurrentX = 5058: PP1.CurrentY = Fila: PP1.PrintText (CStr(Pendientesxnivel1)): contenido(Indice, 8) = Pendientesxnivel1
            PP1.CurrentX = 5601: PP1.CurrentY = Fila: PP1.PrintText (CStr(Pendientesxnivel2)): contenido(Indice, 9) = Pendientesxnivel2
            PP1.CurrentX = 6144: PP1.CurrentY = Fila: PP1.PrintText (CStr(Pendientesxnivel)): contenido(Indice, 10) = Pendientesxnivel
            
            PP1.CurrentX = 6687: PP1.CurrentY = Fila: PP1.PrintText (CStr(Rechazadosxnivel1)): contenido(Indice, 11) = Rechazadosxnivel1
            PP1.CurrentX = 7230: PP1.CurrentY = Fila: PP1.PrintText (CStr(Rechazadosxnivel2)): contenido(Indice, 12) = Rechazadosxnivel2
            PP1.CurrentX = 7773: PP1.CurrentY = Fila: PP1.PrintText (CStr(Rechazadosxnivel)): contenido(Indice, 13) = Rechazadosxnivel
            
            PP1.CurrentX = 8316: PP1.CurrentY = Fila: PP1.PrintText (CStr(Ausentesxnivel1)): contenido(Indice, 14) = Ausentesxnivel1
            PP1.CurrentX = 8859: PP1.CurrentY = Fila: PP1.PrintText (CStr(Ausentesxnivel2)): contenido(Indice, 15) = Ausentesxnivel2
            PP1.CurrentX = 9402: PP1.CurrentY = Fila: PP1.PrintText (CStr(Ausentesxnivel)): contenido(Indice, 16) = Ausentesxnivel
            
            PP1.CurrentX = 9945: PP1.CurrentY = Fila: PP1.PrintText (CStr(Matriculadosxnivel1)): contenido(Indice, 17) = Matriculadosxnivel1
            PP1.CurrentX = 10488: PP1.CurrentY = Fila: PP1.PrintText (CStr(Matriculadosxnivel2)): contenido(Indice, 18) = Matriculadosxnivel2
            PP1.CurrentX = 11031: PP1.CurrentY = Fila: PP1.PrintText (CStr(Matriculadosxnivel)): contenido(Indice, 19) = Matriculadosxnivel
            
            PP1.FontBold = False
            Fila = Fila + 300
            Call PP1.DrawLine(50, val(Fila), 11500, val(Fila))
        Else
            Indice = Indice + 1
            Printer.CurrentX = 400: Printer.CurrentY = Fila: Printer.Print ("Subtotales"):: contenido(Indice, 1) = "Subtotales"
            Printer.FontBold = True
            Printer.CurrentX = 1800: Printer.CurrentY = Fila: Printer.Print (CStr(Inscritosxnivel1)): contenido(Indice, 2) = Inscritosxnivel1
            Printer.CurrentX = 2343: Printer.CurrentY = Fila: Printer.Print (CStr(Inscritosxnivel2)): contenido(Indice, 3) = Inscritosxnivel2
            Printer.CurrentX = 2886: Printer.CurrentY = Fila: Printer.Print (CStr(Inscritosxnivel)): contenido(Indice, 4) = Inscritosxnivel
            
            Printer.CurrentX = 3429: Printer.CurrentY = Fila: Printer.Print (CStr(Aceptadosxnivel1)): contenido(Indice, 5) = Aceptadosxnivel1
            Printer.CurrentX = 3972: Printer.CurrentY = Fila: Printer.Print (CStr(Aceptadosxnivel2)): contenido(Indice, 6) = Aceptadosxnivel2
            Printer.CurrentX = 4515: Printer.CurrentY = Fila: Printer.Print (CStr(Aceptadosxnivel)): contenido(Indice, 7) = Aceptadosxnivel
            
            Printer.CurrentX = 5058: Printer.CurrentY = Fila: Printer.Print (CStr(Pendientesxnivel1)): contenido(Indice, 8) = Pendientesxnivel1
            Printer.CurrentX = 5601: Printer.CurrentY = Fila: Printer.Print (CStr(Pendientesxnivel2)): contenido(Indice, 9) = Pendientesxnivel2
            Printer.CurrentX = 6144: Printer.CurrentY = Fila: Printer.Print (CStr(Pendientesxnivel)): contenido(Indice, 10) = Pendientesxnivel
            
            Printer.CurrentX = 6687: Printer.CurrentY = Fila: Printer.Print (CStr(Rechazadosxnivel1)): contenido(Indice, 11) = Rechazadosxnivel1
            Printer.CurrentX = 7230: Printer.CurrentY = Fila: Printer.Print (CStr(Rechazadosxnivel2)): contenido(Indice, 12) = Rechazadosxnivel2
            Printer.CurrentX = 7773: Printer.CurrentY = Fila: Printer.Print (CStr(Rechazadosxnivel)): contenido(Indice, 13) = Rechazadosxnivel1
            
            Printer.CurrentX = 8316: Printer.CurrentY = Fila: Printer.Print (CStr(Ausentesxnivel1)): contenido(Indice, 14) = Ausentesxnivel1
            Printer.CurrentX = 8859: Printer.CurrentY = Fila: Printer.Print (CStr(Ausentesxnivel2)): contenido(Indice, 15) = Ausentesxnivel2
            Printer.CurrentX = 9402: Printer.CurrentY = Fila: Printer.Print (CStr(Ausentesxnivel)): contenido(Indice, 16) = Ausentesxnivel
            
            Printer.CurrentX = 9945: Printer.CurrentY = Fila: Printer.Print (CStr(Matriculadosxnivel1)): contenido(Indice, 17) = Matriculadosxnivel1
            Printer.CurrentX = 10488: Printer.CurrentY = Fila: Printer.Print (CStr(Matriculadosxnivel2)): contenido(Indice, 18) = Matriculadosxnivel2
            Printer.CurrentX = 11031: Printer.CurrentY = Fila: Printer.Print (CStr(Matriculadosxnivel)): contenido(Indice, 19) = Matriculadosxnivel
            Printer.FontBold = False
            Fila = Fila + 300
            Printer.Line (50, val(Fila))-(11500, val(Fila))
        End If
        Fila = Fila + 100
        
        Me.Progbar_estad.Value = Me.Progbar_estad + 1
    Next t
    
    If Me.Opt_destino(1).Value Then
        Call PP1.DrawLine(50, 2500, 50, Fila - 100) ' primera linea
        Call PP1.DrawLine(1720, 2000, 1720, Fila - 100)
        Call PP1.DrawLine(3350, 2000, 3350, Fila - 100)
        Call PP1.DrawLine(4980, 2000, 4980, Fila - 100)
        Call PP1.DrawLine(6610, 2000, 6610, Fila - 100)
        Call PP1.DrawLine(8240, 2000, 8240, Fila - 100)
        Call PP1.DrawLine(9870, 2000, 9870, Fila - 100)
        Call PP1.DrawLine(11500, 2500, 11500, Fila - 100) 'ultima linea
        Call PP1.DrawBox(50, Fila + 50, 11500, Fila + 400) ' cuadrado de los totales
        Call PP1.DrawLine(1720, Fila + 50, 1720, Fila + 400)
        Call PP1.DrawLine(3350, Fila + 50, 3350, Fila + 400)
        Call PP1.DrawLine(4980, Fila + 50, 4980, Fila + 400)
        Call PP1.DrawLine(6610, Fila + 50, 6610, Fila + 400)
        Call PP1.DrawLine(8240, Fila + 50, 8240, Fila + 400)
        Call PP1.DrawLine(9870, Fila + 50, 9870, Fila + 400)
    
        PP1.FontBold = True
        PP1.FontSize = 9
        PP1.CurrentX = 300: PP1.CurrentY = Fila + 120: PP1.PrintText ("TOTALES :"): Totales(1, 1) = "TOTALES :"
        PP1.CurrentX = 1800: PP1.CurrentY = Fila + 120: PP1.PrintText (CStr(Totalinscritos1)): Totales(1, 2) = Totalinscritos1
        PP1.CurrentX = 2343: PP1.CurrentY = Fila + 120: PP1.PrintText (CStr(Totalinscritos2)): Totales(1, 3) = Totalinscritos2
        PP1.CurrentX = 2886: PP1.CurrentY = Fila + 120: PP1.PrintText (CStr(Totalinscritos)): Totales(1, 4) = Totalinscritos
        
        PP1.CurrentX = 3429: PP1.CurrentY = Fila + 120: PP1.PrintText (CStr(Totalaceptados1)): Totales(1, 5) = Totalaceptados1
        PP1.CurrentX = 3972: PP1.CurrentY = Fila + 120: PP1.PrintText (CStr(Totalaceptados2)): Totales(1, 6) = Totalaceptados2
        PP1.CurrentX = 4515: PP1.CurrentY = Fila + 120: PP1.PrintText (CStr(Totalaceptados)): Totales(1, 7) = Totalaceptados
        
        PP1.CurrentX = 5058: PP1.CurrentY = Fila + 120: PP1.PrintText (CStr(Totalpendientes1)): Totales(1, 8) = Totalpendientes1
        PP1.CurrentX = 5601: PP1.CurrentY = Fila + 120: PP1.PrintText (CStr(Totalpendientes2)): Totales(1, 9) = Totalpendientes2
        PP1.CurrentX = 6144: PP1.CurrentY = Fila + 120: PP1.PrintText (CStr(Totalpendientes)): Totales(1, 10) = Totalpendientes
        
        PP1.CurrentX = 6687: PP1.CurrentY = Fila + 120: PP1.PrintText (CStr(Totalrechazados1)): Totales(1, 11) = Totalrechazados1
        PP1.CurrentX = 7230: PP1.CurrentY = Fila + 120: PP1.PrintText (CStr(Totalrechazados2)): Totales(1, 12) = Totalrechazados2
        PP1.CurrentX = 7773: PP1.CurrentY = Fila + 120: PP1.PrintText (CStr(Totalrechazados)): Totales(1, 13) = Totalrechazados
        
        PP1.CurrentX = 8316: PP1.CurrentY = Fila + 120: PP1.PrintText (CStr(Totalausentes1)): Totales(1, 14) = Totalausentes1
        PP1.CurrentX = 8859: PP1.CurrentY = Fila + 120: PP1.PrintText (CStr(Totalausentes2)): Totales(1, 15) = Totalausentes2
        PP1.CurrentX = 9402: PP1.CurrentY = Fila + 120: PP1.PrintText (CStr(Totalausentes)): Totales(1, 16) = Totalausentes
        
        PP1.CurrentX = 9945: PP1.CurrentY = Fila + 120: PP1.PrintText (CStr(Totalmatriculados1)): Totales(1, 17) = Totalmatriculados1
        PP1.CurrentX = 10488: PP1.CurrentY = Fila + 120: PP1.PrintText (CStr(Totalmatriculados2)): Totales(1, 18) = Totalmatriculados2
        PP1.CurrentX = 11031: PP1.CurrentY = Fila + 120: PP1.PrintText (CStr(Totalmatriculados)): Totales(1, 19) = Totalmatriculados
        
        PP1.FontBold = False
        PP1.ShowPreview
    Else
        Printer.Line (50, 2500)-(50, Fila - 100) ' primera linea
        Printer.Line (1720, 2000)-(1720, Fila - 100)
        Printer.Line (3350, 2000)-(3350, Fila - 100)
        Printer.Line (4980, 2000)-(4980, Fila - 100)
        Printer.Line (6610, 2000)-(6610, Fila - 100)
        Printer.Line (8240, 2000)-(8240, Fila - 100)
        Printer.Line (9870, 2000)-(9870, Fila - 100)
        Printer.Line (11500, 2500)-(11500, Fila - 100) 'ultima linea
        
        Printer.Line (50, Fila + 50)-(11500, Fila + 400), , B ' cuadrado de los totales
        Printer.Line (1720, Fila + 50)-(1720, Fila + 400)
        Printer.Line (3350, Fila + 50)-(3350, Fila + 400)
        Printer.Line (4980, Fila + 50)-(4980, Fila + 400)
        Printer.Line (6610, Fila + 50)-(6610, Fila + 400)
        Printer.Line (8240, Fila + 50)-(8240, Fila + 400)
        Printer.Line (9870, Fila + 50)-(9870, Fila + 400)
        Printer.FontBold = True
        Printer.FontSize = 9
        Printer.CurrentX = 300: Printer.CurrentY = Fila + 120: Printer.Print ("TOTALES :"): Totales(1, 1) = "TOTALES :"
        
        Printer.CurrentX = 1800: Printer.CurrentY = Fila + 120: Printer.Print (CStr(Totalinscritos1)): Totales(1, 2) = Totalinscritos1
        Printer.CurrentX = 2343: Printer.CurrentY = Fila + 120: Printer.Print (CStr(Totalinscritos2)): Totales(1, 3) = Totalinscritos2
        Printer.CurrentX = 2886: Printer.CurrentY = Fila + 120: Printer.Print (CStr(Totalinscritos)): Totales(1, 4) = Totalinscritos
        
        Printer.CurrentX = 3429: Printer.CurrentY = Fila + 120: Printer.Print (CStr(Totalaceptados1)): Totales(1, 5) = Totalaceptados1
        Printer.CurrentX = 3972: Printer.CurrentY = Fila + 120: Printer.Print (CStr(Totalaceptados2)): Totales(1, 6) = Totalaceptados2
        Printer.CurrentX = 4515: Printer.CurrentY = Fila + 120: Printer.Print (CStr(Totalaceptados)): Totales(1, 7) = Totalaceptados
        
        Printer.CurrentX = 5058: Printer.CurrentY = Fila + 120: Printer.Print (CStr(Totalpendientes1)): Totales(1, 8) = Totalpendientes1
        Printer.CurrentX = 5601: Printer.CurrentY = Fila + 120: Printer.Print (CStr(Totalpendientes2)): Totales(1, 9) = Totalpendientes2
        Printer.CurrentX = 6144: Printer.CurrentY = Fila + 120: Printer.Print (CStr(Totalpendientes)): Totales(1, 10) = Totalpendientes
        
        Printer.CurrentX = 6687: Printer.CurrentY = Fila + 120: Printer.Print (CStr(Totalrechazados1)): Totales(1, 11) = Totalrechazados1
        Printer.CurrentX = 7230: Printer.CurrentY = Fila + 120: Printer.Print (CStr(Totalrechazados2)): Totales(1, 12) = Totalrechazados2
        Printer.CurrentX = 7773: Printer.CurrentY = Fila + 120: Printer.Print (CStr(Totalrechazados)): Totales(1, 13) = Totalrechazados
        
        Printer.CurrentX = 8316: Printer.CurrentY = Fila + 120: Printer.Print (CStr(Totalausentes1)): Totales(1, 14) = Totalausentes1
        Printer.CurrentX = 8859: Printer.CurrentY = Fila + 120: Printer.Print (CStr(Totalausentes2)): Totales(1, 15) = Totalausentes2
        Printer.CurrentX = 9402: Printer.CurrentY = Fila + 120: Printer.Print (CStr(Totalausentes)): Totales(1, 16) = Totalausentes
        
        Printer.CurrentX = 9945: Printer.CurrentY = Fila + 120: Printer.Print (CStr(Totalmatriculados1)): Totales(1, 17) = Totalmatriculados1
        Printer.CurrentX = 10488: Printer.CurrentY = Fila + 120: Printer.Print (CStr(Totalmatriculados2)): Totales(1, 18) = Totalmatriculados2
        Printer.CurrentX = 11031: Printer.CurrentY = Fila + 120: Printer.Print (CStr(Totalmatriculados)): Totales(1, 19) = Totalmatriculados
        
        Printer.FontBold = False
        Printer.EndDoc
    End If
    If Me.Opt_destino(0) Then: MsgBox ("Proceso de impresión OK")
    Me.Progbar_estad.Value = 0
Else
    MsgBox ("Faltan opciones por seleccionar")
End If

If Largocontenido > 0 Then
    Call CreaBD(DirAplicacion & "\GesTemp.mdb")
    Set Rendim = DBEngine.Workspaces(0).OpenDatabase(DirAplicacion & "\GesTemp.mdb")
    Call CreaTabla(DirAplicacion & "\GesTemp.mdb", "Contenido", "1,10-18,3")
    Call CreaTabla(DirAplicacion & "\GesTemp.mdb", "Totales", "1,10-18,3")
        
    For R = 1 To Indice
        detal = "": ins = "": horiz = ""
        For t = 1 To Columnas
            If t = 1 Then
                If contenido(R, t) = "" Then
                    detal = detal & "Null , "
                Else
                    detal = detal & "'" & contenido(R, t) & "' , "
                End If
            Else
                If contenido(R, t) = "" Then
                    detal = detal & "Null , "
                Else
                    detal = detal & contenido(R, t) & " , "
                End If
            End If
                ins = ins & "C" & CStr(t) & ", "
        Next t
        ins = Left(ins, Len(ins) - 2): ins = "(" & ins & ")"
        detal = Left(detal, Len(detal) - 2): detal = "(" & detal & ")"
        a = "insert into Contenido " & ins & " values " & detal
        Rendim.Execute a
    Next R
   
    For R = 1 To 1
        detal = "": ins = ""
        For t = 1 To Columnas
            If t = 1 Then
                If Totales(R, t) = "" Then
                    detal = detal & "Null , "
                Else
                    detal = detal & "'" & contenido(R, t) & "' , "
                End If
            Else
                If Totales(R, t) = "" Then
                    detal = detal & "Null , "
                Else
                    detal = detal & Totales(R, t) & " , "
                End If
            End If
                ins = ins & "C" & CStr(t) & ", "
        Next t
        ins = Left(ins, Len(ins) - 2): ins = "(" & ins & ")"
        detal = Left(detal, Len(detal) - 2): detal = "(" & detal & ")"
        a = "insert into Totales " & ins & " values " & detal
        Rendim.Execute a
    Next R
    'kill (DirAplicacion & "\GesTemp.mdb")
Rendim.Close
Me.btn_EnviarxMail.Enabled = True
End If
Exit Sub
Errorimpresion:
If Err.Number = 482 Then MsgBox "Hubo un problema al imprimir."
If Err.Number = 380 Then
    If Me.Opt_destino(0) Then
        MsgBox "Error en los parámetros de impresión" & Chr(13) & "La impresora no es compatible con el tipo del papel." & Chr(13) & "Seleccione otra impresora."
    Else
        MsgBox "No es posible generar la vista preliminar con el tipo de letra seleccionado" & Chr(13) & "Seleccione otro tipo."
    End If
Else
    MsgBox (Err.Number & " " & Err.Description)
End If

End Sub

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

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

End Sub

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

Private Sub cmb_anho_est_Click()
Me.Frame_tipobusqueda.Enabled = True
For t = 0 To Me.Frame_fechas_est.count - 1
    Me.Frame_fechas_est(t).Enabled = True
Next t
Me.cmb_fechaexa_est.Clear
Me.cmb_fechaexa1_est.Clear
Me.cmb_fechaexa2_est.Clear
Me.dtp_fecha1_est.Value = Date
Me.dtp_fecha1_est.Value = Date
For t = 0 To Me.opt_tipobusqueda.count - 1
    If Me.opt_tipobusqueda(t).Value Then
        Me.opt_tipobusqueda(t).Value = False
        Me.opt_tipobusqueda(t).Value = True
        Exit For
    End If
Next t
KeyAscii = 0
End Sub

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

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

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

Private Sub cmb_fechaexa_est_Click()
Me.Chk_Fecha.Enabled = True
If Me.cmb_fechaexa_est.ListIndex = 0 Then
    Me.Chk_Fecha.Value = 0
    Me.Chk_Fecha.Visible = False
Else
    Me.Chk_Fecha.Visible = True
End If
End Sub

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

Private Sub cmb_fechaexa_reg_Click()
Me.chk_fecha_reg.Enabled = True
If Me.cmb_fechaexa_reg.ListIndex = 0 Then
    Me.chk_fecha_reg.Value = 0
    Me.chk_fecha_reg.Visible = False
Else
    Me.chk_fecha_reg.Visible = True
End If

End Sub

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

Private Sub cmb_fechaexa1_est_Click()
Codens = DevuelveCampo("codigos_ensenanza", "", "cod_ens", "des_ens = '" & Me.cmb_mod_est.Text & "'", conn)
Me.cmb_fechaexa2_est.Clear
rs.CursorLocation = adUseClient


rs.Open "select distinct date_format(postulaciones.vii_hor_eval,'%Y-%m-%d') as feceval from postulaciones, postulantes where postulaciones.ci_alu = postulantes.ci_alu and anno_pos_alu= '" & Me.cmb_anho_est.Text & "' and postulantes.cod_ens = '" & Codens & "' and date_format(postulaciones.vii_hor_eval,'%Y-%m-%d') >= '" & Format(Me.cmb_fechaexa1_est.Text, "yyyy-mm-dd") & "'  order by feceval", conn
    If rs.RecordCount > 0 Then
        While Not rs.EOF
            Me.cmb_fechaexa2_est.AddItem Format(rs("feceval"), "dd-mm-yyyy")
            rs.MoveNext
        Wend
        'Else
        '    MsgBox ("No hay fechas de examen para el año '" & Me.cmb_anho_est.Text & "'")
    End If
    rs.Close
End Sub

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

Private Sub cmb_fechaexa1_reg_Click()
Codens = DevuelveCampo("codigos_ensenanza", "", "cod_ens", "des_ens = '" & Me.cmb_mod_reg.Text & "'", conn)
Me.cmb_fechaexa2_reg.Clear
rs.CursorLocation = adUseClient

rs.Open "select distinct date(postulaciones.vii_hor_eval) as feceval from postulaciones, postulantes where postulaciones.ci_alu = postulantes.ci_alu and anno_pos_alu= '" & Me.cmb_anho_reg.Text & "' and postulantes.cod_ens = '" & Codens & "' and postulaciones.vii_hor_eval >= '" & Format(Me.cmb_fechaexa1_reg.Text, "yyyy-mm-dd") & "'  order by VII_hor_eval", conn
    If rs.RecordCount > 0 Then
        While Not rs.EOF
            Me.cmb_fechaexa2_reg.AddItem Format(rs("feceval"), "dd-mm-yyyy")
            rs.MoveNext
        Wend
        'Else
        '    MsgBox ("No hay fechas de examen para el año '" & Me.cmb_anho_est.Text & "'")
    End If
    rs.Close
End Sub

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

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

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

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

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

Private Sub cmb_mod_cob_Click()
Me.chk_todos_cob.Enabled = True
modalidad = DevuelveCampo("codigos_ensenanza", "", "cod_ens", "des_ens = '" & Me.cmb_mod_cob.Text & "'", conn)
Set rs = New ADODB.Recordset
rs.CursorLocation = adUseClient
rs.Open "SELECT num_gra, let_cur FROM CURSOS where agno = " & Anno & " and cod_ens ='" & modalidad & "' ORDER BY NUM_GRA,let_cur", conn
If rs.RecordCount > 0 Then
    ReDim Anuevocurso(rs.RecordCount, 2)
    Me.lst_cursosinf.Clear
    c = 0
    While Not rs.EOF
        lst_cursosinf.AddItem rs("num_gra") + " " + rs("LET_CUR")
        Anuevocurso(c, 1) = rs("num_gra")
        Anuevocurso(c, 2) = rs("let_cur")
        rs.MoveNext
        c = c + 1
    Wend
    End If
rs.Close
Set rs = Nothing
End Sub

Private Sub cmb_mod_est_Click()
Me.cmb_anho_est.Text = ""
Me.cmb_fechaexa_est.Text = ""
Me.Chk_Fecha.Value = 0
Me.Chk_Fecha.Visible = True
End Sub

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

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

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

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

Private Sub cmb_printers_Click()
Dim X As Printer
I = 0
For Each X In Printers
   If I = Me.cmb_printers.ListIndex Then
      ' La define como predeterminada del sistema.
      Set Printer = X
      ' Sale del bucle.
      Exit For
   End If
    I = I + 1
Next
'For t = 0 To Printer.FontCount - 1
'    Me.cmb_fuentes.AddItem Printer.Fonts(t)
'Next t
End Sub

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

Private Sub cmd_mod_rank_Click()
Dim var_sql As String
Me.chk_todos_rank.Enabled = True
modalidad = DevuelveCampo("codigos_ensenanza", "", "cod_ens", "des_ens = '" & Me.cmd_mod_rank.Text & "'", conn)
rs.CursorLocation = adUseClient
If Me.Opt_Tinf_Rank(0).Value Then
        var_sql = "SELECT c.num_gra, c.let_cur, j.des_jor FROM CURSOS c , jornadas j where c.cod_jor=j.cod_jor and cod_ens = '" & modalidad & "' and agno = " & Anno & " ORDER BY c.NUM_GRA, c.let_cur"
    ElseIf Me.Opt_Tinf_Rank(1).Value Then
        var_sql = "SELECT num_gra FROM CURSOS where cod_ens = '" & modalidad & "' and agno = " & Anno & " GROUP BY num_gra ORDER BY NUM_GRA, let_cur"
    ElseIf Me.Opt_Tinf_Rank(2).Value Then
    
    ElseIf Me.Opt_Tinf_Rank(3).Value Then
        'rango = " and rp1 < " & 4# & " and rp2 < " & 4# & " and rp3 < " & 4# & " and rpg < " & 4#
    ElseIf Me.Opt_Tinf_Rank(4).Value Then
        'single
        'rango = " and rp1 < " & 4# & " and rp2 < " & 4# & " and rp3 < " & 4# & " and rpg < " & 4#
End If
'var_sql = "SELECT c.num_gra, c.let_cur, j.des_jor FROM CURSOS c , jornadas j where c.cod_jor=j.cod_jor and cod_ens = '" & modalidad & "' and agno = " & Anno & " ORDER BY c.NUM_GRA, c.let_cur"
rs.Open var_sql, conn
If rs.RecordCount > 0 Then
    ReDim Anuevocurso(rs.RecordCount, 3)
    Me.lst_cursos_rank.Clear
    c = 0
'    While Not rs.EOF
'        lst_cursos_rank.AddItem rs("num_gra") + " " + rs("LET_CUR")
'        Anuevocurso(c, 1) = rs(0)
'        Anuevocurso(c, 2) = rs(1)
'        Anuevocurso(c, 3) = rs(2)
'        rs.MoveNext
'        c = c + 1
'    Wend
    If Me.Opt_Tinf_Rank(0).Value Then
            While Not rs.EOF
            lst_cursos_rank.AddItem rs("num_gra") + " " + rs("LET_CUR")
            Anuevocurso(c, 1) = rs(0)
            Anuevocurso(c, 2) = rs(1)
            Anuevocurso(c, 3) = rs(2)
            rs.MoveNext
            c = c + 1
            Wend
    ElseIf Me.Opt_Tinf_Rank(1).Value Then
        While Not rs.EOF
        lst_cursos_rank.AddItem rs("num_gra")
        Anuevocurso(c, 1) = rs(0)
'        Anuevocurso(c, 2) = rs(1)
'        Anuevocurso(c, 3) = rs(2)
        rs.MoveNext
        c = c + 1
    Wend
    ElseIf Me.Opt_Tinf_Rank(2).Value Then
    
    ElseIf Me.Opt_Tinf_Rank(3).Value Then
        'rango = " and rp1 < " & 4# & " and rp2 < " & 4# & " and rp3 < " & 4# & " and rpg < " & 4#
    ElseIf Me.Opt_Tinf_Rank(4).Value Then
        'single
        'rango = " and rp1 < " & 4# & " and rp2 < " & 4# & " and rp3 < " & 4# & " and rpg < " & 4#
End If
    End If
rs.Close
End Sub

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

Private Sub Command1_Click()
Unload Me
End Sub

    
Private Sub Command2_Click()

End Sub

'    End If
'rs.Close
'End Sub

Private Sub dtp_fecha1_est_Change()
Me.dtp_fecha2_est.MinDate = Me.dtp_fecha1_est.Value
Me.dtp_fecha2_est.Value = Me.dtp_fecha1_est.Value
End Sub

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

Private Sub Dtp_fecha1_reg_Change()
Me.Dtp_fecha2_reg.MinDate = Me.Dtp_fecha1_reg.Value
Me.Dtp_fecha2_reg.Value = Me.Dtp_fecha1_reg.Value

End Sub

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

Private Sub Form_Load()
Dim I As Integer
For I = 2005 To Anno
    cb_agno.AddItem I
Next I
cb_agno.Text = Anno

If Menuinformes2 = "estadisticas" Then
    Set rs = New ADODB.Recordset
    Call Form_main.hideframeimpresion2
    Me.Height = 5340
    Me.Width = 8400
    Me.Frame_estadisticas.Top = 120
    Me.Frame_estadisticas.Left = 129
    Me.Frame_estadisticas.Visible = True
    Me.Caption = "Estadisticas de postulación"
    CentrarForma Me
    Me.Show
    Call LlenaCombo(cmb_mod_est, "codigos_ensenanza", "des_ens", "order by ord_ens", conn)
    rs.CursorLocation = adUseClient
    rs.Open "select distinct anno_pos_alu from postulaciones order by anno_pos_alu", conn
    If rs.RecordCount > 0 Then
        While Not rs.EOF
            Me.cmb_anho_est.AddItem rs("anno_pos_alu")
            rs.MoveNext
        Wend
   ' Else
   '     MsgBox ("No hay postulaciones ingresadas")
    End If
    rs.Close
    
    Me.cmb_printers.Clear
    For t = 0 To Printers.count - 1
        Me.cmb_printers.AddItem Printers(t).DeviceName
        Me.cmb_printers.ItemData(Me.cmb_printers.NewIndex) = t
    Next t
    Me.Frame_tipobusqueda.Enabled = False
    For t = 0 To Me.Frame_fechas_est.count - 1
        Me.Frame_fechas_est(t).Enabled = False
    Next t
    Me.Chk_Fecha.Enabled = False
    Me.opt_tipobusqueda(0).Value = True
    Me.cmb_printers.ListIndex = 0
    Me.Opt_destino(0).Value = True
    Me.btn_EnviarxMail.Enabled = False
ElseIf Menuinformes2 = "registropostulantes" Then
    Set rs = New ADODB.Recordset
    Call Form_main.hideframeimpresion2
    Me.Height = 6400
    Me.Width = 8400
    Me.Frame_postulantes.Top = 120
    Me.Frame_postulantes.Left = 129
    Me.Frame_postulantes.Visible = True
    Me.Caption = "Registro de postulantes"
    CentrarForma Me
    Me.Show
    Call LlenaCombo(cmb_mod_reg, "codigos_ensenanza", "des_ens", "order by ord_ens", conn)
    Call LlenaCombo(cmb_jor_reg, "jornadas", "des_jor", "", conn)
    If Me.cmb_jor_reg.ListCount > 0 Then
        Me.cmb_jor_reg.AddItem "Todas"
    End If
    rs.CursorLocation = adUseClient
    rs.Open "select distinct anno_pos_alu from postulaciones order by anno_pos_alu", conn
    If rs.RecordCount > 0 Then
        While Not rs.EOF
            Me.cmb_anho_reg.AddItem rs("anno_pos_alu")
            rs.MoveNext
        Wend
    End If
    rs.Close
    Me.Frame_tipobusqueda_reg.Enabled = False
    For t = 0 To Me.Frame_fechas_reg.count - 1
        Me.Frame_fechas_reg(t).Enabled = False
    Next t
    Me.chk_fecha_reg.Enabled = False
    Me.opt_tipobusqueda_reg(0).Value = True

ElseIf Menuinformes2 = "ranking" Then
    Set rs = New ADODB.Recordset
    Call Form_main.hideframeimpresion2
    Me.Height = 4350
    Me.Width = 6300
    Me.Frame_ranking.Top = 120
    Me.Frame_ranking.Left = 129
    Me.Frame_ranking.Visible = True
    Me.Caption = "Ranking de calificaciones"
    CentrarForma Me
    Me.Show
    Call LlenaCombo(Me.cmd_mod_rank, "codigos_ensenanza", "des_ens", "where cod_ens = '110' or cod_ens = '310' order by ord_ens", conn)
    Call LlenaCombo(Me.cmb_per_rank, "periodos", "des_per", "order by num_per", conn)
    If Me.cmb_per_rank.ListCount > 0 Then
        Me.cmb_per_rank.AddItem "ANUAL"
    End If
    Me.opt_destino_rank(0).Value = True
    Me.Opt_Tinf_Rank(0).Value = True
ElseIf Menuinformes2 = "hmayores" Then
    Set rs = New ADODB.Recordset
    Me.Height = 7660
    Me.Width = 7540
    Call Form_main.hideframeimpresion2
    Busqueda = 1
    Me.Opt_destinoHM(1).Value = True
    Me.Frame_HMayores.Left = 120
    Me.Frame_HMayores.Top = 60
    Me.Frame_HMayores.Visible = True
    Me.chk_todos_cob.Value = False
    Me.btn_impri_HM.Enabled = False
    Call IniGrillaLista
    Call LlenaCombo(cmb_mod_cob, "codigos_ensenanza", "des_ens", "order by ord_ens", conn)
    Me.Show
End If
End Sub

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


Private Sub Opt_destino_Click(Index As Integer)
If Index = 0 Then
    Me.cmb_printers.Enabled = True
'    Me.cmb_fuentes.Enabled = True
ElseIf Index = 1 Then
    Me.cmb_printers.Enabled = False
'    'Me.cmb_fuentes.Text = "Arial"
'    'Me.cmb_fuentes.Enabled = False
End If
End Sub

Private Sub opt_destino_rank_Click(Index As Integer)
If Index = 1 Then
    Form_main.CrystalReport.Destination = crptToPrinter
ElseIf Index = 0 Then
    Form_main.CrystalReport.Destination = crptToWindow
End If
End Sub

Private Sub Opt_destinoHM_Click(Index As Integer)
If Index = 0 Then
    Form_main.CrystalReport.Destination = crptToPrinter
ElseIf Index = 1 Then
    Form_main.CrystalReport.Destination = crptToWindow
End If
End Sub

Private Sub Opt_Tinf_Rank_Click(Index As Integer)
Me.lst_cursos_rank.Clear
End Sub

Private Sub opt_tipobusqueda_Click(Index As Integer)
Codens = DevuelveCampo("codigos_ensenanza", "", "cod_ens", "des_ens = '" & Me.cmb_mod_est.Text & "'", conn)
If Index = 0 Then
    Me.Frame_fechas_est(1).Visible = False
    Me.Frame_fechas_est(2).Visible = False
    Me.Frame_fechas_est(0).Visible = True
    Me.cmb_fechaexa_est.Clear
    Me.cmb_fechaexa1_est.Clear
    Me.cmb_fechaexa2_est.Clear
    Me.dtp_fecha1_est.Value = Date
    Me.dtp_fecha1_est.Value = Date
    Me.Chk_Fecha.Value = 0
    Me.Chk_Fecha.Enabled = False
    rs.CursorLocation = adUseClient
    'Rs.Open "select distinct date(postulaciones.VII_FEC_EVAL) as feceval from postulaciones, postulantes where postulaciones.ci_alu = postulantes.ci_alu and anno_pos_alu= '" & Me.cmb_anho_est.Text & "' and postulantes.cod_ens = '" & Codens & "' order by VII_HOR_eval", conn
    'and date_format(po.vii_hor_eval,'%Y-%m-%d')
    rs.Open "select distinct date_format(postulaciones.vii_hor_eval,'%Y-%m-%d') as feceval from postulaciones, postulantes where postulaciones.ci_alu = postulantes.ci_alu and anno_pos_alu= '" & Me.cmb_anho_est.Text & "' and postulantes.cod_ens = '" & Codens & "' order by feceval", conn
    If rs.RecordCount > 0 Then
        Me.cmb_fechaexa_est.AddItem "Todas"
        While Not rs.EOF
            If Not Format(rs("feceval"), "dd-mm-yyyy") = "0000-00-00" Then
                Me.cmb_fechaexa_est.AddItem Format(rs("feceval"), "dd-mm-yyyy")
            End If
            rs.MoveNext
        Wend
       ' Else
         '   MsgBox ("No hay fechas de examen para el año '" & Me.cmb_anho_est.Text & "'")
    End If
    rs.Close
ElseIf Index = 1 Then
    Me.Frame_fechas_est(0).Visible = False
    Me.Frame_fechas_est(2).Visible = False
    Me.Frame_fechas_est(1).Visible = True
    Me.cmb_fechaexa_est.Clear
    Me.cmb_fechaexa1_est.Clear
    Me.cmb_fechaexa2_est.Clear
    Me.dtp_fecha1_est.Value = Date
    Me.dtp_fecha1_est.Value = Date
    Me.Chk_Fecha.Value = 0
    Me.Chk_Fecha.Enabled = False
    rs.CursorLocation = adUseClient
    'Rs.Open "select distinct postulaciones.VII_FEC_EVAL from postulaciones, postulantes where postulaciones.ci_alu = postulantes.ci_alu and anno_pos_alu= '" & Me.cmb_anho_est.Text & "' and postulantes.cod_ens = '" & Codens & "' order by VII_fec_eval", conn
    rs.Open "select distinct date_format(postulaciones.vii_hor_eval,'%Y-%m-%d') as feceval from postulaciones, postulantes where postulaciones.ci_alu = postulantes.ci_alu and anno_pos_alu= '" & Me.cmb_anho_est.Text & "' and postulantes.cod_ens = '" & Codens & "' order by feceval", conn
    If rs.RecordCount > 0 Then
        Me.cmb_fechaexa_est.AddItem "Todas"
        While Not rs.EOF
            Me.cmb_fechaexa1_est.AddItem Format(rs("feceval"), "dd-mm-yyyy")
            rs.MoveNext
        Wend
       ' Else
        '    MsgBox ("No hay fechas de examen para el año '" & Me.cmb_anho_est.Text & "'")
    End If
    rs.Close
Else
    Me.Frame_fechas_est(0).Visible = False
    Me.Frame_fechas_est(1).Visible = False
    Me.Frame_fechas_est(2).Visible = True
    Me.cmb_fechaexa_est.Clear
    Me.cmb_fechaexa1_est.Clear
    Me.cmb_fechaexa2_est.Clear
    Me.dtp_fecha1_est.Value = Date
    Me.dtp_fecha2_est.Value = Date
    Me.Chk_Fecha.Value = 0
    Me.Chk_Fecha.Enabled = False
End If

End Sub

Private Sub opt_tipobusqueda_reg_Click(Index As Integer)
Codens = DevuelveCampo("codigos_ensenanza", "", "cod_ens", "des_ens = '" & Me.cmb_mod_reg.Text & "'", conn)
If Index = 0 Then
    Me.Frame_fechas_reg(1).Visible = False
    Me.Frame_fechas_reg(2).Visible = False
    Me.Frame_fechas_reg(0).Visible = True
    Me.cmb_fechaexa_reg.Clear
    Me.cmb_fechaexa1_reg.Clear
    Me.cmb_fechaexa2_reg.Clear
    Me.Dtp_fecha1_reg.Value = Date
    Me.Dtp_fecha1_reg.Value = Date
    Me.chk_fecha_reg.Value = 0
    Me.chk_fecha_reg.Enabled = False
    rs.CursorLocation = adUseClient
    'Rs.Open "select distinct postulaciones.VII_FEC_EVAL from postulaciones, postulantes where postulaciones.ci_alu = postulantes.ci_alu and anno_pos_alu= '" & Me.cmb_anho_reg.Text & "' and postulantes.cod_ens = '" & Codens & "' order by VII_fec_eval", conn
      rs.Open "select distinct date(postulaciones.vii_hor_eval) as feceval from postulaciones, postulantes where postulaciones.ci_alu = postulantes.ci_alu and anno_pos_alu= '" & Me.cmb_anho_reg.Text & "' and postulantes.cod_ens = '" & Codens & "' order by VII_HOR_eval", conn
    If rs.RecordCount > 0 Then
        Me.cmb_fechaexa_reg.AddItem "Todas"
        While Not rs.EOF
            If Not IsNull(rs("feceval")) Then
                Me.cmb_fechaexa_reg.AddItem IIf(Format(rs("feceval"), "dd-mm-yyyy") = "0000-00-00", "2008-01-01", Format(rs("feceval"), "dd-mm-yyyy"))
            End If
            rs.MoveNext
        Wend
        'Else
          '  MsgBox ("No hay fechas de examen para el año '" & Me.cmb_anho_reg.Text & "'")
    End If
    rs.Close
ElseIf Index = 1 Then
    Me.Frame_fechas_reg(0).Visible = False
    Me.Frame_fechas_reg(2).Visible = False
    Me.Frame_fechas_reg(1).Visible = True
    Me.cmb_fechaexa_reg.Clear
    Me.cmb_fechaexa1_reg.Clear
    Me.cmb_fechaexa2_reg.Clear
    Me.Dtp_fecha1_reg.Value = Date
    Me.Dtp_fecha1_reg.Value = Date
    Me.chk_fecha_reg.Value = 0
    Me.chk_fecha_reg.Enabled = False
    rs.CursorLocation = adUseClient
    'Rs.Open "select distinct postulaciones.VII_FEC_EVAL from postulaciones, postulantes where postulaciones.ci_alu = postulantes.ci_alu and anno_pos_alu= '" & Me.cmb_anho_reg.Text & "' and postulantes.cod_ens = '" & Codens & "' order by VII_fec_eval", conn
    rs.Open "select distinct date(postulaciones.vii_hor_eval) as feceval from postulaciones, postulantes where postulaciones.ci_alu = postulantes.ci_alu and anno_pos_alu= '" & Me.cmb_anho_reg.Text & "' and postulantes.cod_ens = '" & Codens & "' order by VII_HOR_eval", conn
    If rs.RecordCount > 0 Then
        Me.cmb_fechaexa_reg.AddItem "Todas"
        While Not rs.EOF
            Me.cmb_fechaexa1_reg.AddItem Format(rs("feceval"), "dd-mm-yyyy")
            rs.MoveNext
        Wend
        'Else
         '   MsgBox ("No hay fechas de examen para el año '" & Me.cmb_anho_reg.Text & "'")
    End If
    rs.Close
Else
    Me.Frame_fechas_reg(0).Visible = False
    Me.Frame_fechas_reg(1).Visible = False
    Me.Frame_fechas_reg(2).Visible = True
    Me.cmb_fechaexa_reg.Clear
    Me.cmb_fechaexa1_reg.Clear
    Me.cmb_fechaexa2_reg.Clear
    Me.Dtp_fecha1_reg.Value = Date
    Me.Dtp_fecha2_reg.Value = Date
    Me.Chk_Fecha.Value = 0
    Me.Chk_Fecha.Enabled = False
End If

End Sub

Sub IniGrillaLista()
Me.Grd_Apod_Cob.Clear
Me.Grd_Apod_Cob.Rows = 10
Me.Grd_Apod_Cob.Cols = 5
Me.Grd_Apod_Cob.FixedCols = 0
Me.Grd_Apod_Cob.FixedRows = 1
                              '   0      1          2             3                 4
Me.Grd_Apod_Cob.FormatString = "Item |Curso  |Nombre alumno|Nombre apoderado |Rut apoderado"
Me.Grd_Apod_Cob.ColWidth(0) = 400
Me.Grd_Apod_Cob.ColWidth(1) = 700
Me.Grd_Apod_Cob.ColWidth(2) = 3900
Me.Grd_Apod_Cob.ColWidth(3) = 1200
Me.Grd_Apod_Cob.ColWidth(3) = 3900
End Sub
Sub ArmaCursos()
Dim Ngrado As String, letra As String, modalidad As String, Con As Integer
Con = 0
SelCursos = ""
If Me.lst_cursosinf.SelCount > 0 And Me.cmb_mod_cob.Text <> "" Then
    modalidad = DevuelveCampo("codigos_ensenanza", "", "cod_ens", "des_ens = '" & Me.cmb_mod_cob.Text & "'", conn)
    For t = 0 To Me.lst_cursosinf.ListCount - 1
        If Me.lst_cursosinf.Selected(t) Then
            Con = t
        End If
    Next t
    For t = 0 To Me.lst_cursosinf.ListCount - 1
        If Me.lst_cursosinf.Selected(t) Then
            Ngrado = Anuevocurso(t, 1)
            letra = Anuevocurso(t, 2)
            If t = Con Then
                SelCursos = SelCursos & "(ac.num_gra  = '" & Ngrado & "' and ac.let_cur = '" & letra & "' and ac.cod_ens ='" & modalidad & "')"
            Else
                SelCursos = SelCursos & "(ac.num_gra  = '" & Ngrado & "' and ac.let_cur = '" & letra & "' and ac.cod_ens ='" & modalidad & "')" & " or "
            End If
        End If
    Next
    SelCursos = "and (" & SelCursos & ")"
End If
End Sub
