VERSION 5.00
Object = "{86CF1D34-0C5F-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCT2.OCX"
Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "mscomctl.ocx"
Object = "{6B7E6392-850A-101B-AFC0-4210102A8DA7}#1.3#0"; "comctl32.ocx"
Object = "{0ECD9B60-23AA-11D0-B351-00A0C9055D8E}#6.0#0"; "MSHFLXGD.OCX"
Begin VB.Form Form_Seguimiento_Cheques 
   BorderStyle     =   1  'Fixed Single
   Caption         =   "Seguimiento de Cheques"
   ClientHeight    =   8205
   ClientLeft      =   45
   ClientTop       =   435
   ClientWidth     =   11340
   Icon            =   "Form_Seguimiento_Cheques.frx":0000
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MDIChild        =   -1  'True
   MinButton       =   0   'False
   ScaleHeight     =   8205
   ScaleWidth      =   11340
   Begin VB.Frame Frame4 
      Caption         =   "Exportar a Excel por:"
      BeginProperty Font 
         Name            =   "Arial"
         Size            =   8.25
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H00C00000&
      Height          =   1815
      Left            =   120
      TabIndex        =   44
      Top             =   6240
      Width           =   7815
      Begin VB.OptionButton opt_vencimiento 
         Caption         =   "Vencimiento"
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   255
         Left            =   360
         TabIndex        =   52
         Top             =   840
         Width           =   1335
      End
      Begin VB.OptionButton opt_folios 
         Caption         =   "Fechas"
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   255
         Left            =   360
         TabIndex        =   51
         Top             =   360
         Value           =   -1  'True
         Width           =   1455
      End
      Begin VB.CommandButton Command1 
         Caption         =   "Exportar Excel"
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   855
         Left            =   5640
         Picture         =   "Form_Seguimiento_Cheques.frx":2A8B2
         Style           =   1  'Graphical
         TabIndex        =   50
         Top             =   240
         Width           =   1815
      End
      Begin MSComCtl2.DTPicker dtp_ini 
         Height          =   375
         Left            =   3720
         TabIndex        =   46
         Top             =   240
         Width           =   1575
         _ExtentX        =   2778
         _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          =   51052545
         CurrentDate     =   41030
      End
      Begin MSComCtl2.DTPicker dtp_finn 
         Height          =   375
         Left            =   3720
         TabIndex        =   48
         Top             =   720
         Width           =   1575
         _ExtentX        =   2778
         _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          =   51052545
         CurrentDate     =   41060
      End
      Begin ComctlLib.ProgressBar pgBar 
         Height          =   255
         Left            =   240
         TabIndex        =   49
         Top             =   1320
         Width           =   7215
         _ExtentX        =   12726
         _ExtentY        =   450
         _Version        =   327682
         Appearance      =   1
      End
      Begin VB.Label Label6 
         Caption         =   "Fecha final"
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   495
         Left            =   2400
         TabIndex        =   47
         Top             =   840
         Width           =   1215
      End
      Begin VB.Label Label5 
         Caption         =   "Fecha inicial"
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   495
         Left            =   2400
         TabIndex        =   45
         Top             =   360
         Width           =   1095
      End
   End
   Begin VB.ListBox lst_rut_apo 
      BeginProperty Font 
         Name            =   "Arial"
         Size            =   8.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   1320
      Left            =   9120
      TabIndex        =   36
      Top             =   720
      Visible         =   0   'False
      Width           =   1095
   End
   Begin VB.ListBox lst_nom_apo 
      BeginProperty Font 
         Name            =   "Arial"
         Size            =   8.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   1320
      Left            =   5400
      TabIndex        =   0
      Top             =   720
      Visible         =   0   'False
      Width           =   3255
   End
   Begin VB.Frame frame_cheques 
      Height          =   3855
      Left            =   3480
      TabIndex        =   20
      Top             =   1680
      Visible         =   0   'False
      Width           =   4215
      Begin VB.ComboBox cb_datos 
         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        =   42
         Text            =   "Combo1"
         Top             =   2640
         Visible         =   0   'False
         Width           =   2175
      End
      Begin VB.ComboBox cb_estado 
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   330
         ItemData        =   "Form_Seguimiento_Cheques.frx":2AE98
         Left            =   1800
         List            =   "Form_Seguimiento_Cheques.frx":2AE9A
         Style           =   2  'Dropdown List
         TabIndex        =   28
         Top             =   2160
         Width           =   2175
      End
      Begin VB.CommandButton cmd_CambiarEstado 
         Caption         =   "Cambiar"
         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          =   375
         Left            =   480
         TabIndex        =   22
         Top             =   3120
         Width           =   1455
      End
      Begin VB.CommandButton cmd_Salir 
         Caption         =   "Salir"
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   375
         Left            =   2160
         TabIndex        =   21
         Top             =   3120
         Width           =   1455
      End
      Begin VB.Label lbl_datos 
         Caption         =   "Label5"
         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        =   43
         Top             =   2640
         Visible         =   0   'False
         Width           =   1455
      End
      Begin VB.Label Label16 
         Caption         =   "Cambiar estado a:"
         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        =   34
         Top             =   2160
         Width           =   1455
      End
      Begin VB.Label lbl_estado 
         Caption         =   "Label20"
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H000000FF&
         Height          =   255
         Left            =   1800
         TabIndex        =   33
         Top             =   1680
         Width           =   1695
      End
      Begin VB.Label lbl_fecha 
         Caption         =   "Label19"
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   255
         Left            =   1800
         TabIndex        =   32
         Top             =   1320
         Width           =   1575
      End
      Begin VB.Label lbl_monto 
         Caption         =   "Label18"
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   255
         Left            =   1800
         TabIndex        =   31
         Top             =   960
         Width           =   735
      End
      Begin VB.Label lbl_numero_cheque 
         Caption         =   "Label17"
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   255
         Left            =   1800
         TabIndex        =   30
         Top             =   600
         Width           =   1695
      End
      Begin VB.Label lbl_cta_cte 
         Caption         =   "Label16"
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   255
         Left            =   1800
         TabIndex        =   29
         Top             =   240
         Width           =   1575
      End
      Begin VB.Label Label11 
         Caption         =   "Nro Cheque:"
         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        =   27
         Top             =   600
         Width           =   1455
      End
      Begin VB.Label Label12 
         Caption         =   "Cuenta Corriente:"
         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        =   26
         Top             =   240
         Width           =   1575
      End
      Begin VB.Label Label13 
         Caption         =   "Monto:"
         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        =   25
         Top             =   960
         Width           =   615
      End
      Begin VB.Label Label14 
         Caption         =   "Estado:"
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   255
         Left            =   240
         TabIndex        =   24
         Top             =   1680
         Width           =   855
      End
      Begin VB.Label Label15 
         Caption         =   "Fecha:"
         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        =   23
         Top             =   1320
         Width           =   735
      End
   End
   Begin VB.Frame Frame2 
      Caption         =   "Opciones"
      BeginProperty Font 
         Name            =   "Arial"
         Size            =   8.25
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H00C00000&
      Height          =   975
      Left            =   120
      TabIndex        =   4
      Top             =   120
      Width           =   3135
      Begin VB.OptionButton Option1 
         Caption         =   "Por Titular"
         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        =   6
         Top             =   525
         Width           =   1695
      End
      Begin VB.OptionButton Option1 
         Caption         =   "Por Fecha"
         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            =   1200
         TabIndex        =   5
         Top             =   240
         Value           =   -1  'True
         Width           =   1695
      End
      Begin VB.Label Label4 
         Caption         =   "Seleccionar"
         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        =   7
         Top             =   405
         Width           =   975
      End
   End
   Begin VB.Frame Frame6 
      Height          =   735
      Left            =   8040
      TabIndex        =   1
      Top             =   6240
      Width           =   3135
      Begin VB.CommandButton cmd_limpiar 
         Caption         =   "Limpiar"
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   375
         Left            =   120
         TabIndex        =   3
         Top             =   240
         Width           =   1335
      End
      Begin VB.CommandButton Command3 
         Caption         =   "Salir"
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   375
         Left            =   1560
         TabIndex        =   2
         Top             =   240
         Width           =   1455
      End
   End
   Begin MSComctlLib.ProgressBar progreso 
      Height          =   375
      Left            =   120
      TabIndex        =   35
      Top             =   5880
      Width           =   11055
      _ExtentX        =   19500
      _ExtentY        =   661
      _Version        =   393216
      Appearance      =   1
      Max             =   1
      Scrolling       =   1
   End
   Begin VB.Frame Frame3 
      Caption         =   "Listado de Cheques"
      BeginProperty Font 
         Name            =   "Arial"
         Size            =   8.25
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H00C00000&
      Height          =   4575
      Left            =   120
      TabIndex        =   16
      Top             =   1200
      Width           =   11055
      Begin MSHierarchicalFlexGridLib.MSHFlexGrid grid 
         Height          =   4215
         Left            =   120
         TabIndex        =   17
         Top             =   240
         Width           =   10815
         _ExtentX        =   19076
         _ExtentY        =   7435
         _Version        =   393216
         FocusRect       =   0
         FillStyle       =   1
         SelectionMode   =   1
         BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         _NumberOfBands  =   1
         _Band(0).Cols   =   2
      End
   End
   Begin VB.Frame Frame1 
      Caption         =   "Selección por 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          =   975
      Left            =   3360
      TabIndex        =   8
      Top             =   120
      Width           =   7815
      Begin MSComCtl2.DTPicker dtp_fin 
         Height          =   375
         Left            =   4920
         TabIndex        =   41
         Top             =   360
         Width           =   1575
         _ExtentX        =   2778
         _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          =   51052545
         CurrentDate     =   41568
      End
      Begin MSComCtl2.DTPicker dtp_inicio 
         Height          =   375
         Left            =   1560
         TabIndex        =   39
         Top             =   360
         Width           =   1575
         _ExtentX        =   2778
         _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          =   51052545
         CurrentDate     =   41568
      End
      Begin VB.CommandButton Btn_Ver_Lista 
         Caption         =   "Ver"
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   615
         Left            =   6960
         Picture         =   "Form_Seguimiento_Cheques.frx":2AE9C
         Style           =   1  'Graphical
         TabIndex        =   9
         Top             =   240
         Width           =   735
      End
      Begin VB.Label Label3 
         Caption         =   "Fecha Final"
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   255
         Left            =   3840
         TabIndex        =   40
         Top             =   480
         Width           =   1095
      End
      Begin VB.Label Label2 
         Caption         =   "Fecha Inicial"
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   255
         Left            =   480
         TabIndex        =   38
         Top             =   480
         Width           =   1095
      End
   End
   Begin VB.Frame Frame5 
      Caption         =   "Seleccion por Titular"
      BeginProperty Font 
         Name            =   "Arial"
         Size            =   8.25
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H00C00000&
      Height          =   975
      Left            =   3360
      TabIndex        =   10
      Top             =   120
      Width           =   7815
      Begin VB.ComboBox cb_agno_apo 
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   330
         Left            =   480
         TabIndex        =   18
         Top             =   360
         Width           =   855
      End
      Begin VB.CommandButton Btn_Ver_Apoderado 
         Caption         =   "Ver"
         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          =   615
         Left            =   6960
         Picture         =   "Form_Seguimiento_Cheques.frx":2B413
         Style           =   1  'Graphical
         TabIndex        =   13
         Top             =   240
         Width           =   735
      End
      Begin VB.TextBox txt_rut_apo 
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   285
         Left            =   5760
         TabIndex        =   12
         Top             =   360
         Width           =   1095
      End
      Begin VB.TextBox txt_nom_apo 
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   285
         Left            =   2040
         TabIndex        =   11
         Text            =   "Text3"
         Top             =   360
         Width           =   3255
      End
      Begin VB.Label Label9 
         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            =   120
         TabIndex        =   19
         Top             =   360
         Width           =   375
      End
      Begin VB.Label Label8 
         Caption         =   "Run"
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   255
         Left            =   5400
         TabIndex        =   15
         Top             =   360
         Width           =   495
      End
      Begin VB.Label Label7 
         Caption         =   "Nombre"
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   255
         Left            =   1440
         TabIndex        =   14
         Top             =   360
         Width           =   615
      End
   End
   Begin VB.Label Label1 
      Caption         =   "Fecha inicial"
      BeginProperty Font 
         Name            =   "Arial"
         Size            =   8.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   495
      Left            =   3600
      TabIndex        =   37
      Top             =   360
      Width           =   1095
   End
