VERSION 5.00
Object = "{5E9E78A0-531B-11CF-91F6-C2863C385E30}#1.0#0"; "MSFLXGRD.OCX"
Begin VB.Form Form_MantencionFnza 
   BorderStyle     =   1  'Fixed Single
   ClientHeight    =   7230
   ClientLeft      =   45
   ClientTop       =   330
   ClientWidth     =   9015
   Icon            =   "Form_MantencionFnza.frx":0000
   KeyPreview      =   -1  'True
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MDIChild        =   -1  'True
   MinButton       =   0   'False
   ScaleHeight     =   7230
   ScaleWidth      =   9015
   Begin VB.Frame Frame_CEscol 
      Caption         =   "Control de Descuentos"
      BeginProperty Font 
         Name            =   "Arial"
         Size            =   8.25
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H00C00000&
      Height          =   6975
      Left            =   120
      TabIndex        =   20
      Top             =   120
      Width           =   8775
      Begin VB.ComboBox Cmb_Nivel_CEscol 
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   330
         Left            =   6120
         Style           =   2  'Dropdown List
         TabIndex        =   45
         Top             =   1080
         Width           =   855
      End
      Begin VB.TextBox Txt_Colegio_CEscol 
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   285
         Left            =   1680
         TabIndex        =   40
         Top             =   360
         Width           =   5295
      End
      Begin VB.ComboBox Cmb_Tipens_Cescol 
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   330
         Left            =   1680
         Style           =   2  'Dropdown List
         TabIndex        =   39
         Top             =   1080
         Width           =   3375
      End
      Begin VB.ComboBox Cmb_Anho_CEscol 
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   330
         Left            =   1680
         Style           =   2  'Dropdown List
         TabIndex        =   38
         Top             =   720
         Width           =   1215
      End
      Begin VB.CommandButton Btn_LimCescol 
         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            =   2880
         TabIndex        =   34
         Top             =   2880
         Width           =   1215
      End
      Begin VB.CommandButton Btn_AceCescol 
         Caption         =   "Aceptar"
         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            =   1320
         TabIndex        =   33
         Top             =   2880
         Width           =   1215
      End
      Begin VB.CommandButton Btn_EliCescol 
         Caption         =   "Eliminar"
         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            =   4440
         TabIndex        =   32
         Top             =   2880
         Width           =   1215
      End
      Begin VB.CommandButton Btn_CanCescol 
         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            =   6000
         TabIndex        =   31
         Top             =   2880
         Width           =   1215
      End
      Begin VB.Frame Frame_GrdEscol 
         ForeColor       =   &H00FF0000&
         Height          =   3615
         Left            =   120
         TabIndex        =   26
         Top             =   3240
         Width           =   8535
         Begin MSFlexGridLib.MSFlexGrid Grd_CEscol 
            Height          =   3255
            Left            =   120
            TabIndex        =   27
            TabStop         =   0   'False
            Top             =   240
            Width           =   8295
            _ExtentX        =   14631
            _ExtentY        =   5741
            _Version        =   393216
            GridLines       =   2
            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.Frame Frame_Descuentos 
         Caption         =   "Arancel Base y Porcentajes de Descuento"
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H00C00000&
         Height          =   1215
         Left            =   120
         TabIndex        =   21
         Top             =   1560
         Width           =   8535
         Begin VB.TextBox Txt_ArancelBase 
            Alignment       =   1  'Right Justify
            BeginProperty Font 
               Name            =   "Arial"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   285
            Left            =   2160
            TabIndex        =   36
            Top             =   360
            Width           =   1335
         End
         Begin VB.TextBox Txt_PorHer 
            BeginProperty Font 
               Name            =   "Arial"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   285
            Index           =   1
            Left            =   6600
            MaxLength       =   3
            TabIndex        =   35
            Top             =   720
            Width           =   495
         End
         Begin VB.TextBox Txt_PorHer 
            Alignment       =   1  'Right Justify
            BeginProperty Font 
               Name            =   "Arial"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   285
            Index           =   0
            Left            =   5760
            MaxLength       =   3
            TabIndex        =   29
            Top             =   720
            Width           =   615
         End
         Begin VB.TextBox Txt_PorConv 
            BeginProperty Font 
               Name            =   "Arial"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   285
            Index           =   1
            Left            =   3000
            MaxLength       =   2
            TabIndex        =   24
            Top             =   720
            Width           =   495
         End
         Begin VB.TextBox Txt_PorConv 
            Alignment       =   1  'Right Justify
            BeginProperty Font 
               Name            =   "Arial"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   285
            Index           =   0
            Left            =   2160
            MaxLength       =   3
            TabIndex        =   23
            Top             =   720
            Width           =   615
         End
         Begin VB.Label Label13 
            Caption         =   "Monto Arancel Base"
            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        =   37
            Top             =   360
            Width           =   1695
         End
         Begin VB.Label Label12 
            Alignment       =   2  'Center
            Caption         =   ","
            BeginProperty Font 
               Name            =   "Arial"
               Size            =   14.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   375
            Left            =   6360
            TabIndex        =   30
            Top             =   600
            Width           =   255
         End
         Begin VB.Label Label10 
            Caption         =   "Descuento por Hermanos"
            BeginProperty Font 
               Name            =   "Arial"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   255
            Left            =   3720
            TabIndex        =   28
            Top             =   720
            Width           =   2175
         End
         Begin VB.Label Label11 
            Alignment       =   2  'Center
            Caption         =   ","
            BeginProperty Font 
               Name            =   "Arial"
               Size            =   14.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   375
            Left            =   2760
            TabIndex        =   25
            Top             =   600
            Width           =   255
         End
         Begin VB.Label Label9 
            Caption         =   "Convenio por Institución"
            BeginProperty Font 
               Name            =   "Arial"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   255
            Left            =   240
            TabIndex        =   22
            Top             =   720
            Width           =   1815
         End
      End
      Begin VB.Label Label15 
         Caption         =   "Año Escolar"
         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        =   44
         Top             =   720
         Width           =   975
      End
      Begin VB.Label Label16 
         Caption         =   "Establecimiento"
         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             =   360
         Width           =   1335
      End
      Begin VB.Label Label8 
         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        =   42
         Top             =   1080
         Width           =   1695
      End
      Begin VB.Label Label7 
         Caption         =   "Nivel"
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   255
         Left            =   5280
         TabIndex        =   41
         Top             =   1080
         Width           =   735
      End
   End
   Begin VB.Frame Frame_CartasCob 
      BorderStyle     =   0  'None
      Caption         =   "Frame1"
      Height          =   7215
      Left            =   0
      TabIndex        =   0
      Top             =   0
      Width           =   8175
      Begin VB.Frame Frame_Cartas 
         Caption         =   "Mantención Cartas de Cobranza"
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H00C00000&
         Height          =   4335
         Left            =   120
         TabIndex        =   1
         Top             =   120
         Width           =   8055
         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            =   6600
            TabIndex        =   11
            Top             =   1920
            Width           =   1215
         End
         Begin VB.CommandButton Btn_Elim_Cob 
            Caption         =   "Eliminar"
            BeginProperty Font 
               Name            =   "Arial"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   375
            Left            =   6600
            TabIndex        =   10
            Top             =   1440
            Width           =   1215
         End
         Begin VB.CommandButton Btn_Ace_Cob 
            Caption         =   "Aceptar"
            BeginProperty Font 
               Name            =   "Arial"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   375
            Left            =   6600
            TabIndex        =   9
            Top             =   480
            Width           =   1215
         End
         Begin VB.TextBox txt_cuerpo_carta 
            BeginProperty Font 
               Name            =   "Arial"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   1455
            Left            =   1320
            MaxLength       =   250
            MultiLine       =   -1  'True
            ScrollBars      =   2  'Vertical
            TabIndex        =   8
            Top             =   1560
            Width           =   5055
         End
         Begin VB.TextBox txt_cod_carta 
            BeginProperty Font 
               Name            =   "Arial"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   285
            Left            =   1320
            MaxLength       =   3
            TabIndex        =   7
            Top             =   840
            Width           =   1215
         End
         Begin VB.TextBox txt_tit_carta 
            Height          =   285
            Left            =   1320
            MaxLength       =   35
            TabIndex        =   6
            Top             =   1200
            Width           =   5055
         End
         Begin VB.TextBox txt_pie_carta 
            BeginProperty Font 
               Name            =   "Arial"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   285
            Left            =   1320
            MaxLength       =   70
            TabIndex        =   5
            Top             =   3240
            Width           =   5055
         End
         Begin VB.TextBox txt_descrip_carta 
            BeginProperty Font 
               Name            =   "Arial"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   285
            Left            =   1320
            MaxLength       =   35
            TabIndex        =   4
            Top             =   480
            Width           =   5055
         End
         Begin VB.ComboBox Cmb_Cuotas_Mora 
            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_MantencionFnza.frx":2A8B2
            Left            =   1320
            List            =   "Form_MantencionFnza.frx":2A8D7
            Style           =   2  'Dropdown List
            TabIndex        =   3
            Top             =   3840
            Width           =   855
         End
         Begin VB.CommandButton Btn_Limpiar_Cob 
            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            =   6600
            TabIndex        =   2
            Top             =   960
            Width           =   1215
         End
         Begin VB.Label Label5 
            Caption         =   "Código"
            BeginProperty Font 
               Name            =   "Arial"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   255
            Left            =   240
            TabIndex        =   17
            Top             =   840
            Width           =   1095
         End
         Begin VB.Label Label4 
            Caption         =   "Título"
            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        =   16
            Top             =   1200
            Width           =   1095
         End
         Begin VB.Label Label3 
            Caption         =   "Cuerpo"
            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        =   15
            Top             =   1560
            Width           =   1095
         End
         Begin VB.Label Label2 
            Caption         =   "Pie de Página"
            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        =   14
            Top             =   3240
            Width           =   1095
         End
         Begin VB.Label Label1 
            Caption         =   "Descripción"
            BeginProperty Font 
               Name            =   "Arial"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   255
            Left            =   240
            TabIndex        =   13
            Top             =   480
            Width           =   1095
         End
         Begin VB.Label Label6 
            Caption         =   "Nº Cuotas en Mora"
            BeginProperty Font 
               Name            =   "Arial"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   255
            Left            =   240
            TabIndex        =   12
            Top             =   3600
            Width           =   1455
         End
      End
      Begin VB.Frame Frame_Grilla_Cartas 
         Caption         =   "Listado de Cartas"
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H00C00000&
         Height          =   2535
         Left            =   120
         TabIndex        =   18
         Top             =   4560
         Width           =   8055
         Begin MSFlexGridLib.MSFlexGrid Grd_Cartas_Cob 
            Height          =   2175
            Left            =   120
            TabIndex        =   19
            TabStop         =   0   'False
            Top             =   240
            Width           =   7815
            _ExtentX        =   13785
            _ExtentY        =   3836
            _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
   End