End
Attribute VB_Name = "Form_Seguimiento_Cheques"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim fra, fna, frp, fnp As Boolean
Private Sub Rec2Grid(ByRef REC As ADODB.Recordset, ByRef grid As Object, Optional ByVal Numeracion As Boolean = True)
    grid.ClearStructure
    If REC.RecordCount > 0 Then
        grid.Cols = REC.Fields.count + 1
        grid.Rows = REC.RecordCount + 1
        grid.FixedCols = 1
        grid.FixedRows = 1
        grid.TextMatrix(0, 0) = "Nº"
        grid.ColWidth(0) = IIf(Numeracion, TextWidth(grid.TextMatrix(0, 0)) + 100, 0)
        For i = 1 To REC.Fields.count
            grid.TextMatrix(0, i) = UCase(REC.Fields(i - 1).Name)
            grid.ColWidth(i) = TextWidth(grid.TextMatrix(0, i)) + 100
        Next i
        REC.MoveFirst
        For i = 1 To REC.RecordCount
            progreso.Value = i
            grid.TextMatrix(i, 0) = i
            grid.ColWidth(0) = IIf(Numeracion, IIf(TextWidth(grid.TextMatrix(i, 0)) + 100 > grid.ColWidth(0), TextWidth(grid.TextMatrix(i, 0)) + 100, grid.ColWidth(0)), 0)
            For j = 1 To REC.Fields.count
                grid.TextMatrix(i, j) = IIf(IsNull(REC(j - 1)), "Null", REC(j - 1))
                grid.ColWidth(j) = IIf(TextWidth(grid.TextMatrix(i, j)) + 100 > grid.ColWidth(j), TextWidth(grid.TextMatrix(i, j)) + 100, grid.ColWidth(j))
            Next j
            REC.MoveNext
        Next i
    Else
        grid.Cols = 2
        grid.Rows = 2
    End If
End Sub

Private Sub Btn_Ver_Alumno_Click()
    If txt_nom_alu.Text <> "" And txt_rut_alu.Text <> "" Then
        bloquear_opciones
        llena_grilla_con_cheques
    Else
        MsgBox "Para realizar la busqueda primero debe seleccionar un alumno", vbInformation
    End If
End Sub

Private Sub Btn_Ver_Apoderado_Click()
    If txt_nom_apo.Text <> "" And txt_rut_apo.Text <> "" Then
        bloquear_opciones
        llena_grilla_con_cheques
    Else
        MsgBox "Para realizar la busqueda primero debe seleccionar un apoderado", vbInformation
    End If
End Sub

Private Sub Btn_Ver_Lista_Click()
    bloquear_opciones
    llena_grilla_con_cheques
    Frame1.Enabled = False
End Sub

Private Sub cmd_cancelado_Click()
Dim R As Integer
R = MsgBox("¿Esta seguro de que desea marcar el cheque como cobrado?", _
vbQuestion + vbYesNo, "Mensaje de confirmación")
If R = 6 Then
    MsgBox "si"
Else
    MsgBox "no"
End If
End Sub

Private Sub cb_estado_Click()
    Dim Estado As String
    Dim var_sql As String
    Dim objRS As ADODB.Recordset
    Set objRS = New ADODB.Recordset
    Estado = grid.TextMatrix(grid.Row, 8)
    If cb_estado.Text <> Estado Then
        
        If cb_estado.Text = "Factoring" Or cb_estado.Text = "Devuelto" Then
          
    
            If cb_estado = "Factoring" Then
                lbl_datos.Visible = True
                cb_datos.Visible = True
                lbl_datos.Caption = "Factoring"
                var_sql = "SELECT * FROM fnza_factoring"
                objRS.Open var_sql, conn
                cb_datos.Clear
                While Not objRS.EOF
                    cb_datos.Tag = objRS("cod_fac")
                    cb_datos.AddItem objRS("factoring")
                    objRS.MoveNext
                Wend
                objRS.Close
            End If
            If cb_estado = "Devuelto" Then
                lbl_datos.Visible = True
                cb_datos.Visible = True
                lbl_datos.Caption = "Motivo"
                var_sql = "SELECT * FROM fnza_codigos_cheque_devuelto"
                objRS.Open var_sql, conn
                cb_datos.Clear
                While Not objRS.EOF
                    cb_datos.Tag = objRS("cod_est")
                    cb_datos.AddItem objRS("estado")
                    objRS.MoveNext
                Wend
                objRS.Close
            End If
        Else
             lbl_datos.Visible = False
             cb_datos.Visible = False
        End If
                
        cmd_CambiarEstado.Enabled = True
    End If
End Sub

Private Sub cmd_CambiarEstado_Click()
    Dim estado_ant, Clave, Estado, var_sql, pass, Password As String
    Dim R As Integer
    Dim varsql As String
    Dim objRS As ADODB.Recordset
    Set objRS = New ADODB.Recordset
    Dim accion_detalle As String
    Dim colegio As String
    Dim Codigo As Integer
    Dim conecta As Boolean
    
    If cb_estado.Text <> "" Then
        
        R = MsgBox("¿Esta seguro de que desea cambiar el estado a " & cb_estado.Text & "?", _
        vbQuestion + vbYesNo, "Mensaje de confirmación")
        If R = 6 Then
            
            '******************************************************************
            'Obtengo password
'            varsql = "SELECT valor FROM `cfg`" _
'                    & " where param = 'password_cheques'"
'            objRS.Open varsql, conn
'            password = objRS("valor")
'            objRS.Close
            
            '*******************************************************************
        '    obtengo desde la base de datos el codigo del estado de cheque final
            var_sql = "select cod_est from fnza_estados_cheques" _
                    & " where estado = '" & cb_estado.Text & "'"
            objRS.Open var_sql, conn
            If Not objRS.EOF Then
                Estado = objRS("cod_est")
            End If
            objRS.Close
                        
            
            '*****************************************************************
            'Pido password si el estado al que se quiere cambiar es
'            If pass = "SI" Then
'                Clave = InputBox("Para cambiar al estado seleccionado, debe ingresar su clave de autorizacion." & vbCrLf & "Password:", "Password")
'                If Clave <> password Then
'                    MsgBox "Password Incorrecta", vbCritical
'                    Exit Sub
'                End If
'            End If
'
            '**********************************************************************
            'obtengo desde la base de datos el codigo del estado de cheque anterior
            var_sql = "select cod_est from fnza_estados_cheques" _
                    & " where estado = '" & lbl_estado.Caption & "'"
            objRS.Open var_sql, conn
            If Not objRS.EOF Then
                estado_ant = objRS("cod_est")
            End If
            objRS.Close
                        
            '*****************************************************************
'            'Pido password en caso de que el usuario quiera cambiar el estado cobrado a otro estado
'            If estado_ant = "clda" Then
'                 Clave = InputBox("Esta tratando de modificar el estado a un cheque ya cancelado y debe ingresar el password de validacion." & vbCrLf & "Password:", "Password")
'                 If Clave <> password Then
'                     MsgBox "Password Incorrecta", vbCritical
'                     Exit Sub
'                 End If
'            End If
            
            '********************************************************
            'Verifico que los cheques esten en el estado previo antes de ser cambiado
'            If (Estado = "resc" Or Estado = "prto") Then
'                If estado_ant <> "cart" And estado_ant <> "clda" Then
'                    MsgBox "Para poder cambiar el estado del cheque a " & cb_estado.Text _
'                    & ", el estado anterior debe ser En Cartera", vbInformation
'                    Exit Sub
'                End If
'                varsql = " SELECT fdm.folio_blta, fdm.folio_mvto, fmm.monto_pago,fcm.run_apo " & _
'                         " FROM fnza_chq_mvto fcm, fnza_dtll_mvto fdm, fnza_movimientos_mensualidad fmm " & _
'                         " where fdm.folio_mvto = fcm.folio_mvto and fmm.folio_mvto = fdm.folio_mvto and fmm.folio_dtll = fdm.folio_dtll and fcm.folio_chq = " & grid.TextMatrix(grid.Row, 1)
'                objRS.Open varsql, conn
'                If objRS.RecordCount = 0 Then
'                    MsgBox "Para poder cambiar el estado del cheque a " & cb_estado.Text _
'                    & ", el cheque debe estar vinculado a algun movimiento", vbInformation
'                    Exit Sub
'                End If
                '******************************************************
                
                '******************************************************
'                While Not objRS.EOF
'                    CreaNTCR objRS("folio_blta"), objRS("folio_mvto"), objRS("monto_pago"), objRS("run_apo"), IIf((Estado = "prto"), "1", "2"), conn
'                    objRS.MoveNext
'                Wend
'                objRS.Close
'            End If
            
'            If (Estado = "acla" Or Estado = "cjud") And estado_ant <> "prto" Then
'                    MsgBox "Para poder cambiar el estado del cheque a " & cb_estado.Text _
'                    & ", el estado anterior debe ser Protestado", vbInformation
'                    Exit Sub
'            End If
            
'            If (Estado = "clda" Or Estado = "cart") Then
'                If Not (estado_ant = "cart" Or estado_ant = "dsto" Or estado_ant = "endo" _
'                Or estado_ant = "fact" Or estado_ant = "gtia" Or estado_ant = "cjte") Then
'                    MsgBox "Para poder cambiar el estado del cheque a " & cb_estado.Text _
'                    & ", el estado anterior debe ser cualquiera de los siguientes En cartera, En Descuento, Endosado, En Factoring, En Garantía o Cobrado Judicialmente", vbInformation
'                    Exit Sub
'                End If
'            End If
            
            '*********************************************************
            'actualizamos la base de datos cheques con el nuevo estado
                  
            var_sql = "update fnza_cheques_recibidos set" _
                    & " cod_estado = '" & Estado _
                    & "',cod_devuelto = null,cod_factoring = null where folio_chq = " & grid.TextMatrix(grid.Row, 1)
            conn.Execute var_sql
            grid.TextMatrix(grid.Row, 9) = ""
            grid.TextMatrix(grid.Row, 10) = ""
                                              
            If cb_estado.Text = "Factoring" Then
                If cb_datos.Text <> "" Then
                    Codigo = DevuelveCampo("fnza_factoring", "", "cod_fac", "factoring = '" & cb_datos.Text & "'", conn)
                    var_sql = "update fnza_cheques_recibidos set" _
                        & " cod_factoring = '" & Codigo _
                        & "' where folio_chq = " & grid.TextMatrix(grid.Row, 1)
                    conn.Execute var_sql
                    'lbl_estado = cb_estado.Text
                    grid.TextMatrix(grid.Row, 9) = cb_datos.Text
                Else
                    MsgBox "Antes debe seleccionar factoring", vbInformation
                    Exit Sub
                End If
                
            End If
            
            If cb_estado.Text = "Devuelto" Then
                If cb_datos.Text <> "" Then
                Codigo = DevuelveCampo("fnza_codigos_cheque_devuelto", "", "cod_est", "estado = '" & cb_datos.Text & "'", conn)
                var_sql = "update fnza_cheques_recibidos set" _
                    & " cod_devuelto = '" & Codigo _
                    & "' where folio_chq = " & grid.TextMatrix(grid.Row, 1)
                conn.Execute var_sql
                'lbl_estado = cb_estado.Text
                grid.TextMatrix(grid.Row, 10) = cb_datos.Text
                Else
                    MsgBox "Antes debe seleccionar el motivo de la devolución", vbInformation
                    Exit Sub
                End If
            End If
            
            '*********************************************************
            'dejamos en el log el cambio que se le realizo al cheque
            var_sql = " INSERT INTO fnza_chq_log (folio_chq, estado_anterior,estado_actual,fecha,usuario,ip,proceso)" & _
                      " VALUES (" & grid.TextMatrix(grid.Row, 1) & ",'" & estado_ant & "','" & Estado & "', concat(date_format(current_date,'%Y-%m-%d'),' ',current_time),'" & Nom_usu_ses & "','" & Form_main.Winsock1.LocalIP & "','cambio manual');"
            conn.Execute var_sql
            
            'Log fnza_historico_log
            varsql = "select fcm.run_apo,fcm.run_alu,cta_cte,chq_serie,chq_numero,descripcion,concat(ape1_apo,' ',ape2_apo,' ',noms_apo) as apoderado,run_titular,nom_titular" _
                   & " from fnza_cheques_recibidos fcr,fnza_chq_mvto fcm,fnza_cod_banco fcb,apoderados a" _
                   & " Where fcr.folio_chq = fcm.folio_chq And" _
                   & " fcr.banco = fcb.banco And fcr.folio_chq = " _
                   & grid.TextMatrix(grid.Row, 1) & " and fcr.run_apo = a.rut_apo"
            objRS.Open varsql, conn
            
            If Estado = "prto" Then
                conecta = ConectarBDSiempre(conn_deuda, "192.168.7.91", "comunes_gescol", "groot", "kripplefight", True)
                colegio = DevuelveCampo("establecimientos", "", "NOM_EST", "1=1", conn)
                var_sql = "insert into apoderados_cheques_protestados(ci_apo,apoderado,ci_tit,titular,colegio)" _
                        & " values('" & objRS("run_apo") & "','" & objRS("apoderado") & "','" & objRS("run_titular") & "','" & objRS("nom_titular") & "','" & colegio & "')"
                conn_deuda.Execute var_sql
                conn_deuda.Close
            End If
            