End
Attribute VB_Name = "Form_MantencionFnza"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim ACodens() As String
Dim Edita As Boolean
Sub InigrillaCartas()
Me.Grd_Cartas_Cob.Clear
Me.Grd_Cartas_Cob.Cols = 6
Me.Grd_Cartas_Cob.Rows = 1
Me.Grd_Cartas_Cob.FixedCols = 0
'Me.Grd_Cartas_Cob.FormatString = " Descripción |Código |Título |Cuerpo|Pie|Cuotas en Mora"
Call LlenaGrilla(Me.Grd_Cartas_Cob, "Descripción, Código, Título, Cuerpo, Pie, Cuotas en mora", "comunicados", "descripcion; codigo; titulo; cuerpo; pie; cuotas_mora", "codigo <> '' order by cuotas_mora", conn)
Me.Grd_Cartas_Cob.ColWidth(0) = 2300
Me.Grd_Cartas_Cob.ColWidth(1) = 800
Me.Grd_Cartas_Cob.ColWidth(2) = 3100
Me.Grd_Cartas_Cob.ColWidth(3) = 0
Me.Grd_Cartas_Cob.ColWidth(4) = 0
Me.Grd_Cartas_Cob.ColWidth(5) = 1200
End Sub
Sub InigrillaCescol()
Me.Grd_CEscol.Clear
Me.Grd_CEscol.Cols = 9
Me.Grd_CEscol.Rows = 3
Me.Grd_CEscol.FixedCols = 0
Me.Grd_CEscol.FixedRows = 2
Me.Grd_CEscol.MergeCells = flexMergeRestrictRows
Me.Grd_CEscol.MergeRow(0) = True
Me.Grd_CEscol.MergeRow(1) = True