'            accion_detalle = "El nuevo estado del cheque Cuenta Corriente: " & objRS("cta_cte") _
'                           & " Serie: " & objRS("chq_serie") & " Numero: " & objRS("chq_numero") _
'                           & " del banco " & objRS("descripcion") & " es " & cb_estado.Text
            While Not objRS.EOF
                Call Inserta_Vitacora_Finanza(objRS("run_alu"), objRS("run_apo"), _
                "Cambio de Estado", accion_detalle, 0, 0)
                objRS.MoveNext
            Wend
            objRS.Close
            'Fin de log
            
            lbl_estado = cb_estado.Text
            grid.TextMatrix(grid.Row, 8) = cb_estado.Text
        Else
            cmd_salir_Click
        End If
    Else
        MsgBox "Debe seleccionar primero un estado", vbInformation
    End If
    cmd_salir_Click
End Sub

Private Sub cmd_limpiar_Click()
    limpiar
End Sub

Private Sub cmd_salir_Click()
    Frame2.Enabled = True
    Frame3.Enabled = True
    Frame6.Enabled = True
  '  Frame4.Enabled = True
    Frame5.Enabled = True
    frame_cheques.Visible = False
End Sub

Private Sub Command1_Click()
    Dim var_sql As String
    Dim objRS As ADODB.Recordset
    Set objRS = New ADODB.Recordset
    Dim Monto_boletas As Long
    Dim total_boletas As Long
    
    Dim ApExcel As Variant
    Set ApExcel = CreateObject("Excel.application")
    ' Hace que Excel se vea
    'ApExcel.Visible = True
    'Agrega un nuevo Libro
    ApExcel.Workbooks.Add
    'Poner Titulos
    'ApExcel.cells(1, 1).Formula = "INFORME DE BOLETAS EMITIDAS"
    
            
    var_sql = "DROP TABLE IF EXISTS temp_che;"
    conn.Execute var_sql
'    var_sql = "DROP TABLE IF EXISTS temp_caja_reporte;"
'    conn.Execute var_sql
        
'    var_sql = "SELECT ch.*,ec.factoring AS factoring FROM" _
'            & " (SELECT che.*,e.estado AS devuelto FROM" _
'            & " (SELECT nom_est,nom_titular,descripcion,cta_cte,CONCAT(chq_serie,'-',chq_numero) AS numero_cheque,chq_fecha,monto_chq,estado,cod_devuelto,cod_factoring" _
'            & " FROM fnza_cheques_recibidos c,fnza_cod_banco b,fnza_estados_cheques ec,establecimientos" _
'            & " WHERE c.banco = b.banco AND c.cod_estado = ec.cod_est AND chq_fecha >= '" & Format(dtp_ini.Value, "yyyy-mm-dd") & "' AND chq_fecha <= '" & Format(dtp_finn.Value, "yyyy-mm-dd") & "') AS che" _
'            & " LEFT JOIN fnza_codigos_cheque_devuelto e ON che.cod_devuelto = e.cod_est) AS ch" _
'            & " LEFT JOIN fnza_factoring ec ON ch.cod_factoring = ec.cod_fac"
            
    If opt_folios.Value = True Then
    var_sql = "SELECT cm.run_alu,alumno,che.* FROM" _
            & " (SELECT ch.*,ec.factoring AS factoring FROM (SELECT che.*,e.estado AS devuelto FROM (SELECT folio_chq,nom_est,run_apo,CONCAT(noms_apo,' ',ape1_apo,' ',ape2_apo) AS apoderado," _
            & " run_titular,nom_titular,descripcion,cta_cte,CONCAT(chq_serie,'-',chq_numero) AS numero_cheque," _
            & " chq_fecha,monto_chq,estado,cod_devuelto,cod_factoring FROM fnza_cheques_recibidos c,fnza_cod_banco b,fnza_estados_cheques ec,establecimientos,apoderados a" _
            & " WHERE c.run_apo = a.rut_apo AND c.banco = b.banco AND c.cod_estado = ec.cod_est AND chq_fecha >= '" & Format(dtp_ini.Value, "yyyy-mm-dd") & "' AND chq_fecha <= '" & Format(dtp_finn.Value, "yyyy-mm-dd") & "') AS che" _
            & " LEFT JOIN fnza_codigos_cheque_devuelto e ON che.cod_devuelto = e.cod_est) AS ch LEFT JOIN fnza_factoring ec ON ch.cod_factoring = ec.cod_fac) AS che" _
            & " LEFT JOIN (SELECT folio_chq,run_alu,CONCAT(ape_pat_alu,' ',ape_mat_alu,' ',nom_alu) AS alumno FROM fnza_chq_mvto m,postulantes p" _
            & " Where m.run_alu = p.ci_alu" _
            & " GROUP BY run_alu) cm" _
            & " ON che.folio_chq = cm.folio_chq"
    Else
    var_sql = "CREATE TABLE temp_che TYPE = MYISAM" _
            & " (SELECT folio_chq FROM" _
            & " (SELECT c.*,DATEDIFF(DATE_FORMAT('" & Format(dtp_ini.Value, "yyyy-mm-dd") & "','%Y-%m-%d'),DATE_FORMAT(chq_fecha,'%Y-%m-%d')) AS dias FROM fnza_cheques_recibidos c" _
            & " WHERE DATEDIFF(DATE_FORMAT('" & Format(dtp_ini.Value, "yyyy-mm-dd") & "','%Y-%m-%d'),DATE_FORMAT(chq_fecha,'%Y-%m-%d')) > 60" _
            & " Union" _
            & " SELECT c.*,DATEDIFF(DATE_FORMAT('" & Format(dtp_finn.Value, "yyyy-mm-dd") & "','%Y-%m-%d'),DATE_FORMAT(chq_fecha,'%Y-%m-%d')) AS dias FROM fnza_cheques_recibidos c" _
            & " WHERE DATEDIFF(DATE_FORMAT('" & Format(dtp_finn.Value, "yyyy-mm-dd") & "','%Y-%m-%d'),DATE_FORMAT(chq_fecha,'%Y-%m-%d')) > 60) AS t" _
            & " WHERE chq_fecha > DATE_ADD('" & Format(dtp_ini.Value, "yyyy-mm-dd") & "', INTERVAL -60 DAY))"
    conn.Execute var_sql
    