Me.Grd_CEscol.FormatString = " |^ | |^ |^ % Descuentos |^ % Descuentos |^ | |"
Me.Grd_CEscol.TextMatrix(1, 0) = "Colegio"
Me.Grd_CEscol.TextMatrix(1, 1) = "Año"
Me.Grd_CEscol.TextMatrix(1, 2) = "Tipo Enseñanza"
Me.Grd_CEscol.TextMatrix(1, 3) = "Nivel"
Me.Grd_CEscol.TextMatrix(1, 4) = "Convenio"
Me.Grd_CEscol.TextMatrix(1, 5) = "Hmnos."
Me.Grd_CEscol.TextMatrix(1, 6) = "Arancel"
Me.Grd_CEscol.TextMatrix(1, 7) = "CodColegio"
Me.Grd_CEscol.TextMatrix(1, 8) = "CodCurso"

Me.Grd_CEscol.ColWidth(0) = 2200
Me.Grd_CEscol.ColWidth(1) = 500
Me.Grd_CEscol.ColWidth(2) = 2500
Me.Grd_CEscol.ColWidth(3) = 450
Me.Grd_CEscol.ColWidth(4) = 800
Me.Grd_CEscol.ColWidth(5) = 800
Me.Grd_CEscol.ColWidth(6) = 700
Me.Grd_CEscol.ColWidth(7) = 0
Me.Grd_CEscol.ColWidth(8) = 0

Set rs = New ADODB.Recordset
rs.CursorLocation = adUseClient
a = "SELECT col.colegio, col.nombre from hist_cod_colegio as col, WHERE "
rs.Open "select h.nombre, h.colegio, f.agno, c.des_ens, f.curso, f.convenio1, f.hermanos, f.arancel_base from fnza_descuento f, hist_cod_colegio h, codigos_ensenanza c, (SELECT hcc.colegio FROM establecimientos as e, hist_cod_colegio as hcc where e.rdb=hcc.cod_rbd) as aux where f.colegio=h.colegio and mid(curso,1,3)=c.cod_ens and Left(h.colegio, 6) = Left(aux.colegio, 6) order by c.ord_ens, f.curso", conn
'rsaux.Open "select convenio1, hermanos, arancel_base from fnza_descuento where mid(curso,1,3)='" & Tipens & "' and mid(curso,4,2) ='" & Numg & "' and agno =" & Anho, conn
If rs.RecordCount > 0 Then
    For u = 2 To rs.RecordCount + 1
        Me.Grd_CEscol.AddItem ""
        Me.Grd_CEscol.TextMatrix(u, 0) = rs!nombre
        Me.Grd_CEscol.TextMatrix(u, 1) = rs!agno
        Me.Grd_CEscol.TextMatrix(u, 2) = rs!des_ens
        Me.Grd_CEscol.TextMatrix(u, 3) = Mid(rs!curso, 4, 2)
        Me.Grd_CEscol.TextMatrix(u, 4) = rs!Convenio1
        Me.Grd_CEscol.TextMatrix(u, 5) = rs!hermanos
        Me.Grd_CEscol.TextMatrix(u, 6) = rs!arancel_base
        Me.Grd_CEscol.TextMatrix(u, 7) = rs!colegio
        Me.Grd_CEscol.TextMatrix(u, 8) = rs!curso
        rs.MoveNext
    Next u