'    var_sql = "SELECT cm.run_alu,alumno,che.* FROM" _
'            & " (SELECT ch.*,ec.factoring AS factoring FROM (SELECT che.*,e.estado AS devuelto FROM (SELECT folio_chq,nom_est,run_apo,CONCAT(noms_apo,' ',ape1_apo,' ',ape2_apo) AS apoderado," _
'            & " run_titular,nom_titular,descripcion,cta_cte,CONCAT(chq_serie,'-',chq_numero) AS numero_cheque," _
'            & " chq_fecha,monto_chq,estado,cod_devuelto,cod_factoring FROM fnza_cheques_recibidos c,fnza_cod_banco b,fnza_estados_cheques ec,establecimientos,apoderados a" _
'            & " WHERE c.run_apo = a.rut_apo AND c.banco = b.banco AND c.cod_estado = ec.cod_est AND chq_fecha >= '" & Format(dtp_ini.Value, "yyyy-mm-dd") & "' AND chq_fecha <= '" & Format(dtp_finn.Value, "yyyy-mm-dd") & "'" _
'            & " AND DATEDIFF(DATE_FORMAT(NOW(),'%Y-%m-%d'),DATE_FORMAT(DATE_ADD(chq_fecha, INTERVAL 1 DAY),'%Y-%m-%d')) > 59" _
'            & " ) AS che LEFT JOIN fnza_codigos_cheque_devuelto e ON che.cod_devuelto = e.cod_est) AS ch LEFT JOIN fnza_factoring ec ON ch.cod_factoring = ec.cod_fac) AS che" _
'            & " LEFT JOIN (SELECT folio_chq,run_alu,CONCAT(ape_pat_alu,' ',ape_mat_alu,' ',nom_alu) AS alumno FROM fnza_chq_mvto m,postulantes p" _
'            & " Where m.run_alu = p.ci_alu" _
'            & " GROUP BY run_alu) cm" _
'            & " ON che.folio_chq = cm.folio_chq" _
'            & " WHERE che.folio_chq IN (SELECT folio_chq FROM temp_che)"
        var_sql = "SELECT cm.run_alu,alumno,che.* FROM" _
            & " (SELECT ch.*,ec.factoring AS factoring FROM (SELECT che.*,e.estado AS devuelto FROM (SELECT folio_chq,nom_est,run_apo,CONCAT(noms_apo,' ',ape1_apo,' ',ape2_apo) AS apoderado," _
            & " run_titular,nom_titular,descripcion,cta_cte,CONCAT(chq_serie,'-',chq_numero) AS numero_cheque," _
            & " chq_fecha,monto_chq,estado,cod_devuelto,cod_factoring FROM fnza_cheques_recibidos c,fnza_cod_banco b,fnza_estados_cheques ec,establecimientos,apoderados a" _
            & " WHERE c.run_apo = a.rut_apo AND c.banco = b.banco AND c.cod_estado = ec.cod_est) AS che" _
            & " LEFT JOIN fnza_codigos_cheque_devuelto e ON che.cod_devuelto = e.cod_est) AS ch LEFT JOIN fnza_factoring ec ON ch.cod_factoring = ec.cod_fac) AS che" _
            & " LEFT JOIN (SELECT folio_chq,run_alu,CONCAT(ape_pat_alu,' ',ape_mat_alu,' ',nom_alu) AS alumno FROM fnza_chq_mvto m,postulantes p" _
            & " Where m.run_alu = p.ci_alu" _
            & " GROUP BY run_alu) cm" _
            & " ON che.folio_chq = cm.folio_chq" _
            & " WHERE che.folio_chq IN (SELECT folio_chq FROM temp_che)"
                        
    End If
    objRS.Open var_sql, conn
    i = 1
        
    ApExcel.Cells(1, 1).Font.Size = 12
    ApExcel.Cells(1, 2).Font.Size = 12
    ApExcel.Cells(1, 3).Font.Size = 12
    ApExcel.Cells(1, 4).Font.Size = 12
    ApExcel.Cells(1, 5).Font.Size = 12
    ApExcel.Cells(1, 6).Font.Size = 12
    ApExcel.Cells(1, 7).Font.Size = 12
    ApExcel.Cells(1, 8).Font.Size = 12
    ApExcel.Cells(1, 9).Font.Size = 12
    ApExcel.Cells(1, 10).Font.Size = 12
    ApExcel.Cells(1, 11).Font.Size = 12
    ApExcel.Cells(1, 12).Font.Size = 12
    ApExcel.Cells(1, 13).Font.Size = 12
    ApExcel.Cells(1, 14).Font.Size = 12
    ApExcel.Cells(1, 15).Font.Size = 12
    
    ApExcel.Cells(1, 1).Font.Bold = True
    ApExcel.Cells(1, 2).Font.Bold = True
    ApExcel.Cells(1, 3).Font.Bold = True
    ApExcel.Cells(1, 4).Font.Bold = True
    ApExcel.Cells(1, 5).Font.Bold = True
    ApExcel.Cells(1, 6).Font.Bold = True
    ApExcel.Cells(1, 7).Font.Bold = True
    ApExcel.Cells(1, 8).Font.Bold = True
    ApExcel.Cells(1, 9).Font.Bold = True
    ApExcel.Cells(1, 10).Font.Bold = True
    ApExcel.Cells(1, 11).Font.Bold = True
    ApExcel.Cells(1, 12).Font.Bold = True
    ApExcel.Cells(1, 13).Font.Bold = True
    ApExcel.Cells(1, 14).Font.Bold = True
    ApExcel.Cells(1, 15).Font.Bold = True
    
    ApExcel.Cells(1, 1).Formula = "Colegio"
    ApExcel.Cells(1, 2).Formula = "Rut. Tit."
    ApExcel.Cells(1, 3).Formula = "Titular"
    ApExcel.Cells(1, 4).Formula = "Rut. Apo."
    ApExcel.Cells(1, 5).Formula = "Apoderado"
    ApExcel.Cells(1, 6).Formula = "Rut. Alu."
    ApExcel.Cells(1, 7).Formula = "Alumno"
    ApExcel.Cells(1, 8).Formula = "Banco"
    ApExcel.Cells(1, 9).Formula = "Cta. Cte."
    ApExcel.Cells(1, 10).Formula = "Nº Cheque"
    ApExcel.Cells(1, 11).Formula = "Fecha"
    ApExcel.Cells(1, 12).Formula = "Monto"
    ApExcel.Cells(1, 13).Formula = "Estado"
    ApExcel.Cells(1, 14).Formula = "Factoring"
    ApExcel.Cells(1, 15).Formula = "Devuelto"
        
    pgbar.Min = 0
    pgbar.Max = objRS.RecordCount + 1
    pgbar.Value = pgbar.Min
    total_boletas = 0
    Monto_boletas = 0
    While Not objRS.EOF
        
        i = i + 1
        ApExcel.Cells(i, 1).Formula = objRS("nom_est")
        ApExcel.Cells(i, 2).Formula = objRS("run_titular")
        ApExcel.Cells(i, 3).Formula = objRS("nom_titular")
        ApExcel.Cells(i, 4).Formula = objRS("run_apo")
        ApExcel.Cells(i, 5).Formula = objRS("apoderado")
        ApExcel.Cells(i, 6).Formula = objRS("run_alu")
        ApExcel.Cells(i, 7).Formula = objRS("alumno")
        ApExcel.Cells(i, 8).Formula = objRS("descripcion")
        ApExcel.Cells(i, 9).Formula = objRS("cta_cte")
        ApExcel.Cells(i, 10).Formula = objRS("numero_cheque")
        ApExcel.Cells(i, 11).Formula = Format(objRS("chq_fecha"), "yyyy/mm/dd")
        ApExcel.Cells(i, 12).Formula = objRS("monto_chq")
        ApExcel.Cells(i, 13).Formula = objRS("estado")
        ApExcel.Cells(i, 14).Formula = objRS("factoring")
        ApExcel.Cells(i, 15).Formula = objRS("devuelto")
       
       
        
'        If objRS("estado") = "nula" Then
'            ApExcel.Cells(i, 4).Formula = 0
'        Else
'            ApExcel.Cells(i, 4).Formula = objRS("monto")
            Monto_boletas = Monto_boletas + objRS("monto_chq")