End If
rs.Close
Set rs = Nothing
End Sub
Sub OcultaFrames()
Me.Frame_CartasCob.Visible = False
Me.Frame_CEscol.Visible = Falsse
End Sub

Private Sub Btn_Ace_Cob_Click()
If Len(Trim(Me.txt_cod_carta)) > 0 And Len(Trim(Me.txt_descrip_carta)) > 0 And Len(Trim(Me.txt_tit_carta)) > 0 And Len(Trim(Me.txt_cuerpo_carta)) > 0 And Len(Trim(Me.txt_pie_carta)) > 0 And Len(Trim(Me.Cmb_Cuotas_Mora)) > 0 Then
    Dim Codigo As String
    Codigo = Trim(Me.txt_cod_carta)
    If Edita Then
        conn.Execute "update comunicados set descripcion='" & Me.txt_descrip_carta & "', titulo ='" & Me.txt_tit_carta & "', cuerpo ='" & Me.txt_cuerpo_carta & "', pie ='" & Me.txt_pie_carta & "', cuotas_mora =" & CInt(Me.Cmb_Cuotas_Mora) & " where codigo ='" & Codigo & "'"
    Else
        conn.Execute "INSERT INTO Comunicados(codigo, descripcion, titulo, cuerpo, pie, cuotas_mora) values('" & Codigo & "','" & Me.txt_descrip_carta & "','" & Me.txt_tit_carta & "','" & Me.txt_cuerpo_carta & "','" & Me.txt_pie_carta & "'," & CInt(Me.Cmb_Cuotas_Mora) & ")"
    End If
    Call Btn_Limpiar_Cob_Click
    Call InigrillaCartas
Else
    MsgBox ("Faltan campos por completar")
End If
End Sub

Private Sub Btn_Can_Cob_Click()
Unload Me
End Sub

Private Sub Btn_CanCescol_Click()
Unload Me
End Sub

Private Sub Btn_Elim_Cob_Click()
If MsgBox("El formato de carta de cobranza " & Me.txt_cod_carta & " será eliminado. ¿Desea continuar?", vbYesNo + vbQuestion) = vbYes Then
        conn.Execute "DELETE FROM comunicados WHERE codigo ='" & Trim(Me.txt_cod_carta) & "'"
        Call Btn_Limpiar_Cob_Click
        Call InigrillaCartas
End If
End Sub

Private Sub Btn_Limpiar_Cob_Click()
Me.txt_descrip_carta = ""
Me.txt_cod_carta = ""
Me.txt_tit_carta = ""
Me.txt_cuerpo_carta = ""
Me.txt_pie_carta = ""
Me.Cmb_Cuotas_Mora.ListIndex = -1
Me.txt_cod_carta.Enabled = True
Me.txt_descrip_carta.SetFocus
Edita = False
End Sub

Private Sub Command1_Click()

End Sub

Private Sub Cmb_Tipens_Cescol_Click()
Dim ngramax As String
ngramax = devuelvecampo("codigos_ensenanza", "", "num_gra_max", "cod_ens ='" & ACodens(Me.Cmb_Tipens_Cescol.ListIndex) & "'", conn)
If ngramax <> "" Then
    For t = 1 To Val(ngramax)
        Me.Cmb_Nivel_CEscol.AddItem t
    Next t