'
'        End If
'
        ApExcel.Cells(i, 12).NumberFormat = "#,##0"
        
'        If objRS("tipo_documento") = "boleta" Then
'            total_boletas = total_boletas + 1
'        End If
        
       ' ApExcel.Cells(i, 5).Formula = objRS("estado")
        
        ' Aplica Formula
        'ApExcel.cells(3, 4).Formula = "=B3-C3"
        ' Hace una Seleccion de celdas y pone bordes de Color
        
        pgbar.Value = i - 1
        'pgBar.Refresh
        objRS.MoveNext
    Wend
    i = i + 1
    
  '  ApExcel.Cells(i, 1).Formula = "Tot. boletas"
'    ApExcel.Cells(i, 2).Formula = total_boletas
'    ApExcel.Cells(i, 2).HorizontalAlignment = xlHAlignLeft
'    ApExcel.Cells(i, 6).Formula = "Tot. monto"
'    ApExcel.Cells(i, 7).Formula = Monto_boletas
'    ApExcel.Cells(i, 7).NumberFormat = "#,##0"
'    ApExcel.Cells(i, 6).Font.Bold = True
'    ApExcel.Cells(i, 7).Font.Bold = True
'    ApExcel.Cells(i, 3).Font.Bold = True
'    ApExcel.Cells(i, 4).Font.Bold = True
    
        
    ApExcel.Visible = True
    ApExcel.Range("a1:j1").Borders.color = RGB(255, 0, 0)
    Set ApExcel = Nothing
    
    objRS.Close

'    CrystalReport1.ReportFileName = App.Path & "\rpt\libro_ventas.rpt"
'
'    CrystalReport1.WindowState = crptMaximized
'    'CrystalReport1.Formulas(1) = "a = '" & menor & "'"
'    'CrystalReport1.Formulas(2) = "fecha = '" & mayor & "'"
'    CrystalReport1.Formulas(3) = "menor_ntcr = '" & menor & "'"
'    CrystalReport1.Formulas(4) = "mayor_ntcr = '" & Mayor & "'"
'    CrystalReport1.Formulas(5) = "monto_ntcr = '" & Monto & "'"
'    CrystalReport1.Formulas(6) = "nobecado_ntcr = '" & nobecado & "'"
'    CrystalReport1.Formulas(7) = "becado_ntcr = '" & becado & "'"
'    CrystalReport1.Formulas(8) = "excencion = '" & excencion & "'"
'
'   'cr_perso.WindowTitle = "Informe De Desarrollo Personal y Social"
''    cr_pre.ReplaceSelectionFormula ("")
'    'CrystalReport1.Formulas(1) = "establo = '" & nombre & "'"
''    cr_perso.Formulas(1) = "fecha = '" & Format(Now, "dd/mm/yyyy") & "'"
''    cr_perso.Formulas(2) = "hora = '" & Format(Now, "hh:mm AM/PM") & "'"
'    'cr_perso.ReplaceSelectionFormula ("{pre_eval_cab.cod_ens}='" & xcod & "' and {pre_eval_cab.num_gra}='" & CInt(xnum_gra) & "' and {pre_eval_cab.let_cur}='" & xletra & "' and {pre_eval_cab.agno}=" & str(xagno)) & Per
'    CrystalReport1.Destination = crptToWindow
'    CrystalReport1.Action = 1
End Sub

Private Sub Command3_Click()
    Unload Me
End Sub


Private Sub Form_Load()
    Dim var_sql As String
    var_sql = "UPDATE fnza_cheques_recibidos SET cod_estado = 3" _
            & " WHERE cod_estado = 1 and DATEDIFF(DATE_FORMAT(NOW(),'%Y-%m-%d'),DATE_FORMAT(DATE_ADD(chq_fecha, INTERVAL 1 DAY),'%Y-%m-%d')) > 60"
    conn.Execute var_sql
    
    llenar_estado
' Setear el combo años.
    Dim agno, i As Integer
    agno = Year(Date)
    For i = 2005 To agno + 1
       ' cb_agno_alu.AddItem i
        cb_agno_apo.AddItem i
    Next i
    cb_agno_apo.Text = agno
    Me.Top = 0
    Me.Left = 0
    'IC_Letra.Text = ""
   ' IC_Letra.ComboItems.Clear
    'Call Set_IC_Agno
    ' Limpiar textos
    'txt_nom_alu.Text = ""
   ' txt_rut_alu.Text = ""
    txt_nom_apo.Text = ""
    txt_rut_apo.Text = ""
    'Mostrar opcion de curso al iniciar
    Option1(0).Value = True
    MuestraFrame ("curso")
    ErrorStatus = False
    cambia_estado_masivo
    
    dtp_ini = Date
    dtp_finn = Date
    dtp_inicio = Date
    dtp_fin = Date
End Sub

Private Sub cambia_estado_masivo()
    Dim sql As String
    Dim rs As ADODB.Recordset
    Set rs = New ADODB.Recordset
    
    sql = "select folio_chq from fnza_cheques_recibidos where estado_chq = 'cart' and chq_fecha < date_format(current_date,'%Y-%m-%d');"
    rs.Open sql, conn
    
    While Not rs.EOF
        '*********************************************************
        'actualizamos la base de datos cheques con el nuevo estado
        var_sql = "update fnza_cheques_recibidos set estado_chq = 'clda' where folio_chq = " & rs("folio_chq")
        conn.Execute var_sql
            
        '*********************************************************
        'dejamos en el log el cambio que se le realizo al cheque
        var_sql = " INSERT INTO fnza_chq_log (folio_chq, estado_anterior,estado_actual,fecha,usuario,ip,proceso)" & _
                  " VALUES (" & rs("folio_chq") & ",'cart','clda', concat(date_format(current_date,'%Y-%m-%d'),' ',current_time),'" & Nom_usu_ses & "','" & Form_main.Winsock1.LocalIP & "','cambio masivo');"
        conn.Execute var_sql
        rs.MoveNext
    Wend
        
End Sub

Private Sub grid_DblClick()
    frame_cheques.Visible = True
    lbl_cta_cte = grid.TextMatrix(grid.Row, 2)
    lbl_numero_cheque = grid.TextMatrix(grid.Row, 3)
    lbl_monto = grid.TextMatrix(grid.Row, 4)
    lbl_fecha = grid.TextMatrix(grid.Row, 5)
    lbl_estado.Caption = grid.TextMatrix(grid.Row, 8)
    cb_estado.Text = grid.TextMatrix(grid.Row, 8)
    Frame2.Enabled = False
    Frame3.Enabled = False
    Frame6.Enabled = False
    'Frame4.Enabled = False
    Frame5.Enabled = False
    cmd_CambiarEstado.Enabled = False
    lbl_datos.Visible = False
    cb_datos.Visible = False
End Sub

Private Sub IC_Agno_Change()
'    IC_Ensenanza.Enabled = True
'    Set_IC_Ensenanza
End Sub
Private Sub lst_nom_alu_Click()
    Dim RC As ADODB.Recordset
    Set RC = New ADODB.Recordset
    txt_nom_alu.Text = lst_nom_alu.Text
    lst_nom_alu.Visible = False
    lst_rut_alu.Visible = False
    RC.Open "SELECT ci_alu FROM postulantes WHERE left(CONCAT(ape_Pat_alu,' ',ape_Mat_alu,' ',nom_alu)," & Len(txt_nom_alu.Text) & ")='" & txt_nom_alu.Text & "' ORDER BY ape_pat_alu, ape_mat_alu, nom_alu;", conn
    RC.MoveFirst
    Flag_sub = True
    txt_rut_alu.Text = RC("ci_alu")
    RC.Close
    Flag_sub = False
    Btn_Ver_Alumno.Enabled = True
    If txt_nom_alu.Text <> "" And txt_rut_alu.Text <> "" Then
        txt_nom_alu.Locked = True
        txt_rut_alu.Locked = True
    End If
End Sub