End If
End Sub

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

Private Sub Form_Load()
If MenuMantencionFnza = "FCartas" Then
    'Set rs = New ADODB.Recordset
    Me.Height = 7350
    Me.Width = "8235"
    Call OcultaFrames
    Call InigrillaCartas
    Me.Frame_CartasCob.Top = 0
    Me.Frame_CartasCob.Left = 0
    Edita = False
    Me.Frame_CartasCob.Visible = True: Me.Show

ElseIf MenuMantencionFnza = "Bancos" Then

ElseIf MenuMantencionFnza = "Cescol" Then
    Me.Height = 7500
    Me.Width = 9000
    Call OcultaFrames
    Call InigrillaCescol
    Me.Frame_CEscol.Top = 0
    Me.Frame_CEscol.Left = 0
    'Edita = False
    Me.Frame_CEscol.Visible = True: Me.Show
    For t = 2005 To 2007
        Me.Cmb_Anho_CEscol.AddItem t
    Next t
    Call llenacomboconarreglo(Cmb_Tipens_Cescol, "codigos_ensenanza", "des_ens", "cod_ens", ACodens, conn)
End If
End Sub

Private Sub Grd_Cartas_Cob_DblClick()
fila = Me.Grd_Cartas_Cob.Row
If fila >= 1 Then
    Me.txt_descrip_carta = Me.Grd_Cartas_Cob.TextMatrix(fila, 0)
    Me.txt_cod_carta = Me.Grd_Cartas_Cob.TextMatrix(fila, 1)
    Me.txt_tit_carta = Me.Grd_Cartas_Cob.TextMatrix(fila, 2)
    Me.txt_cuerpo_carta = Me.Grd_Cartas_Cob.TextMatrix(fila, 3)
    Me.txt_pie_carta = Me.Grd_Cartas_Cob.TextMatrix(fila, 4)
    Me.Cmb_Cuotas_Mora = Me.Grd_Cartas_Cob.TextMatrix(fila, 5)
    Edita = True
    Me.txt_cod_carta.Enabled = False
End If
End Sub

Private Sub Grd_CEscol_DblClick()
fila = Me.Grd_CEscol.Row
If fila >= 2 Then
    Me.Txt_Colegio_CEscol = Me.Grd_CEscol.TextMatrix(fila, 0)
    Me.Cmb_Anho_CEscol = Me.Grd_CEscol.TextMatrix(fila, 1)
    Me.Cmb_Tipens_Cescol = Me.Grd_CEscol.TextMatrix(fila, 2)
    indens = ValorenCombo(Cmb_Nivel_CEscol, Me.Grd_CEscol.TextMatrix(fila, 3))
    Me.Cmb_Nivel_CEscol.ListIndex = indens
    
    Me.Txt_PorConv(0) = Int(Val(Me.Grd_CEscol.TextMatrix(fila, 4)))
    Me.Txt_PorConv(1) = Int(Val(Me.Grd_CEscol.TextMatrix(fila, 4)) - Int(Val(Me.Grd_CEscol.TextMatrix(fila, 4))))
    Me.Txt_PorHer(0) = Int(Val(Me.Grd_CEscol.TextMatrix(fila, 5)))
    Me.Txt_PorHer(1) = Int(Val(Me.Grd_CEscol.TextMatrix(fila, 5)) - Int(Val(Me.Grd_CEscol.TextMatrix(fila, 5))))
    Me.Txt_ArancelBase = Me.Grd_CEscol.TextMatrix(fila, 6)
    Edita = True
    Me.Txt_Colegio_CEscol.Enabled = False
    Me.Cmb_Anho_CEscol.Enabled = False
    Me.Cmb_Tipens_Cescol.Enabled = False
    Me.Cmb_Nivel_CEscol.Enabled = False
End If
End Sub