Private Sub lst_rut_alu_Click()
    Dim RC As ADODB.Recordset
    Set RC = New ADODB.Recordset
    
    txt_rut_alu.Text = lst_rut_alu.Text
    lst_rut_alu.Visible = False
    lst_nom_alu.Visible = False
    RC.Open "SELECT CONCAT(ape_pat_alu,' ',ape_mat_alu,' ',nom_alu) as nombre_alu FROM postulantes WHERE ci_alu='" & txt_rut_alu.Text & "' ORDER BY ci_alu;", conn
    RC.MoveFirst
    Flag_sub = True
    txt_nom_alu.Text = RC("nombre_alu")
    RC.Close
    Flag_sub = False
    Btn_Ver_Alumno.Enabled = True
End Sub

Private Sub lst_nom_apo_Click()
    Dim RC As ADODB.Recordset
    txt_nom_apo.Text = lst_nom_apo.Text
    lst_nom_apo.Visible = False
    lst_rut_apo.Visible = False
    Set RC = New ADODB.Recordset
    RC.Open "SELECT run_titular FROM `fnza_cheques_recibidos` where nom_titular = '" & txt_nom_apo.Text & "' ORDER BY nom_titular;", conn
    RC.MoveFirst
    Flag_sub = True
    txt_rut_apo.Text = RC("run_titular")
    Flag_sub = False
    Btn_Ver_Apoderado.Enabled = True
    RC.Close
    If txt_nom_apo.Text <> "" And txt_rut_apo.Text <> "" Then
        txt_nom_apo.Locked = True
        txt_rut_apo.Locked = True
    End If
End Sub

Private Sub lst_rut_apo_Click()
    Dim RC As ADODB.Recordset
    txt_rut_apo.Text = lst_rut_apo.Text
    lst_rut_apo.Visible = False
    lst_nom_apo.Visible = False
    Set RC = New ADODB.Recordset
    RC.Open "SELECT nom_titular as nombre_apo FROM fnza_cheques_recibidos where run_titular='" & txt_rut_apo.Text & "' ORDER BY run_titular;", conn
    RC.MoveFirst
    Flag_sub = True
    txt_nom_apo.Text = RC("nombre_apo")
    Flag_sub = False
    Btn_Ver_Apoderado.Enabled = True
    RC.Close
    If txt_nom_apo.Text <> "" And txt_rut_apo.Text <> "" Then
        txt_nom_apo.Locked = True
        txt_rut_apo.Locked = True
    End If
End Sub

Private Sub Option1_Click(Index As Integer)
    limpiar
'    txt_nom_alu.Text = ""
'    txt_rut_alu.Text = ""
'    txt_nom_apo.Text = ""
'    txt_rut_apo.Text = ""
'    lst_nom_alu.Visible = False
'    lst_rut_alu.Visible = False
'    lst_nom_apo.Visible = False
'    lst_rut_apo.Visible = False
    If Option1(Index).Value = True Then
        If Index = 0 Then
            MuestraFrame "curso"
        ElseIf Index = 1 Then
            MuestraFrame "apoderado"
        ElseIf Index = 2 Then
            MuestraFrame "alumno"
        End If
    End If
End Sub


Private Sub Set_IC_Letra()
    Dim REC As ADODB.Recordset
    Dim QRY As String
    
    If Check_Letra.Value = 1 Then
        IC_Letra.ComboItems.Clear
        IC_Letra.Text = ""
        QRY = "SELECT DISTINCT m.let_cur FROM alu_x_cur as m WHERE m.cod_ens='" & Mid(IC_Ensenanza.SelectedItem.Key, 2) & "' AND m.agno=" & Trim(IC_Agno.SelectedItem.Text) & " AND m.num_gra='" & Trim(IC_Nivel.SelectedItem.Text) & "' ORDER BY m.num_gra;"
        Set REC = New ADODB.Recordset
        REC.Open QRY, conn
        If REC.RecordCount > 0 Then
            REC.MoveFirst
            For i = 1 To REC.RecordCount
                IC_Letra.ComboItems.Add i, , REC!Let_Cur
                REC.MoveNext
            Next i
            Set IC_Letra.SelectedItem = IC_Letra.ComboItems.Item(1)
            ErrorStatus = False
            ' Llenar Siguiente Combo.
        Else
            ErrorStatus = True
            Check_Letra.Value = 0
            IC_Letra.Enabled = False
        End If
        REC.Close
    Else
        ErrorStatus = False
        IC_Letra.Enabled = False
    End If
End Sub



Private Sub MuestraFrame(ByVal frm As String)
    ' Muestra seleccion por curso
    If frm = "curso" Then
        Frame1.Visible = True
        'SeteaVistaCurso
    Else
        Frame1.Visible = False
    End If
    ' Muestra seleccion por apoderado
    If frm = "apoderado" Then
        Frame5.Visible = True
        'SeteaVistaApoderado
       ' Btn_Ver_Alumno.Enabled = False
    Else
        Frame5.Visible = False
    End If
    ' Muestra seleccion por alumno
    If frm = "alumno" Then
        Frame4.Visible = True
        Btn_Ver_Apoderado.Enabled = False
        'SeteaVistaAlumno
    Else
       ' Frame4.Visible = False
    End If
End Sub

'Private Sub Set_IC_Agno()
'    Dim agno As Integer
'
'    agno = IIf(Year(Date) < 2005, 2005, Year(Date))
'    IC_Agno.ComboItems.Clear
'    For i = 1 To (agno - 2004) + 1
'        IC_Agno.ComboItems.Add i, , str(i + 2004)
'    Next i
'    Set IC_Agno.SelectedItem = IC_Agno.ComboItems.Item(i - 2)
'    ErrorStatus = False
'    ' Llenar combo enseñanza
'    IC_Ensenanza.Enabled = True
'    IC_Nivel.Enabled = False
'    IC_Letra.Enabled = False
'    Call Set_IC_Ensenanza
'End Sub
 
Private Sub txt_nom_alu_Change()
If fnp = True Then
    Dim var_sql As String
    Dim RC As ADODB.Recordset
    ' Si el cambio lo hace un Sub no hacer nada
    If Flag_sub Then Exit Sub
    If txt_nom_alu.Text = "" Then Exit Sub
    Set RC = New ADODB.Recordset
    
    var_sql = "select distinct ape_pat_alu,ape_mat_alu,nom_alu" _
        & " from fnza_cheques_recibidos fcr,apo_x_alu axa,postulantes p" _
        & " where fcr.run_apo = axa.rut_apo and date_format(chq_fecha,'%Y') = axa.agno and" _
        & " axa.ci_alu = p.ci_alu and" _
        & " concat(ape_pat_alu,' ',ape_mat_alu,' ',nom_alu) like '" _
        & txt_nom_alu.Text & "%'"
    RC.Open var_sql, conn
    lst_nom_alu.Clear
    If RC.RecordCount > 0 Then
        While Not (RC.EOF)
            lst_nom_alu.AddItem RC("ape_pat_alu") & " " & RC("ape_mat_alu") & " " & RC("nom_alu")
            RC.MoveNext
        Wend
        lst_nom_alu.Visible = True
        lst_rut_alu.Visible = False
    End If
    RC.Close
    Btn_Ver_Alumno.Enabled = False
End If
End Sub

Private Sub txt_nom_alu_Click()
    fra = False
    fna = False
    frp = False
    fnp = True
End Sub

Private Sub txt_nom_apo_Click()
    fra = False
    fna = True
    frp = False
    fnp = False
End Sub



Private Sub txt_rut_alu_Change()
If frp = True Then
    Dim RC As ADODB.Recordset
    ' Si el cambio lo hace un Sub no hacer nada
    If Flag_sub Then Exit Sub
    If txt_rut_alu.Text = "" Then Exit Sub
    Set RC = New ADODB.Recordset
    
    RC.Open "select distinct p.ci_alu" _
        & " from fnza_cheques_recibidos fcr,apo_x_alu axa,postulantes p" _
        & " where fcr.run_apo = axa.rut_apo and date_format(chq_fecha,'%Y') = axa.agno and" _
        & " axa.ci_alu = p.ci_alu and" _
        & " p.ci_alu like '" & txt_rut_alu.Text & "%'", conn
    lst_rut_alu.Clear
    If RC.RecordCount > 0 Then
        While Not (RC.EOF)
            lst_rut_alu.AddItem RC("ci_alu")
            RC.MoveNext
        Wend
        lst_nom_alu.Visible = False
        lst_rut_alu.Visible = True
    End If
    RC.Close
    Btn_Ver_Alumno.Enabled = False
End If
End Sub

Private Sub txt_nom_apo_Change()
If fna = True Then
    Dim var_sql As String
    Dim RC As ADODB.Recordset
    ' Si el cambio lo hace un Sub no hacer nada
    If Flag_sub Then Exit Sub
    If txt_nom_apo.Text = "" Then Exit Sub
    Set RC = New ADODB.Recordset
        
    var_sql = "SELECT DISTINCT nom_titular" _
            & " FROM apoderados a, fnza_cheques_recibidos fcr" _
            & " where a.rut_apo = fcr.run_apo and" _
            & " nom_titular" _
            & " like '" & txt_nom_apo.Text & "%'"
            
    RC.Open var_sql, conn
    lst_nom_apo.Clear
    While Not (RC.EOF)
        lst_nom_apo.AddItem RC("nom_titular")
        RC.MoveNext
    Wend
    RC.Close
    Btn_Ver_Apoderado.Enabled = False
    lst_nom_apo.Visible = True
    lst_rut_apo.Visible = False
End If
End Sub

Private Sub txt_rut_alu_Click()
    fra = False
    fna = False
    frp = True
    fnp = False
End Sub

Private Sub txt_rut_apo_Change()
' Si el cambio lo hace un Sub no hacer nada
If fra = True Then
    If Flag_sub Then Exit Sub
    If txt_rut_apo.Text = "" Then Exit Sub
    Dim Str_Query As String
    Dim RC As ADODB.Recordset
    
    Set RC = New ADODB.Recordset
    Str_Query = "select distinct run_titular from fnza_cheques_recibidos" _
              & " where run_titular like '" & txt_rut_apo.Text & "%'"
    RC.Open Str_Query, conn
    lst_rut_apo.Clear
    While Not (RC.EOF)
        lst_rut_apo.AddItem RC("run_titular")
        RC.MoveNext
    Wend
    RC.Close
    Btn_Ver_Apoderado.Enabled = False
    lst_rut_apo.Visible = True
    lst_nom_apo.Visible = False
End If
End Sub

Public Sub llena_grilla_con_cheques()
    Dim objRS As ADODB.Recordset
    Set objRS = New ADODB.Recordset
    Dim var_sql, condicion, Cod_Ens As String
        
    If Option1(0).Value = True Then
'        condicion = " and fcr.run_apo = '" & txt_rut_apo.Text & "'" _
'                  & " and date_format(chq_fecha,'%Y') = " & cb_agno_apo.Text
        condicion = " and chq_fecha >= '" & Format(dtp_inicio.Value, "yyyy-mm-dd") & "' and chq_fecha <= '" & Format(dtp_fin.Value, "yyyy-mm-dd") & "'"
    End If
    
    If Option1(1).Value Then
        condicion = " and fcr.run_titular = '" & txt_rut_apo.Text & "'" _
                  & " and date_format(chq_fecha,'%Y') = " & cb_agno_apo.Text
       ' condicion = " and chq_fecha >= '" & Format(dtp_inicio.Value, "yyyy-mm-dd") & "' and chq_fecha <= '" & Format(dtp_fin.Value, "yyyy-mm-dd") & "'"
    End If
    
'    var_sql = "SELECT folio_chq,cta_cte as 'Cta. Cte.'," _
'            & "concat(chq_serie,' ',chq_numero) as 'Numero Cheque'," _
'            & "monto_chq as 'Monto',chq_fecha as 'Fecha'," _
'            & "run_titular as 'Rut.Tit.',nom_titular as 'Titular'," _
'            & "estado as 'Estado'" _
'            & " FROM fnza_cheques_recibidos fcr,fnza_estados_cheques fcec" _
'            & " Where fcr.cod_estado = fcec.cod_est" & condicion
            
    var_sql = "SELECT folio_chq,cta_cte AS 'Cta. Cte.',numero_cheque AS 'Numero Cheque',monto_chq AS 'Monto',chq_fecha AS 'Fecha',run_titular AS 'Rut.Tit.'," _
            & "nom_titular AS 'Titular',che.estado AS 'Estado',if(factoring is null,'',factoring) AS Factoring,if(d.estado is null,'',d.estado) AS Devuelto FROM" _
            & " (SELECT c.*,factoring FROM" _
            & " (SELECT folio_chq,cta_cte,CONCAT(chq_serie,' ',chq_numero) AS Numero_Cheque,monto_chq,chq_fecha,run_titular," _
            & "nom_titular,estado,cod_factoring,cod_devuelto FROM fnza_cheques_recibidos fcr,fnza_estados_cheques fcec" _
            & " WHERE fcr.cod_estado = fcec.cod_est " & condicion & ") AS c" _
            & " Left Join fnza_factoring f" _
            & " ON c.cod_factoring = f.cod_fac) AS che LEFT JOIN fnza_codigos_cheque_devuelto d ON che.cod_devuelto = d.cod_est"
            
            
    objRS.Open var_sql, conn
    If Not objRS.EOF Then
        progreso.Min = 0
        progreso.Max = objRS.RecordCount
        Call Rec2Grid(objRS, grid, True)
        grid.ColWidth(1) = 0
        grid.ColSel = 8
    Else
        MsgBox "La busqueda no devolvio resultados", vbInformation
    End If
    objRS.Close
End Sub

Public Sub limpiar()
    Option1(0).Enabled = True
    Option1(1).Enabled = True
    'Option1(2).Enabled = True
    
    lbl_datos.Visible = False
    cb_datos.Visible = False
    'lst_nom_alu.Visible = False
   ' lst_rut_alu.Visible = False
    lst_nom_apo.Visible = False
    lst_rut_apo.Visible = False
    
  '  txt_nom_alu.Text = ""
  '  txt_rut_alu.Text = ""
    txt_rut_apo.Text = ""
    txt_nom_apo.Text = ""
    grid.Rows = 2
    grid.ClearStructure
    
    Frame1.Enabled = True
   ' Btn_Ver_Alumno.Enabled = True
   ' cb_agno_alu.Locked = False
 '   txt_nom_alu.Locked = False
  '  txt_rut_alu.Locked = False
    Btn_Ver_Apoderado.Enabled = True
    cb_agno_apo.Locked = False
    txt_nom_apo.Locked = False
    txt_rut_apo.Locked = False
End Sub

Private Sub txt_rut_apo_Click()
    fra = True
    fna = False
    frp = False
    fnp = False
End Sub

Private Sub llenar_estado()
    Dim var_sql As String
    Dim objRS As ADODB.Recordset
    Set objRS = New ADODB.Recordset
    var_sql = "SELECT * FROM fnza_estados_cheques"
    objRS.Open var_sql, conn
    While Not objRS.EOF
        cb_estado.Tag = objRS("cod_est")
        cb_estado.AddItem objRS("estado")
        objRS.MoveNext
    Wend
    objRS.Close
'    cb_estado.AddItem "Cancelado"
'    cb_estado.AddItem "Protestado"
'    cb_estado.AddItem "En Garantia"
'    cb_estado.AddItem "Cobranza Judicial"
'    cb_estado.AddItem "En descuento"
'    cb_estado.AddItem "Aclarado"
'    cb_estado.AddItem "Rescatado"
'    cb_estado.AddItem "Endosado"
End Sub

Private Sub bloquear_opciones()
    cb_agno_apo.Locked = True
    txt_rut_apo.Locked = True
    txt_nom_apo.Locked = True
    Btn_Ver_Apoderado.Enabled = False
    'cb_agno_alu.Locked = True
   ' txt_nom_alu.Locked = True
   ' txt_rut_alu.Locked = True
   ' Btn_Ver_Alumno.Enabled = False
    Option1(0).Enabled = False
    Option1(1).Enabled = False
   'Option1(2).Enabled = False
End Sub



