VERSION 5.00
Object = "{BDC217C8-ED16-11CD-956C-0000C04E4C0A}#1.1#0"; "TABCTL32.OCX"
Object = "{5E9E78A0-531B-11CF-91F6-C2863C385E30}#1.0#0"; "MSFLXGRD.OCX"
Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.2#0"; "MSCOMCTL.OCX"
Begin VB.Form Form_cartacob_def 
   BorderStyle     =   1  'Fixed Single
   Caption         =   "Definición de Cartas de Cobranza"
   ClientHeight    =   7245
   ClientLeft      =   45
   ClientTop       =   330
   ClientWidth     =   9450
   Icon            =   "Form_cartacob_def.frx":0000
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MDIChild        =   -1  'True
   MinButton       =   0   'False
   ScaleHeight     =   7245
   ScaleWidth      =   9450
   Begin VB.TextBox text_carta 
      BeginProperty Font 
         Name            =   "Courier"
         Size            =   9.75
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   1845
      Left            =   9840
      MaxLength       =   65535
      MultiLine       =   -1  'True
      TabIndex        =   59
      TabStop         =   0   'False
      Top             =   3000
      Visible         =   0   'False
      Width           =   8895
   End
   Begin VB.Frame FrameFilro 
      Caption         =   "Administrador de Cartas Impresas"
      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        =   68
      Top             =   120
      Visible         =   0   'False
      Width           =   9135
      Begin VB.CommandButton Command3 
         Caption         =   "&Imprimir Curso"
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   735
         Index           =   1
         Left            =   6960
         Picture         =   "Form_cartacob_def.frx":2A8B2
         Style           =   1  'Graphical
         TabIndex        =   77
         Top             =   1560
         Width           =   1935
      End
      Begin MSComctlLib.ImageCombo imcagno 
         Height          =   345
         Left            =   4680
         TabIndex        =   74
         Top             =   1560
         Width           =   1815
         _ExtentX        =   3201
         _ExtentY        =   609
         _Version        =   393216
         ForeColor       =   -2147483640
         BackColor       =   -2147483643
         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
         Locked          =   -1  'True
      End
      Begin MSComctlLib.ImageCombo imcmes 
         Height          =   345
         Left            =   4680
         TabIndex        =   73
         Top             =   840
         Width           =   1815
         _ExtentX        =   3201
         _ExtentY        =   609
         _Version        =   393216
         ForeColor       =   -2147483640
         BackColor       =   -2147483643
         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
         Locked          =   -1  'True
      End
      Begin MSFlexGridLib.MSFlexGrid mgcur 
         Height          =   2055
         Left            =   120
         TabIndex        =   72
         Top             =   360
         Width           =   4335
         _ExtentX        =   7646
         _ExtentY        =   3625
         _Version        =   393216
         Cols            =   5
         FixedCols       =   0
         BackColorSel    =   12648447
         ForeColorSel    =   -2147483630
         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
      End
      Begin VB.CommandButton Command3 
         Caption         =   "&Vistra Previa"
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   735
         Index           =   0
         Left            =   6960
         Picture         =   "Form_cartacob_def.frx":2AE0F
         Style           =   1  'Graphical
         TabIndex        =   71
         Top             =   480
         Width           =   1935
      End
      Begin MSFlexGridLib.MSFlexGrid msfgcobra 
         Height          =   4215
         Left            =   120
         TabIndex        =   69
         ToolTipText     =   """Haga Doble Click Para Ver Esta Carta"""
         Top             =   2640
         Width           =   8895
         _ExtentX        =   15690
         _ExtentY        =   7435
         _Version        =   393216
         Cols            =   6
         FixedCols       =   0
         BackColorFixed  =   -2147483635
         ForeColorFixed  =   -2147483634
         BackColorSel    =   16761024
         ForeColorSel    =   0
         AllowBigSelection=   0   'False
         Enabled         =   -1  'True
         FocusRect       =   2
         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
      End
      Begin VB.Label Label7 
         Alignment       =   2  'Center
         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            =   4680
         TabIndex        =   76
         Top             =   1320
         Width           =   1815
      End
      Begin VB.Label Label6 
         Alignment       =   2  'Center
         Caption         =   "Mes"
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   255
         Left            =   4680
         TabIndex        =   75
         Top             =   600
         Width           =   1815
      End
   End
   Begin VB.Frame Frame1 
      Caption         =   "Lista de 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          =   6975
      Left            =   120
      TabIndex        =   0
      Top             =   120
      Width           =   9135
      Begin VB.Frame framebarra 
         Caption         =   "Generación de Cartas"
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   1215
         Left            =   720
         TabIndex        =   81
         Top             =   2760
         Visible         =   0   'False
         Width           =   7815
         Begin MSComctlLib.ProgressBar probar_gencarta 
            Height          =   615
            Left            =   240
            TabIndex        =   82
            Top             =   360
            Width           =   7335
            _ExtentX        =   12938
            _ExtentY        =   1085
            _Version        =   393216
            Appearance      =   1
            Min             =   1e-4
            Scrolling       =   1
         End
      End
      Begin VB.Frame Frame5 
         Caption         =   "Administracion de Generación"
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   1215
         Left            =   120
         TabIndex        =   66
         Top             =   5640
         Width           =   8895
         Begin VB.CommandButton Command6 
            Caption         =   "&Generar Todas"
            BeginProperty Font 
               Name            =   "Arial"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   855
            Left            =   2040
            Picture         =   "Form_cartacob_def.frx":2B386
            Style           =   1  'Graphical
            TabIndex        =   80
            Top             =   240
            Width           =   1215
         End
         Begin VB.CommandButton Command5 
            Caption         =   "&Estadisticas"
            BeginProperty Font 
               Name            =   "Arial"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   855
            Left            =   7320
            Picture         =   "Form_cartacob_def.frx":2B76B
            Style           =   1  'Graphical
            TabIndex        =   79
            Top             =   240
            Width           =   1215
         End
         Begin VB.CommandButton Command4 
            Caption         =   "&Recalcular"
            BeginProperty Font 
               Name            =   "Arial"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   855
            Left            =   5520
            Picture         =   "Form_cartacob_def.frx":2BE0E
            Style           =   1  'Graphical
            TabIndex        =   78
            Top             =   240
            Width           =   1215
         End
         Begin VB.CommandButton cmb_administrar 
            Caption         =   "&Administrar"
            BeginProperty Font 
               Name            =   "Arial"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   855
            Left            =   3720
            Picture         =   "Form_cartacob_def.frx":2C41B
            Style           =   1  'Graphical
            TabIndex        =   70
            Top             =   240
            Width           =   1215
         End
         Begin VB.CommandButton cmb_generar 
            Caption         =   "&Generar"
            BeginProperty Font 
               Name            =   "Arial"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   855
            Left            =   360
            Picture         =   "Form_cartacob_def.frx":2CA9D
            Style           =   1  'Graphical
            TabIndex        =   67
            Top             =   240
            Width           =   1215
         End
      End
      Begin VB.Frame Frame4 
         Caption         =   "Control Formato"
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   1215
         Left            =   120
         TabIndex        =   61
         Top             =   4320
         Width           =   8895
         Begin VB.CommandButton cmbImpForm 
            Caption         =   "&Ver o Imprimir Formato"
            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          =   855
            Left            =   6840
            Picture         =   "Form_cartacob_def.frx":2D012
            Style           =   1  'Graphical
            TabIndex        =   65
            Top             =   240
            Width           =   1695
         End
         Begin VB.CommandButton CmbBorrar 
            Caption         =   "Eliminar Formato"
            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          =   855
            Left            =   4680
            Picture         =   "Form_cartacob_def.frx":2D56F
            Style           =   1  'Graphical
            TabIndex        =   64
            Top             =   240
            Width           =   1695
         End
         Begin VB.CommandButton CmbEdi 
            Caption         =   "Editar Formato"
            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          =   855
            Left            =   2520
            Picture         =   "Form_cartacob_def.frx":2DBD2
            Style           =   1  'Graphical
            TabIndex        =   63
            Top             =   240
            Width           =   1695
         End
         Begin VB.CommandButton CmbNuevo 
            Caption         =   "Nuevo Formato Carta"
            Default         =   -1  'True
            BeginProperty Font 
               Name            =   "Arial"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   855
            Left            =   360
            Picture         =   "Form_cartacob_def.frx":2E17A
            Style           =   1  'Graphical
            TabIndex        =   62
            Top             =   240
            Width           =   1695
         End
      End
      Begin VB.TextBox Text1 
         Alignment       =   2  'Center
         BackColor       =   &H80000004&
         BorderStyle     =   0  'None
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H00000000&
         Height          =   855
         Index           =   1
         Left            =   2640
         MultiLine       =   -1  'True
         TabIndex        =   5
         Text            =   "Form_cartacob_def.frx":2E71A
         Top             =   1680
         Width           =   3855
      End
      Begin MSFlexGridLib.MSFlexGrid MSFGcartas 
         Height          =   3855
         Left            =   120
         TabIndex        =   60
         Top             =   360
         Width           =   8895
         _ExtentX        =   15690
         _ExtentY        =   6800
         _Version        =   393216
         Cols            =   4
         FixedCols       =   0
         BackColorSel    =   16761024
         ForeColorSel    =   -2147483630
         ScrollBars      =   2
         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
      End
   End
   Begin VB.Frame FrameCarta 
      Caption         =   "Formato de la Carta"
      Enabled         =   0   'False
      BeginProperty Font 
         Name            =   "Arial"
         Size            =   8.25
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H00C00000&
      Height          =   6855
      Left            =   120
      TabIndex        =   6
      Top             =   120
      Visible         =   0   'False
      Width           =   9135
      Begin MSComctlLib.ImageCombo IMCcuotas 
         Height          =   345
         Left            =   5280
         TabIndex        =   4
         Top             =   360
         Width           =   1095
         _ExtentX        =   1931
         _ExtentY        =   609
         _Version        =   393216
         ForeColor       =   12582912
         BackColor       =   -2147483643
         BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
      End
      Begin VB.TextBox Text4 
         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
         MaxLength       =   80
         TabIndex        =   3
         Top             =   1080
         Width           =   6975
      End
      Begin VB.TextBox Text3 
         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
         MaxLength       =   60
         TabIndex        =   2
         Top             =   720
         Width           =   6975
      End
      Begin VB.TextBox Text2 
         Enabled         =   0   'False
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   285
         Left            =   2040
         TabIndex        =   1
         Top             =   360
         Width           =   1455
      End
      Begin TabDlg.SSTab SSTab1 
         Height          =   5415
         Left            =   240
         TabIndex        =   7
         Top             =   1440
         Width           =   8895
         _ExtentX        =   15690
         _ExtentY        =   9551
         _Version        =   393216
         Tabs            =   5
         Tab             =   4
         TabsPerRow      =   5
         TabHeight       =   520
         ForeColor       =   -2147483630
         BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         TabCaption(0)   =   "Cabecera"
         TabPicture(0)   =   "Form_cartacob_def.frx":2E74F
         Tab(0).ControlEnabled=   0   'False
         Tab(0).Control(0)=   "Label2(0)"
         Tab(0).Control(1)=   "Label1(0)"
         Tab(0).Control(2)=   "IMClabel(0)"
         Tab(0).Control(3)=   "Frame3(0)"
         Tab(0).Control(4)=   "TxDes(0)"
         Tab(0).Control(5)=   "Frame2(3)"
         Tab(0).Control(6)=   "Command1(0)"
         Tab(0).Control(7)=   "Command2(0)"
         Tab(0).ControlCount=   8
         TabCaption(1)   =   "Cuerpo"
         TabPicture(1)   =   "Form_cartacob_def.frx":2E76B
         Tab(1).ControlEnabled=   0   'False
         Tab(1).Control(0)=   "Label1(1)"
         Tab(1).Control(1)=   "Label2(1)"
         Tab(1).Control(2)=   "IMClabel(1)"
         Tab(1).Control(3)=   "Frame3(1)"
         Tab(1).Control(4)=   "TxDes(1)"
         Tab(1).Control(5)=   "Frame2(1)"
         Tab(1).Control(6)=   "Command1(1)"
         Tab(1).Control(7)=   "Command2(1)"
         Tab(1).ControlCount=   8
         TabCaption(2)   =   "Detalle Deuda"
         TabPicture(2)   =   "Form_cartacob_def.frx":2E787
         Tab(2).ControlEnabled=   0   'False
         Tab(2).Control(0)=   "Label1(2)"
         Tab(2).Control(1)=   "Label2(2)"
         Tab(2).Control(2)=   "IMClabel(2)"
         Tab(2).Control(3)=   "Frame3(2)"
         Tab(2).Control(4)=   "TxDes(2)"
         Tab(2).Control(5)=   "Frame2(4)"
         Tab(2).Control(6)=   "Command1(2)"
         Tab(2).Control(7)=   "Command2(2)"
         Tab(2).ControlCount=   8
         TabCaption(3)   =   "Texto Post Detalle"
         TabPicture(3)   =   "Form_cartacob_def.frx":2E7A3
         Tab(3).ControlEnabled=   0   'False
         Tab(3).Control(0)=   "Label1(3)"
         Tab(3).Control(1)=   "Label2(3)"
         Tab(3).Control(2)=   "IMClabel(3)"
         Tab(3).Control(3)=   "Frame3(3)"
         Tab(3).Control(4)=   "TxDes(3)"
         Tab(3).Control(5)=   "Frame2(5)"
         Tab(3).Control(6)=   "Command1(3)"
         Tab(3).Control(7)=   "Command2(3)"
         Tab(3).ControlCount=   8
         TabCaption(4)   =   "Post Data"
         TabPicture(4)   =   "Form_cartacob_def.frx":2E7BF
         Tab(4).ControlEnabled=   -1  'True
         Tab(4).Control(0)=   "Label1(4)"
         Tab(4).Control(0).Enabled=   0   'False
         Tab(4).Control(1)=   "Label2(4)"
         Tab(4).Control(1).Enabled=   0   'False
         Tab(4).Control(2)=   "IMClabel(4)"
         Tab(4).Control(2).Enabled=   0   'False
         Tab(4).Control(3)=   "Frame3(4)"
         Tab(4).Control(3).Enabled=   0   'False
         Tab(4).Control(4)=   "TxDes(4)"
         Tab(4).Control(4).Enabled=   0   'False
         Tab(4).Control(5)=   "Frame2(6)"
         Tab(4).Control(5).Enabled=   0   'False
         Tab(4).Control(6)=   "Command1(4)"
         Tab(4).Control(6).Enabled=   0   'False
         Tab(4).Control(7)=   "Command2(4)"
         Tab(4).Control(7).Enabled=   0   'False
         Tab(4).ControlCount=   8
         Begin VB.CommandButton Command2 
            Caption         =   "Aceptar y Grabar"
            BeginProperty Font 
               Name            =   "Arial"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   855
            Index           =   4
            Left            =   5880
            Picture         =   "Form_cartacob_def.frx":2E7DB
            Style           =   1  'Graphical
            TabIndex        =   53
            Top             =   4440
            Width           =   1455
         End
         Begin VB.CommandButton Command1 
            Caption         =   "Cancelar"
            BeginProperty Font 
               Name            =   "Arial"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   855
            Index           =   4
            Left            =   7440
            Picture         =   "Form_cartacob_def.frx":2EE34
            Style           =   1  'Graphical
            TabIndex        =   52
            Top             =   4440
            Width           =   1335
         End
         Begin VB.CommandButton Command2 
            Caption         =   "Aceptar y Grabar"
            BeginProperty Font 
               Name            =   "Arial"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   855
            Index           =   3
            Left            =   -69120
            Picture         =   "Form_cartacob_def.frx":2F19C
            Style           =   1  'Graphical
            TabIndex        =   51
            Top             =   4440
            Width           =   1455
         End
         Begin VB.CommandButton Command1 
            Caption         =   "Cancelar"
            BeginProperty Font 
               Name            =   "Arial"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   855
            Index           =   3
            Left            =   -67560
            Picture         =   "Form_cartacob_def.frx":2F7F5
            Style           =   1  'Graphical
            TabIndex        =   50
            Top             =   4440
            Width           =   1335
         End
         Begin VB.CommandButton Command2 
            Caption         =   "Aceptar y Grabar"
            BeginProperty Font 
               Name            =   "Arial"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   855
            Index           =   2
            Left            =   -69120
            Picture         =   "Form_cartacob_def.frx":2FB5D
            Style           =   1  'Graphical
            TabIndex        =   49
            Top             =   4440
            Width           =   1455
         End
         Begin VB.CommandButton Command1 
            Caption         =   "Cancelar"
            BeginProperty Font 
               Name            =   "Arial"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   855
            Index           =   2
            Left            =   -67560
            Picture         =   "Form_cartacob_def.frx":301B6
            Style           =   1  'Graphical
            TabIndex        =   48
            Top             =   4440
            Width           =   1335
         End
         Begin VB.CommandButton Command2 
            Caption         =   "Aceptar y Grabar"
            BeginProperty Font 
               Name            =   "Arial"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   855
            Index           =   1
            Left            =   -69120
            Picture         =   "Form_cartacob_def.frx":3051E
            Style           =   1  'Graphical
            TabIndex        =   47
            Top             =   4440
            Width           =   1455
         End
         Begin VB.CommandButton Command1 
            Caption         =   "Cancelar"
            BeginProperty Font 
               Name            =   "Arial"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   855
            Index           =   1
            Left            =   -67560
            Picture         =   "Form_cartacob_def.frx":30B77
            Style           =   1  'Graphical
            TabIndex        =   46
            Top             =   4440
            Width           =   1335
         End
         Begin VB.CommandButton Command2 
            Caption         =   "Aceptar y Grabar"
            BeginProperty Font 
               Name            =   "Arial"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   855
            Index           =   0
            Left            =   -69120
            Picture         =   "Form_cartacob_def.frx":30EDF
            Style           =   1  'Graphical
            TabIndex        =   45
            Top             =   4440
            Width           =   1455
         End
         Begin VB.CommandButton Command1 
            Caption         =   "Cancelar"
            BeginProperty Font 
               Name            =   "Arial"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   855
            Index           =   0
            Left            =   -67560
            Picture         =   "Form_cartacob_def.frx":31538
            Style           =   1  'Graphical
            TabIndex        =   44
            Top             =   4440
            Width           =   1335
         End
         Begin VB.Frame Frame2 
            Caption         =   "Carta"
            BeginProperty Font 
               Name            =   "Arial"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   3975
            Index           =   1
            Left            =   -69120
            TabIndex        =   29
            Top             =   360
            Width           =   2895
            Begin VB.Image Image1 
               BorderStyle     =   1  'Fixed Single
               Height          =   735
               Index           =   9
               Left            =   120
               Picture         =   "Form_cartacob_def.frx":318A0
               Stretch         =   -1  'True
               Top             =   1080
               Width           =   2655
            End
            Begin VB.Image Image1 
               Height          =   735
               Index           =   8
               Left            =   240
               Picture         =   "Form_cartacob_def.frx":322C0
               Stretch         =   -1  'True
               Top             =   1680
               Width           =   2535
            End
            Begin VB.Image Image1 
               Height          =   735
               Index           =   7
               Left            =   240
               Picture         =   "Form_cartacob_def.frx":32F09
               Stretch         =   -1  'True
               Top             =   2400
               Width           =   2535
            End
            Begin VB.Image Image1 
               Height          =   735
               Index           =   6
               Left            =   240
               Picture         =   "Form_cartacob_def.frx":3373D
               Stretch         =   -1  'True
               Top             =   3120
               Width           =   2535
            End
            Begin VB.Image Image1 
               Appearance      =   0  'Flat
               Height          =   855
               Index           =   5
               Left            =   240
               Picture         =   "Form_cartacob_def.frx":33C78
               Stretch         =   -1  'True
               Top             =   240
               Width           =   2535
            End
         End
         Begin VB.Frame Frame2 
            Caption         =   "Carta"
            Height          =   3975
            Index           =   2
            Left            =   -69120
            TabIndex        =   28
            Top             =   600
            Width           =   3015
            Begin VB.Image Image1 
               BorderStyle     =   1  'Fixed Single
               Height          =   855
               Index           =   0
               Left            =   120
               Picture         =   "Form_cartacob_def.frx":343EF
               Stretch         =   -1  'True
               Top             =   240
               Width           =   2655
            End
            Begin VB.Image Image1 
               Height          =   735
               Index           =   4
               Left            =   240
               Picture         =   "Form_cartacob_def.frx":34B66
               Stretch         =   -1  'True
               Top             =   3120
               Width           =   2535
            End
            Begin VB.Image Image1 
               Height          =   735
               Index           =   3
               Left            =   240
               Picture         =   "Form_cartacob_def.frx":350A1
               Stretch         =   -1  'True
               Top             =   2400
               Width           =   2535
            End
            Begin VB.Image Image1 
               Height          =   735
               Index           =   2
               Left            =   240
               Picture         =   "Form_cartacob_def.frx":358D5
               Stretch         =   -1  'True
               Top             =   1680
               Width           =   2535
            End
            Begin VB.Image Image1 
               Height          =   735
               Index           =   1
               Left            =   240
               Picture         =   "Form_cartacob_def.frx":3651E
               Stretch         =   -1  'True
               Top             =   960
               Width           =   2535
            End
         End
         Begin VB.Frame Frame2 
            Caption         =   "Carta"
            BeginProperty Font 
               Name            =   "Arial"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   3975
            Index           =   3
            Left            =   -69120
            TabIndex        =   27
            Top             =   360
            Width           =   2895
            Begin VB.Image Image1 
               BorderStyle     =   1  'Fixed Single
               Height          =   855
               Index           =   10
               Left            =   120
               Picture         =   "Form_cartacob_def.frx":36F3E
               Stretch         =   -1  'True
               Top             =   240
               Width           =   2655
            End
            Begin VB.Image Image1 
               Height          =   735
               Index           =   11
               Left            =   240
               Picture         =   "Form_cartacob_def.frx":376B5
               Stretch         =   -1  'True
               Top             =   3120
               Width           =   2535
            End
            Begin VB.Image Image1 
               Height          =   735
               Index           =   12
               Left            =   240
               Picture         =   "Form_cartacob_def.frx":37BF0
               Stretch         =   -1  'True
               Top             =   2400
               Width           =   2535
            End
            Begin VB.Image Image1 
               Height          =   735
               Index           =   13
               Left            =   240
               Picture         =   "Form_cartacob_def.frx":38424
               Stretch         =   -1  'True
               Top             =   1680
               Width           =   2535
            End
            Begin VB.Image Image1 
               Height          =   735
               Index           =   14
               Left            =   240
               Picture         =   "Form_cartacob_def.frx":3906D
               Stretch         =   -1  'True
               Top             =   1080
               Width           =   2535
            End
         End
         Begin VB.Frame Frame2 
            Caption         =   "Carta"
            BeginProperty Font 
               Name            =   "Arial"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   3975
            Index           =   4
            Left            =   -69120
            TabIndex        =   26
            Top             =   360
            Width           =   2895
            Begin VB.Image Image1 
               Appearance      =   0  'Flat
               Height          =   855
               Index           =   15
               Left            =   240
               Picture         =   "Form_cartacob_def.frx":39A8D
               Stretch         =   -1  'True
               Top             =   240
               Width           =   2535
            End
            Begin VB.Image Image1 
               Height          =   735
               Index           =   16
               Left            =   240
               Picture         =   "Form_cartacob_def.frx":3A204
               Stretch         =   -1  'True
               Top             =   3120
               Width           =   2535
            End
            Begin VB.Image Image1 
               Height          =   735
               Index           =   17
               Left            =   240
               Picture         =   "Form_cartacob_def.frx":3A73F
               Stretch         =   -1  'True
               Top             =   2400
               Width           =   2535
            End
            Begin VB.Image Image1 
               Appearance      =   0  'Flat
               Height          =   735
               Index           =   19
               Left            =   240
               Picture         =   "Form_cartacob_def.frx":3AF73
               Stretch         =   -1  'True
               Top             =   1080
               Width           =   2535
            End
            Begin VB.Image Image1 
               BorderStyle     =   1  'Fixed Single
               Height          =   735
               Index           =   18
               Left            =   120
               Picture         =   "Form_cartacob_def.frx":3B993
               Stretch         =   -1  'True
               Top             =   1800
               Width           =   2655
            End
         End
         Begin VB.Frame Frame2 
            Caption         =   "Carta"
            BeginProperty Font 
               Name            =   "Arial"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   3975
            Index           =   5
            Left            =   -69120
            TabIndex        =   25
            Top             =   360
            Width           =   2895
            Begin VB.Image Image1 
               Appearance      =   0  'Flat
               Height          =   855
               Index           =   20
               Left            =   240
               Picture         =   "Form_cartacob_def.frx":3C5DC
               Stretch         =   -1  'True
               Top             =   240
               Width           =   2535
            End
            Begin VB.Image Image1 
               Height          =   735
               Index           =   21
               Left            =   240
               Picture         =   "Form_cartacob_def.frx":3CD53
               Stretch         =   -1  'True
               Top             =   3120
               Width           =   2535
            End
            Begin VB.Image Image1 
               Height          =   735
               Index           =   23
               Left            =   240
               Picture         =   "Form_cartacob_def.frx":3D28E
               Stretch         =   -1  'True
               Top             =   1680
               Width           =   2535
            End
            Begin VB.Image Image1 
               Height          =   735
               Index           =   24
               Left            =   240
               Picture         =   "Form_cartacob_def.frx":3DED7
               Stretch         =   -1  'True
               Top             =   1080
               Width           =   2535
            End
            Begin VB.Image Image1 
               BorderStyle     =   1  'Fixed Single
               Height          =   735
               Index           =   22
               Left            =   120
               Picture         =   "Form_cartacob_def.frx":3E8F7
               Stretch         =   -1  'True
               Top             =   2400
               Width           =   2655
            End
         End
         Begin VB.Frame Frame2 
            Caption         =   "Carta"
            BeginProperty Font 
               Name            =   "Arial"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   3975
            Index           =   6
            Left            =   5880
            TabIndex        =   24
            Top             =   360
            Width           =   2895
            Begin VB.Image Image1 
               Appearance      =   0  'Flat
               Height          =   855
               Index           =   25
               Left            =   240
               Picture         =   "Form_cartacob_def.frx":3F12B
               Stretch         =   -1  'True
               Top             =   240
               Width           =   2535
            End
            Begin VB.Image Image1 
               BorderStyle     =   1  'Fixed Single
               Height          =   735
               Index           =   26
               Left            =   120
               Picture         =   "Form_cartacob_def.frx":3F8A2
               Stretch         =   -1  'True
               Top             =   3120
               Width           =   2655
            End
            Begin VB.Image Image1 
               Height          =   735
               Index           =   27
               Left            =   240
               Picture         =   "Form_cartacob_def.frx":3FDDD
               Stretch         =   -1  'True
               Top             =   2400
               Width           =   2535
            End
            Begin VB.Image Image1 
               Height          =   735
               Index           =   28
               Left            =   240
               Picture         =   "Form_cartacob_def.frx":40611
               Stretch         =   -1  'True
               Top             =   1680
               Width           =   2535
            End
            Begin VB.Image Image1 
               Height          =   735
               Index           =   29
               Left            =   240
               Picture         =   "Form_cartacob_def.frx":4125A
               Stretch         =   -1  'True
               Top             =   1080
               Width           =   2535
            End
         End
         Begin VB.TextBox TxDes 
            BeginProperty Font 
               Name            =   "Arial"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   3015
            Index           =   0
            Left            =   -74880
            MultiLine       =   -1  'True
            TabIndex        =   23
            Top             =   720
            Width           =   5655
         End
         Begin VB.TextBox TxDes 
            BeginProperty Font 
               Name            =   "Arial"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   3015
            Index           =   1
            Left            =   -74880
            MultiLine       =   -1  'True
            TabIndex        =   21
            Top             =   720
            Width           =   5655
         End
         Begin VB.TextBox TxDes 
            BeginProperty Font 
               Name            =   "Arial"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   3015
            Index           =   2
            Left            =   -74880
            MultiLine       =   -1  'True
            TabIndex        =   20
            Top             =   720
            Width           =   5655
         End
         Begin VB.TextBox TxDes 
            BeginProperty Font 
               Name            =   "Arial"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   3015
            Index           =   3
            Left            =   -74880
            MultiLine       =   -1  'True
            TabIndex        =   19
            Top             =   720
            Width           =   5655
         End
         Begin VB.TextBox TxDes 
            BeginProperty Font 
               Name            =   "Arial"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   3015
            Index           =   4
            Left            =   120
            MultiLine       =   -1  'True
            TabIndex        =   18
            Top             =   720
            Width           =   5655
         End
         Begin VB.Frame Frame3 
            Caption         =   "Información Adicional"
            BeginProperty Font 
               Name            =   "Arial"
               Size            =   8.25
               Charset         =   0
               Weight          =   700
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            ForeColor       =   &H00C00000&
            Height          =   855
            Index           =   0
            Left            =   -74880
            TabIndex        =   16
            Top             =   4440
            Width           =   5655
            Begin VB.Label Label3 
               BeginProperty Font 
                  Name            =   "Arial"
                  Size            =   8.25
                  Charset         =   0
                  Weight          =   400
                  Underline       =   0   'False
                  Italic          =   0   'False
                  Strikethrough   =   0   'False
               EndProperty
               Height          =   495
               Index           =   0
               Left            =   120
               TabIndex        =   17
               Top             =   240
               Width           =   5295
            End
         End
         Begin VB.Frame Frame3 
            Caption         =   "Información Adicional"
            BeginProperty Font 
               Name            =   "Arial"
               Size            =   8.25
               Charset         =   0
               Weight          =   700
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            ForeColor       =   &H00FF0000&
            Height          =   855
            Index           =   1
            Left            =   -74880
            TabIndex        =   14
            Top             =   4440
            Width           =   5655
            Begin VB.Label Label3 
               BeginProperty Font 
                  Name            =   "Arial"
                  Size            =   8.25
                  Charset         =   0
                  Weight          =   400
                  Underline       =   0   'False
                  Italic          =   0   'False
                  Strikethrough   =   0   'False
               EndProperty
               Height          =   495
               Index           =   1
               Left            =   120
               TabIndex        =   15
               Top             =   240
               Width           =   5295
            End
         End
         Begin VB.Frame Frame3 
            Caption         =   "Información Adicional"
            BeginProperty Font 
               Name            =   "Arial"
               Size            =   8.25
               Charset         =   0
               Weight          =   700
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            ForeColor       =   &H00C00000&
            Height          =   855
            Index           =   2
            Left            =   -74880
            TabIndex        =   12
            Top             =   4440
            Width           =   5655
            Begin VB.Label Label3 
               BeginProperty Font 
                  Name            =   "Arial"
                  Size            =   8.25
                  Charset         =   0
                  Weight          =   400
                  Underline       =   0   'False
                  Italic          =   0   'False
                  Strikethrough   =   0   'False
               EndProperty
               Height          =   495
               Index           =   2
               Left            =   120
               TabIndex        =   13
               Top             =   240
               Width           =   5295
            End
         End
         Begin VB.Frame Frame3 
            Caption         =   "Información Adicional"
            BeginProperty Font 
               Name            =   "Arial"
               Size            =   8.25
               Charset         =   0
               Weight          =   700
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            ForeColor       =   &H00C00000&
            Height          =   855
            Index           =   3
            Left            =   -74880
            TabIndex        =   10
            Top             =   4440
            Width           =   5655
            Begin VB.Label Label3 
               BeginProperty Font 
                  Name            =   "Arial"
                  Size            =   8.25
                  Charset         =   0
                  Weight          =   400
                  Underline       =   0   'False
                  Italic          =   0   'False
                  Strikethrough   =   0   'False
               EndProperty
               Height          =   495
               Index           =   3
               Left            =   120
               TabIndex        =   11
               Top             =   240
               Width           =   5295
            End
         End
         Begin VB.Frame Frame3 
            Caption         =   "Información Adicional"
            BeginProperty Font 
               Name            =   "Arial"
               Size            =   8.25
               Charset         =   0
               Weight          =   700
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            ForeColor       =   &H00C00000&
            Height          =   855
            Index           =   4
            Left            =   120
            TabIndex        =   8
            Top             =   4440
            Width           =   5655
            Begin VB.Label Label3 
               BeginProperty Font 
                  Name            =   "Arial"
                  Size            =   8.25
                  Charset         =   0
                  Weight          =   400
                  Underline       =   0   'False
                  Italic          =   0   'False
                  Strikethrough   =   0   'False
               EndProperty
               Height          =   495
               Index           =   4
               Left            =   120
               TabIndex        =   9
               Top             =   240
               Width           =   5295
            End
         End
         Begin MSComctlLib.ImageCombo IMClabel 
            Height          =   345
            Index           =   0
            Left            =   -71640
            TabIndex        =   22
            Top             =   3960
            Width           =   2415
            _ExtentX        =   4260
            _ExtentY        =   609
            _Version        =   393216
            ForeColor       =   0
            BackColor       =   -2147483643
            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
            Locked          =   -1  'True
         End
         Begin MSComctlLib.ImageCombo IMClabel 
            Height          =   345
            Index           =   1
            Left            =   -71640
            TabIndex        =   30
            Top             =   3960
            Width           =   2415
            _ExtentX        =   4260
            _ExtentY        =   609
            _Version        =   393216
            ForeColor       =   0
            BackColor       =   -2147483643
            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
            Locked          =   -1  'True
         End
         Begin MSComctlLib.ImageCombo IMClabel 
            Height          =   345
            Index           =   2
            Left            =   -71640
            TabIndex        =   31
            Top             =   3960
            Width           =   2415
            _ExtentX        =   4260
            _ExtentY        =   609
            _Version        =   393216
            ForeColor       =   0
            BackColor       =   -2147483643
            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
            Locked          =   -1  'True
         End
         Begin MSComctlLib.ImageCombo IMClabel 
            Height          =   345
            Index           =   3
            Left            =   -71640
            TabIndex        =   32
            Top             =   3960
            Width           =   2415
            _ExtentX        =   4260
            _ExtentY        =   609
            _Version        =   393216
            ForeColor       =   0
            BackColor       =   -2147483643
            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
            Locked          =   -1  'True
         End
         Begin MSComctlLib.ImageCombo IMClabel 
            Height          =   345
            Index           =   4
            Left            =   3360
            TabIndex        =   33
            Top             =   3960
            Width           =   2415
            _ExtentX        =   4260
            _ExtentY        =   609
            _Version        =   393216
            ForeColor       =   0
            BackColor       =   -2147483643
            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
            Locked          =   -1  'True
         End
         Begin VB.Label Label1 
            Caption         =   "Texto de Cabecera"
            BeginProperty Font 
               Name            =   "Arial"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   375
            Index           =   0
            Left            =   -74880
            TabIndex        =   43
            Top             =   480
            Width           =   2175
         End
         Begin VB.Label Label2 
            Caption         =   "Campo a Insertar:"
            BeginProperty Font 
               Name            =   "Arial"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            ForeColor       =   &H00000000&
            Height          =   255
            Index           =   0
            Left            =   -72960
            TabIndex        =   42
            Top             =   3960
            Width           =   1335
         End
         Begin VB.Label Label2 
            Caption         =   "Campo a Insertar:"
            BeginProperty Font 
               Name            =   "Arial"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            ForeColor       =   &H00000000&
            Height          =   375
            Index           =   1
            Left            =   -72960
            TabIndex        =   41
            Top             =   3960
            Width           =   1335
         End
         Begin VB.Label Label1 
            Caption         =   "Texto del Cuerpo"
            BeginProperty Font 
               Name            =   "Arial"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   375
            Index           =   1
            Left            =   -74880
            TabIndex        =   40
            Top             =   480
            Width           =   1335
         End
         Begin VB.Label Label2 
            Caption         =   "Campo a Insertar:"
            BeginProperty Font 
               Name            =   "Arial"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            ForeColor       =   &H00000000&
            Height          =   375
            Index           =   2
            Left            =   -72960
            TabIndex        =   39
            Top             =   3960
            Width           =   1335
         End
         Begin VB.Label Label1 
            Caption         =   "Detalle (Nota: Los Datos  de la deuda serán agregado automaticamente)"
            BeginProperty Font 
               Name            =   "Arial"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   375
            Index           =   2
            Left            =   -74880
            TabIndex        =   38
            Top             =   480
            Width           =   5415
         End
         Begin VB.Label Label2 
            Caption         =   "Campo a Insertar:"
            BeginProperty Font 
               Name            =   "Arial"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            ForeColor       =   &H00000000&
            Height          =   255
            Index           =   3
            Left            =   -72960
            TabIndex        =   37
            Top             =   3960
            Width           =   1335
         End
         Begin VB.Label Label1 
            Caption         =   "Texto del Cuerpo"
            BeginProperty Font 
               Name            =   "Arial"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   375
            Index           =   3
            Left            =   -74880
            TabIndex        =   36
            Top             =   480
            Width           =   5415
         End
         Begin VB.Label Label2 
            Caption         =   "Campo a Insertar:"
            BeginProperty Font 
               Name            =   "Arial"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            ForeColor       =   &H00000000&
            Height          =   375
            Index           =   4
            Left            =   2040
            TabIndex        =   35
            Top             =   3960
            Width           =   1335
         End
         Begin VB.Label Label1 
            Caption         =   "Texto del Post Data"
            BeginProperty Font 
               Name            =   "Arial"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   375
            Index           =   4
            Left            =   120
            TabIndex        =   34
            Top             =   480
            Width           =   5415
         End
      End
      Begin VB.Label Label4 
         Caption         =   "Condición de Emisión "
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   375
         Left            =   3720
         TabIndex        =   57
         Top             =   360
         Width           =   1695
      End
      Begin VB.Label labeldesc 
         Caption         =   "Título de la Carta:"
         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        =   56
         Top             =   1080
         Width           =   1695
      End
      Begin VB.Label labeltit 
         Caption         =   "Título de la Carta:"
         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        =   55
         Top             =   720
         Width           =   1695
      End
      Begin VB.Label nombreLabel 
         Caption         =   "Codigo de la Carta:"
         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        =   54
         Top             =   360
         Width           =   1695
      End
      Begin VB.Label Label5 
         Caption         =   "Mensualidades Atrasadas"
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   375
         Left            =   6480
         TabIndex        =   58
         Top             =   360
         Width           =   2295
      End
   End
End
Attribute VB_Name = "Form_cartacob_def"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim atributoreal As String
Private granconsulta, filtrocant, filtrocuales, CURRENS, CURRCUR, currmes, curragno As String
Private Sub cbidesde_Click()
    'llenarcartas
End Sub

Private Sub cmb_administrar_Click()
    Dim versihay As ADODB.Recordset
    Set versihay = New ADODB.Recordset
    
    versihay.Open "select count(*) as contar from hist_cobcartacab", conn
    If versihay!contar < 1 Then
        MsgBox "No hay Cartas definidas", vbInformation, "Monitor de Cartas"
        Exit Sub
    End If
        
    Frame1.Enabled = False
    FrameFilro.Enabled = True
    FrameFilro.Visible = True
    Me.Refresh
    currmes = Trim(str(Month(Date)))
    curragno = Trim(str(Year(Date)))
    formatgrill1
    formatgrill
    llenarcmbimgsql Me.imcmes, "Select month(fec_gen) as texto from hist_cobcartacab where year(fec_gen)=" & Trim(str(Year(Date))) & " group by texto"
    llenarcmbimgsql Me.imcagno, "Select year(fec_gen) as texto from hist_cobcartacab group by texto"
    
End Sub

Private Sub cmb_generar_Click()
    Dim deuda As ADODB.Recordset
    Dim deudore As ADODB.Recordset
    Dim grabarca As ADODB.Command
    Dim sqlgrabacurso As ADODB.Command
    Dim quedatos As ADODB.Recordset
    Dim quedeuda As ADODB.Recordset
    Dim queapo As ADODB.Recordset
    Dim quecole As ADODB.Recordset
    Dim concaens As ADODB.Recordset
    Dim finalfinal As Boolean
    Dim fechaactual As Date
    Dim agnod, mesd, t, diad, tipocarta, seguir As Integer
    Dim totaltotal, TotalAbono, n, tam As Long
    Dim estaono, upda As Boolean
    Dim cual, Sqlrescatadeuda As String
    Dim Sqldeudor As String
    Dim SqlApo As String
    Dim Sqlcreacarta As String
    Dim Sqlquedatos, RunApo, linea As String
    Dim INIC, FINC As Long
    Dim FECHAHORAIMP, responsable As String
    Dim cursoentre, cursoact As String
    
    FECHAHORAIMP = Now()
    inicio = 0
    responsable = Nom_usu_ses
    
    Dim agnocobranza As Integer
    agnocobranza = Anno
    Set quecole = New ADODB.Recordset
    quecole.Open "Select colegio from establecimientos, hist_cod_colegio where establecimientos.rdb = hist_cod_colegio.cod_rbd", conn
    'MsgBox quecole!Colegio
    upda = False
        
    'text_carta.Visible = True
    finalfinal = False
    estaono = True
    fechaactual = Date
    
    agnod = Anno
    mesd = Month(fechaactual)
    diad = Day(fechaactual)
  
    Set quedatos = New ADODB.Recordset
    
    Me.MSFGcartas.Col = 3
    If diad > 10 Then
        mesd = mesd + 1
    End If
     quedatos.Open "Select fol_aut from hist_cobcartacab as o, cob_cartaformato as p where month(o.fec_gen)=" & Trim(str(mesd)) & " and year(o.fec_gen)=" & Trim(str(agnod)) & " and o.nformato=p.nformato and cond_cuotas=" & Trim(Me.MSFGcartas.Text), conn
     
    If quedatos.RecordCount > 0 Then
       seguir = MsgBox("   Existen Carta ya creadas en este Mes para la condición actual" & vbCrLf & "¿ Desea Crea Nuevamente estas Cartas ?", vbYesNo, "Monitor de Verificacion")
       If seguir = 7 Then
          Exit Sub
       Else

          MsgBox ("No esta permitida tal accion")
          Exit Sub
        End If
    End If
    quedatos.Close
        
    totaltotal = 0
    TotalAbono = 0
    'Sqlquedatos = "Select campo from cob_labels where tabla='apoderados'"
    'Set quedatos = New ADODB.Recordset
    'quedatos.Open Sqlquedatos, conn
  
    'RunApo = "11392336-9"
   ' Sqldeudor = "Select run_apo, mes, agno from fnza_mensualidad where run_apo='" & RunApo & "' and estado_mens='impg' and agno=2005"
           
     Me.MSFGcartas.Col = 3

     Sqldeudor = "SELECT * FROM (" & _
        "Select  folio_mens,run_apo, agno, mes,colegio from fnza_mensualidad" & _
                " where (monto_mens - abono_mens) > 0 and mes < " & mesd & " and agno=" & agnod & " and colegio='" & quecole!colegio & "'" & _
                " order by run_apo,mes,agno)" & _
     " AS TETO" & _
     " JOIN (" & _
        " Select run_apo as ruteto, count(run_apo) as cuanto from fnza_mensualidad" & _
               " where (monto_mens - abono_mens)> 0 and mes < " & mesd & " and agno=" & agnod & " and colegio='" & quecole!colegio & "'" & _
               " group by run_apo" & _
               " order by ruteto)" & _
     " AS TOCA" & _
     " WHERE TETO.RUN_APO = TOCA.RUTETO AND CUANTO=" & Trim(Me.MSFGcartas.Text) & " AND COLEGIO='" & Trim(quecole!colegio) & "'  and run_apo " _
     & " in (select axa.rut_apo from apo_x_alu axa,alu_x_cur axc" _
    & " where axa.ci_alu = axc.ci_alu and axa.agno =axc.agno and axa.agno = " & agnod & ")"
    
    Set deudore = New ADODB.Recordset
    deudore.Open Sqldeudor, conn
    mesd = mesd - 1
    tam = 1
    
    probar_gencarta.Max = deudore.RecordCount + 1
    probar_gencarta.Min = 0
    framebarra.Visible = True
    'frmsombragen.Visible = True
    'frmsombragen.Refresh
    framebarra.Refresh
    probar_gencarta.Value = tam
    
    While Not deudore.EOF
    totaltotal = 0
    TotalAbono = 0
    RunApo = deudore!run_apo

    
    
    
    If deudore.RecordCount > 0 Then
    
    
      
                        text_carta.Text = "        MES              AÑO    APELLIDO y NOMBRE      ABONO         TOTAL MES" & vbCrLf
      text_carta.Text = text_carta.Text & "       ===========================================================" & vbCrLf
    
      For I = 1 To (Me.MSFGcartas.Text)
        'Sqlrescatadeuda = "Select mes,fnza_detalle_mensualidad.agno,monto_abono,rpad(concat(ape_pat_alu,' ', LEFT(nom_alu,5)),20,' ') as nomb_alu, (monto_total-monto_exen_hno-monto_exen_bca-monto_exen_desc-monto_exen_conv) as monto_totales, concat(alu_x_cur.cod_ens,alu_x_cur.num_gra,alu_x_cur.let_cur) as codcom from fnza_detalle_mensualidad,postulantes,alu_x_cur where folio_mens=" & Trim(str(deudore!Folio_Mens)) & " and postulantes.ci_alu=run_alu and postulantes.ci_alu=alu_x_cur.ci_alu order by mes,agno"
        Sqlrescatadeuda = "Select if(mes=2, 'Febrero      ',if(mes=3, 'Marzo        ',if(mes=4, 'Abril        ',if(mes=5, 'Mayo         ',if(mes=6, 'Junio        ',if(mes=7, 'Julio        ',if(mes=8, 'Agosto       ',if(mes=9, 'Septiembre',if(mes=10,'Octubre    ',if(mes=11,'Noviembre',                 'Diciembre  ')))))))))) as mes" _
                        & ",fnza_detalle_mensualidad.agno,monto_abono,rpad(concat(ape_pat_alu,' ',ape_mat_alu,' ',LEFT(nom_alu,5)),21,"" "") as nomb_alu,monto_tot_cuota as monto_totales, concat(alu_x_cur.cod_ens,alu_x_cur.num_gra,alu_x_cur.let_cur) as codcom from fnza_detalle_mensualidad,postulantes,alu_x_cur,matriculas where folio_mens=" & Trim(str(deudore!folio_mens)) & " and postulantes.ci_alu=run_alu and postulantes.ci_alu=alu_x_cur.ci_alu and run_alu=matriculas.ci_alu and matriculas.anno_mat=" & Trim(str(agnod)) & " and matriculas.ind_cheq<>1 and matriculas.ind_beca<>1  and matriculas.cod_ens=alu_x_cur.cod_ens and matriculas.num_gra=alu_x_cur.num_gra and matriculas.activo_alu='SI' and matriculas.fec_mat=alu_x_cur.fec_mat and date_format(fec_cam,'%d-%m-%Y')='11-11-1111' and alu_x_cur.agno=" & Trim(str(agnod)) & " and fnza_detalle_mensualidad.agno=" & Trim(str(agnod)) & " order by mes,agno"
        Set deuda = New ADODB.Recordset
        deuda.Open Sqlrescatadeuda, conn
        
        t = 0
        cursoentre = " "
        cursoact = " "
        While Not deuda.EOF
            If deuda!monto_totales - deuda!monto_abono <> 0 Then
                linea = "        " & deuda!mes & "    " & deuda!agno & "   " & deuda!nomb_alu & "  " & Format(Left(Trim(Format(deuda!monto_abono, "currency")), Len(Format(deuda!monto_abono, "currency")) - 3), "!@@@@@@@@@") & "     " & Format(Left(Trim(Format(deuda!monto_totales, "currency")), Len(Format(deuda!monto_totales, "currency")) - 3), "!@@@@@@@@") & vbCrLf
           
                text_carta.Text = text_carta.Text & linea
                totaltotal = totaltotal + val(deuda!monto_totales)
                TotalAbono = TotalAbono + val(deuda!monto_abono)
            
            
                Set concaens = New ADODB.Recordset
                concaens.Open "Select ord_ens from codigos_ensenanza where cod_ens='" & Left(deuda!codcom, 3) & "'", conn
            
                If concaens.RecordCount > 0 Then
                    cursoact = Trim(str(concaens!ord_ens)) & deuda!codcom
                End If
                concaens.Close
            
                If Trim(cursoentre) < Trim(cursoact) Then
                    cursoentre = cursoact
                End If
                 'Calculo de deuda por Curso********************************************
                Set sqlgrabacurso = New ADODB.Command
        
                sqlgrabacurso.CommandType = adCmdText
                sqlgrabacurso.ActiveConnection = conn
                sqlgrabacurso.CommandText = "insert into hist_deudaxcur set codenl='" & deuda!codcom & "', mes=" & Trim(str(mesd)) & ", agno=" & Trim(str(agnod)) & ", deuda=" & Trim(str(val(deuda!monto_totales - deuda!monto_abono))) & ", atraso=" & Trim(Me.MSFGcartas.Text) & " ON DUPLICATE KEY UPDATE deuda= deuda + " & Trim(str(val(deuda!monto_totales - deuda!monto_abono))) '& ", cuantos = cuantos + 1"
                sqlgrabacurso.Execute
              End If
            deuda.MoveNext
            t = t + 1
        Wend
        
        deudore.MoveNext
        
        If deudore.EOF Then
            finalfinal = True
            deudore.MovePrevious
        End If
        Me.probar_gencarta.Value = Me.probar_gencarta.Value + 1
        
        deuda.Close
      Next
        
        text_carta.Text = text_carta.Text & "       ···························································" & vbCrLf
        text_carta.Text = text_carta.Text & "                                            Totales    " & Format(Left(Trim(Format(str(TotalAbono), "currency")), Len(Format(TotalAbono, "currency")) - 3), "!@@@@@@@@@") & "     " & Format(Left(Trim(Format(str(totaltotal), "currency")), Len(Format(totaltotal, "currency")) - 3), "!@@@@@@@@@") & vbCrLf
        text_carta.Text = text_carta.Text & "                                                                     =========" & vbCrLf
        text_carta.Text = text_carta.Text & "                                                        TOTAL DEUDA  " & Format(Left(Trim(Format(str(totaltotal - TotalAbono), "currency")), Len(Format(str(totaltotal - TotalAbono), "currency")) - 3), "!@@@@@@@@@")
        t = val(Me.MSFGcartas.Text)
        
        If (totaltotal - TotalAbono) <= 0 Then
                Set grabarca = New ADODB.Command
                grabarca.CommandType = adCmdText
                grabarca.ActiveConnection = conn
        
                grabarca.CommandText = "INSERT INTO hist_cartaimpre set fechahora='" & Format(FECHAHORAIMP, "yyyy-mm-dd hh:mm:ss") & "', accion='Deuda anomala en la generacion para el apoderado con rut " & deudore!run_apo & " con el siguiente deuda " & str(totaltotal - TotalAbono) & ", para los apoderados con " & Me.MSFGcartas.Text & " Mensualidades atrasadas en el Curso" & Mid(cursoentre, 2, Len(cursoentre) - 1) & "', responsable='" & responsable & "'"
                grabarca.Execute
        End If
    
        deuda.Open "select count(*) as conteo from hist_cobcartacab", conn

        Set quedatos = New ADODB.Recordset
        quedatos.Open "Select cb.nformato, cb.cond_cuotas, cc.tpar from cob_cartaformato as cb join cob_cartacabdeta as cc where cc.nformato=cb.nformato and cb.cond_cuotas=" & Trim(str(t)), conn
    
    
    
        Set quedeuda = New ADODB.Recordset
        quedeuda.Open "Select label, campo, tabla from cob_labels", conn
    
        SqlApo = "Select "
    
        While Not quedeuda.EOF
            If Trim(quedeuda!tabla) <> "apoderados" Then
                If quedeuda!tabla = "fechagen" Then
                    SqlApo = SqlApo & quedeuda!campo & " as " & quedeuda!tabla
                Else
                    SqlApo = SqlApo & quedeuda!tabla & "." & quedeuda!campo
                End If
            Else
                SqlApo = SqlApo & quedeuda!tabla & "." & quedeuda!campo
            End If
            
            quedeuda.MoveNext
            If quedeuda.EOF Then
                'SqlApo = SqlApo & " from apoderados join establecimientos where rut_apo='" & RunApo & "'"
                 SqlApo = "Select apoderados.RUT_APO,apoderados.APE1_APO,apoderados.NOMS_APO,apoderados.DIR_APO,concat(CURRENT_DATE,' ',CURRENT_TIME) as fechagen,concat(establecimientos.NOM_EST,'\nAlumno(a) ',concat(nom_alu,' ',ape_pat_alu,' ',ape_mat_alu),'\nCurso '," _
                        & "concat(c.num_gra,'° ',c.let_cur,' ',if(c.cod_ens='996','Pre-Kinder',if(c.cod_ens='010','Kinder',if(c.cod_ens='110','Basico','Media'))))) as nom_est,apoderados.APE2_APO" _
                        & " from apo_x_alu axa,alu_x_cur c,postulantes p," _
                        & " apoderados  join establecimientos where" _
                        & " axa.rut_apo = apoderados.rut_apo and apoderados.rut_apo='" & RunApo & "'" _
                        & " and c.ci_alu = axa.ci_alu and c.agno = axa.agno and c.agno = " & agnod _
                        & " and c.ci_alu = p.ci_alu" _
                        & " group by c.ci_alu"
            Else
                SqlApo = SqlApo & ","
            End If
        Wend
        quedeuda.MoveFirst
            
        Set queapo = New ADODB.Recordset
        queapo.Open SqlApo, conn
        
        Set grabarca = New ADODB.Command
        grabarca.CommandType = adCmdText
        grabarca.ActiveConnection = conn
        grabarca.CommandText = "INSERT INTO hist_cobcartacab set fol_aut=" & str(deuda!conteo + 1) & ", rut_apo='" & RunApo & "', fec_gen='" & queapo!fechagen & "', nformato=" & quedatos!nformato & ", total_deuda=" & str(Trim(str(totaltotal - TotalAbono))) & ",cursoentrega='" & Mid(cursoentre, 2, Len(cursoentre) - 1) & "'"
        grabarca.Execute
        
        If INIC = 0 Then
            INIC = deuda!conteo + 1
        Else
            FINC = deuda!conteo + 1
        End If
        
        While Not quedatos.EOF
        
            While Not quedeuda.EOF
                
                atributo = quedeuda!Label
                If quedeuda!tabla = "apoderados" Then
                    If quedeuda!campo = "RUT_APO" Then
                       atributoreal = Format(queapo!rut_apo, "@@.@@@.@@@@@")
                    ElseIf quedeuda!campo = "APE1_APO" Then
                       atributoreal = queapo!ape1_apo
                    ElseIf quedeuda!campo = "NOMS_APO" Then
                       atributoreal = queapo!Noms_Apo
                    ElseIf quedeuda!campo = "DIR_APO" Then
                       atributoreal = queapo!dir_apo
                    ElseIf quedeuda!campo = "APE2_APO" Then
                       atributoreal = queapo!ape2_apo
                    End If
                ElseIf quedeuda!tabla = "fechagen" Then
                    atributoreal = Format(queapo!fechagen, "Dddd,dd \de Mmmm \de yyyy")
                ElseIf quedeuda!tabla = "establecimientos" Then
                    atributoreal = queapo!nom_est
                End If
                
                parte = quedatos!tpar
                If estaono Then
                    Sqlcreacarta = "INSERT INTO hist_cobcarta (txt_carta,fol_aut,tpar) Select replace(cob_cartacabdeta.texto,'[" & atributo & "]','" & atributoreal & "') as texto," & deuda!conteo + 1 & "+0 as fol_aut,'" & parte & "' as TPAR from cob_cartacabdeta where cob_cartacabdeta.nformato=" & quedatos!nformato & " and cob_cartacabdeta.tpar='" & parte & "'"
                    estaono = False
                Else
                   Sqlcreacarta = "UPDATE hist_cobcarta SET txt_carta=replace(txt_carta,'[" & atributo & "]',""" & atributoreal & """) where fol_aut=" & deuda!conteo + 1 & "  and tpar='" & parte & "'"
                End If
                grabarca.CommandText = Sqlcreacarta
                grabarca.Execute
                quedeuda.MoveNext
            Wend
            quedeuda.MoveFirst
            quedatos.MoveNext
             If Trim(parte) = "DET" Then
                  Sqlcreacarta = "UPDATE hist_cobcarta SET txt_carta=concat(txt_carta,'" & text_carta.Text & "') where fol_aut=" & deuda!conteo + 1 & "  and tpar='" & parte & "'"
                  grabarca.CommandText = Sqlcreacarta
                  grabarca.Execute
             End If
            estaono = True
        Wend

       
        quedeuda.Close
        quedatos.Close
        queapo.Close
        deuda.Close
        'deudore.MoveNext
        If finalfinal Then
            deudore.MoveNext
        End If
        End If
        tam = tam + 1
        Wend
        
        deudore.Close
        Set grabarca = New ADODB.Command
        grabarca.CommandType = adCmdText
        grabarca.ActiveConnection = conn
        
        grabarca.CommandText = "INSERT INTO hist_cartaimpre set fechahora='" & Format(FECHAHORAIMP, "yyyy-mm-dd hh:mm:ss") & "', accion='Generacion de Cartas desde folio" & str(INIC) & " hasta " & Trim(str(FINC)) & " para los apoderados con " & Me.MSFGcartas.Text & " Mensualidades atrasadas', responsable='" & responsable & "'"
        grabarca.Execute
        
        Me.framebarra.Visible = False
        'frmsombragen.Visible = False
End Sub

Private Sub CmbBorrar_Click()
Dim cual As Long
Dim respue As Integer

MSFGcartas.Col = 0
cual = val(MSFGcartas.Text)

respue = MsgBox("¿ Desea Realmente Eliminar el Formato Nº" & str(Trim(cual)) & " de la Carta de Cobranza ?", vbOKCancel, "Eliminación Formato")
If respue = 1 Then
    Dim borrar As ADODB.Command
    Dim consultac As ADODB.Recordset
    
    Set consultac = New ADODB.Recordset
    
    consultac.Open "Select count(*) as cuantoshay from hist_cobcartacab where nformato=" & Trim(str(cual)), conn
    
    If consultac!cuantoshay > 0 Then
        MsgBox "Es imposile borrar este formato debido a que tiene cartas vinculadas", vbExclamation, "Imposible"
    Else
        Set borrar = New ADODB.Command
        borrar.CommandText = "Delete cob_cartaformato, cob_cartacabdeta from cob_cartaformato,cob_cartacabdeta where cob_cartaformato.nformato=" & cual & " and cob_cartacabdeta.nformato=" & cual
        borrar.CommandType = adCmdText
        borrar.ActiveConnection = conn
        borrar.Execute
        MsgBox "El formato de carta " & str(Trim(cual)) & " se ha borrado", vbOKOnly, "Confirmación"
        llenarGrilla
    End If
End If
Me.MSFGcartas.ColSel = MSFGcartas.Cols - 1
End Sub

Private Sub CmbEdi_Click()
    Frame1.Enabled = False
    Frame1.Visible = False
    FrameCarta.Enabled = True
    FrameCarta.Visible = True
    MSFGcartas.Col = 0
    Call llenarybuscar(val(MSFGcartas.Text))
End Sub

Private Sub cmbImpForm_Click()
    Dim cual As Long
    Dim respue As Integer

    MSFGcartas.Col = 0
    cual = val(MSFGcartas.Text)
    '****************REPORTE DE FORMATO ******************************'
     Form_main.CrystalReport.ReportFileName = App.Path & "\rpt\reporteformato.rpt"
     Form_main.CrystalReport.WindowState = crptMaximized
     Form_main.CrystalReport.WindowTitle = "Formato de Carta de Cobranza " & str(cual)
     Form_main.CrystalReport.ReplaceSelectionFormula ("")
     Form_main.CrystalReport.ReplaceSelectionFormula ("{cob_cartaformato.NFORMATO} = " & str(cual))
     Form_main.CrystalReport.Destination = crptToWindow
     Form_main.CrystalReport.Action = 1
End Sub

Private Sub CmbNuevo_Click()
    Frame1.Enabled = False
    Frame1.Visible = False
    FrameCarta.Enabled = True
    FrameCarta.Visible = True
    text2.Text = ""
    Text3.Text = ""
    Text4.Text = ""
    
    Dim xcod As ADODB.Recordset
    Set xcod = New ADODB.Recordset
    xcod.Open "Select nformato as contar from cob_cartaformato order by nformato", conn
    If xcod.RecordCount > 0 Then
        xcod.MoveLast
        text2.Text = str(xcod!contar + 1)
    Else
        text2.Text = "1"
    End If
    
    
    xcod.Close
    Text3.SetFocus
    
    
End Sub


Private Sub Command1_Click(Index As Integer)
    FrameCarta.Enabled = False
    FrameCarta.Visible = False
    Frame1.Enabled = True
    Frame1.Visible = True
    Call llenarGrilla

    
End Sub

Private Sub Command2_Click(Index As Integer)
Dim grabar As ADODB.Recordset
Dim tpar, sqlgraba As String
Dim xpos, cualtext As Integer
If Trim(Me.Text3.Text) = "" Or Trim(Me.Text4.Text) = "" Or Trim(Me.IMCcuotas.Text) = "" Then
    MsgBox "Faltan Datos antes de guardar", vbOKOnly, "Agente validador"
    Exit Sub
End If
    
    

sqlgraba = "REPLACE into cob_cartaformato set nformato=" & text2.Text & ",titulo='" & Text3.Text & "',descripcion='" & Text4.Text & "',cond_cuotas=" & IMCcuotas.SelectedItem.Text
Set grabar = New ADODB.Recordset
grabar.Open sqlgraba, conn



For xpos = 0 To 4
    Set grabar = New ADODB.Recordset
    If xpos = 0 Then
        tpar = "CAB"
    ElseIf xpos = 1 Then
        tpar = "CUE"
    ElseIf xpos = 2 Then
        tpar = "DET"
    ElseIf xpos = 3 Then
        tpar = "POS"
    ElseIf xpos = 4 Then
        tpar = "FIN"
    End If
    sqlgraba = "REPLACE into cob_cartacabdeta set nformato=" & text2.Text & ",tpar='" & tpar & "',texto='" & TxDes(xpos).Text & "'"
    grabar.Open sqlgraba, conn
    
    
Next


cualtext = 0

End Sub

Private Sub Command3_Click(Index As Integer)
    If Trim(RetornaCampo("CFG", "valor", "param='CODBC'", conn)) = "LIN001" Then
        Form_main.CrystalReport.ReportFileName = App.Path & "\rpt\cob_cartadecobranza_ln.rpt"
    Else
        Form_main.CrystalReport.ReportFileName = App.Path & "\rpt\cob_cartadecobranza.rpt"
    End If
    Form_main.CrystalReport.WindowState = crptMaximized
    Form_main.CrystalReport.WindowTitle = "Cartas de Aviso de Atraso"
    Form_main.CrystalReport.ReplaceSelectionFormula ("")
    Form_main.CrystalReport.ReplaceSelectionFormula (filtrocuales)
    If Index = 0 Then
    'MsgBox filtrocuales
        Form_main.CrystalReport.Destination = crptToWindow
    ElseIf Index = 1 Then
        Form_main.CrystalReport.Destination = crptToPrinter
    End If
    Form_main.CrystalReport.Action = 1
End Sub

Private Sub Command4_Click()
    Dim deudore As ADODB.Recordset
    Dim grabarca As ADODB.Command
    Dim finalfinal As Boolean
    Dim fechaactual As Date
    Dim agnod, mesd, t, diad, tipocarta, seguir As Integer
    Dim totaltotal, TotalAbono, n, tam As Long
    Dim estaono, upda As Boolean
    Dim cual, Sqlrescatadeuda As String
    Dim Sqldeudor As String
    Dim SqlApo As String
    Dim Sqlcreacarta As String
    Dim Sqlquedatos, RunApo, linea As String
    Dim INIC, FINC As Long
    Dim FECHAHORAIMP, responsable As String
    Dim cursoentre As String

    FECHAHORAIMP = Now()
    inicio = 0
    responsable = Nom_usu_ses
    
    Set quecole = New ADODB.Recordset
    quecole.Open "Select colegio from establecimientos, hist_cod_colegio where establecimientos.rdb = hist_cod_colegio.cod_rbd", conn
    'MsgBox quecole!Colegio
    upda = False
    
    
    'text_carta.Visible = True
    finalfinal = False
    estaono = True
    fechaactual = Format(Date, "dd-mm-YYYY")
    
    agnod = Anno
    mesd = Month(fechaactual)
    diad = Day(fechaactual)
    
    Set quedatos = New ADODB.Recordset
    quedatos.Open "Select date_format(current_Date(),'%d-%m-%Y') as fecha", conn
       
    If fechaactual <> quedatos!Fecha Then
        MsgBox "La Fecha de la Estación de Trabajo no coincide con la del servidor", vbCritical, "Monitor de Fechas"
        quedatos.Close
        Exit Sub
    End If
    
    seguir = MsgBox("Recalcular Afectará solo las Estadísticas hasta la presente fecha, y borrará los calculos anteriores," & vbCrLf & "           ¿ Esta seguro que desea continuar?", vbYesNo, "Calculos Estadísticos")
    If seguir = 7 Then
        Exit Sub
    Else
        Set deudore = New ADODB.Recordset
'        deudore.Open "Delete from hist_deudaxcurxmes where mes=" & Trim(str(mesd - 1)) & " and agno=" & Trim(str(agnod)), conn
    deudore.Open "Delete from hist_deudaxcurxmes where agno=" & Trim(str(agnod)), conn
    
        
    End If
   
    Set deudore = New ADODB.Recordset
    'deudore.Open "Select distinct run_alu,fnza_detalle_mensualidad.mes,fnza_detalle_mensualidad.agno, monto_tot_cuota as monto_totales, concat(alu_x_cur.cod_ens,alu_x_cur.num_gra,alu_x_cur.let_cur) as codcom from fnza_detalle_mensualidad,postulantes,alu_x_cur where fnza_detalle_mensualidad.mes<=" & Trim(str(mesd)) & " and (estado_dtll='impg' or estado_dtll='abon') and  postulantes.ci_alu=run_alu and postulantes.ci_alu=alu_x_cur.ci_alu and date_format(fec_cam,'%d-%m-%Y')='11-11-1111' and (fnza_detalle_mensualidad.monto_tot_cuota-fnza_detalle_mensualidad.monto_abono) <> 0  order by mes,agno", conn
    deudore.Open "Select distinct fnza_mensualidad.folio_mens,fnza_detalle_mensualidad.run_alu " & _
        ",fnza_detalle_mensualidad.mes,fnza_detalle_mensualidad.agno,fnza_detalle_mensualidad.monto_tot_cuota as monto_totales" & _
        ",fnza_detalle_mensualidad.monto_abono, concat(alu_x_cur.cod_ens,alu_x_cur.num_gra,alu_x_cur.let_cur) as codcom " & _
        "from fnza_mensualidad,fnza_detalle_mensualidad,postulantes,alu_x_cur,matriculas " & _
           "where fnza_mensualidad.folio_mens=fnza_detalle_mensualidad.folio_mens" & _
                " and fnza_detalle_mensualidad.colegio='" & quecole!colegio & "'" & _
                " and fnza_detalle_mensualidad.mes<" & Trim(str(mesd)) & _
                " and fnza_detalle_mensualidad.agno=" & Trim(str(agnod)) & _
                " and fnza_mensualidad.agno=fnza_detalle_mensualidad.agno " & _
                " and postulantes.ci_alu=run_alu" & _
                " and postulantes.ci_alu=alu_x_cur.ci_alu" & _
                " and run_alu=matriculas.ci_alu" & _
                " and matriculas.anno_mat=" & Trim(str(agnod)) & _
                " and matriculas.ind_cheq=0 and matriculas.ind_beca=0 and matriculas.ind_cont=0" & _
                " and matriculas.cod_ens=alu_x_cur.cod_ens" & _
                " and matriculas.num_gra=alu_x_cur.num_gra" & _
                " and matriculas.anno_mat=alu_x_cur.agno" & _
                " and matriculas.activo_alu='SI'" & _
                " and matriculas.fec_mat=alu_x_cur.fec_mat" & _
                " and date_format(fec_cam,'%d-%m-%Y')='11-11-1111'" & _
                " order by mes,agno", conn
    ' Sqlrescatadeuda = "Select Distinct mes,fnza_detalle_mensualidad.agno,monto_abono,rpad(concat(ape_pat_alu,' ',ape_mat_alu,' ',LEFT(nom_alu,5)),21,"" "") as nomb_alu,monto_tot_cuota as monto_totales, concat(alu_x_cur.cod_ens,alu_x_cur.num_gra,alu_x_cur.let_cur) as codcom from fnza_detalle_mensualidad,postulantes,alu_x_cur,matriculas where fnza_detalle_mensualidad.mes<=" & Trim(str(mesd)) & " and folio_mens=" & Trim(str(deudore!Folio_Mens)) & " and postulantes.ci_alu=run_alu and postulantes.ci_alu=alu_x_cur.ci_alu and run_alu=matriculas.ci_alu and matriculas.anno_mat=" & Trim(str(agnod)) & " and matriculas.ind_cheq<>1 and matriculas.ind_beca<>1  and matriculas.cod_ens=alu_x_cur.cod_ens and matriculas.num_gra=alu_x_cur.num_gra and matriculas.activo_alu='SI' and matriculas.fec_mat=alu_x_cur.fec_mat and date_format(fec_cam,'%d-%m-%Y')='11-11-1111' order by mes,agno"
  
    Me.framebarra.Caption = "CALCULANDO"
    Me.framebarra.Visible = True
    Me.probar_gencarta.Min = 1
    Me.probar_gencarta.Max = deudore.RecordCount
    Me.Refresh
    While Not deudore.EOF
            
            Set grabarca = New ADODB.Command
            grabarca.ActiveConnection = conn
            grabarca.CommandType = adCmdText
            grabarca.CommandText = "insert into hist_deudaxcurxmes set codenl='" & deudore!codcom & "', mes=" & Trim(str(mesd)) & ",agno=" & Trim(str(agnod)) & ", mesata=" & Trim(str(deudore!mes)) & ",deuda=" & Trim(str(deudore!monto_totales - deudore!monto_abono)) & " ON DUPLICATE KEY UPDATE deuda=deuda +" & Trim(str(deudore!monto_totales - deudore!monto_abono))
            grabarca.Execute
            deudore.MoveNext
            t = t + 1
            Me.probar_gencarta.Value = t
    Wend
    
    deudore.Close
    
    Me.framebarra.Caption = "Generando Cartas"
    Me.framebarra.Visible = False
    
End Sub
Private Sub Command5_Click()
    Load Form_Est_deuda
    Form_Est_deuda.Show
End Sub

Private Sub Command6_Click()
    Dim asno As Integer
    asno = MsgBox("Desea Crear Todas las cartas para este mes", vbYesNo, "Cartas de Cobranza")
    If asno = 7 Then
        Exit Sub
    End If
    
    Dim I As Integer
    
    For I = 1 To Me.MSFGcartas.Rows - 1
        Me.MSFGcartas.Row = I
        Me.MSFGcartas.Col = 0
        Me.MSFGcartas.ColSel = Me.MSFGcartas.Cols - 1
        cmb_generar_Click
        Me.MSFGcartas.ColSel = Me.MSFGcartas.Cols - 1
    Next
    Me.MSFGcartas.ColSel = Me.MSFGcartas.Cols - 1
End Sub

Private Sub Form_Activate()
    Dim validafecha As ADODB.Recordset
    Set validafecha = New ADODB.Recordset
    validafecha.Open "select date_format(curdate(),'%d-%m-%Y') as fechaactual", conn
    If Trim(Date) <> Trim(validafecha!fechaactual) Then
        MsgBox "Tiene que cambiar la fecha por una actual, verifique su fecha en el computador", vbCritical, "Error de fechas"
        Unload Me
        Exit Sub
    End If
End Sub

Private Sub Form_Load()

    Call fmtgrilla
    Call llenarGrilla
    Call llenacombocampos
    Call llenarstatus
    llenacombocuotas 0
    granconsulta = ""
    filtrocant = ""
    filtrofec1 = ""
    filtrofec2 = ""
    filtrorut = ""
    filtrodeuda = ""
    
    Me.Show
End Sub
Private Sub llenarGrilla()
Dim cartas As ADODB.Recordset
Dim X As Integer
X = 1
Set cartas = New ADODB.Recordset

cartas.Open "Select * from cob_cartaformato order by nformato", conn

If cartas.RecordCount = 0 Then
    Text1(0).Visible = True
    Text1(1).Visible = True
    CmbEdi.Enabled = False
    CmbBorrar.Enabled = False
ElseIf cartas.RecordCount > 0 Then
    'Text1(0).Visible = False
    Text1(1).Visible = False
    CmbEdi.Enabled = True
    CmbBorrar.Enabled = True
    Me.cmbImpForm.Enabled = True
    

    With MSFGcartas
    .Rows = cartas.RecordCount + 1
    While Not cartas.EOF
        .Row = X
        .Col = 0
        .Text = cartas!nformato
        .Col = 1
        .Text = cartas!titulo
        .Col = 2
        .Text = cartas!descripcion
        .Col = 3
        .Text = cartas!cond_cuotas
        X = X + 1
        cartas.MoveNext
    Wend
    End With
End If
cartas.Close
End Sub

Private Sub fmtgrilla()

With MSFGcartas
.Rows = 1

    .Row = 0
    .ColWidth(0) = 700
    .ColWidth(1) = 2400
    .ColWidth(2) = 3980
    .ColWidth(3) = 1490
    
    .Col = 0
    .CellFontBold = True
    .Text = "Codigo"
    .Col = 1
    .CellFontBold = True
    .Text = "Titulo"
    .Col = 2
    .CellFontBold = True
    .Text = "Descripción"
    .Col = 3
    .CellFontBold = True
    .Text = "Condición Cuotas"
End With
End Sub
Private Sub llenacombocampos()
Dim I As Integer
Dim campos As ADODB.Recordset

I = 1

Set campos = New ADODB.Recordset
campos.Open "Select * from cob_labels", conn

While Not campos.EOF
    IMClabel(0).ComboItems.Add I, campos!Label, campos!descripcion
    IMClabel(1).ComboItems.Add I, campos!Label, campos!descripcion
    IMClabel(2).ComboItems.Add I, campos!Label, campos!descripcion
    IMClabel(3).ComboItems.Add I, campos!Label, campos!descripcion
    IMClabel(4).ComboItems.Add I, campos!Label, campos!descripcion
    I = I + 1
    campos.MoveNext
Wend

campos.Close

End Sub



Private Sub imcagno_Click()
    curragno = imcagno.Text
    formatgrill
    formatgrill1
End Sub

Private Sub IMClabel_Click(Index As Integer)
 TxDes(Index).Text = TxDes(Index).Text & "[" & IMClabel(Index).SelectedItem.Key & "]"

End Sub

Private Sub llenarstatus()
Dim status As ADODB.Recordset
Dim X As Integer
X = 0
Set status = New ADODB.Recordset
status.Open "Select * from cob_tpar_descripcion order by posicion", conn

While Not status.EOF
    Label3(X).Caption = status!descripcion
    status.MoveNext
    X = X + 1
Wend
status.Close
End Sub

Private Sub llenacombocuotas(sele As Integer)
IMCcuotas.Locked = True
Dim xcuo As Integer
xcuo = 1
For xcuo = 1 To 24
    IMCcuotas.ComboItems.Add xcuo, , xcuo
Next
If sele > 0 And sele < 25 Then
    Set IMCcuotas.SelectedItem = IMCcuotas.ComboItems.Item(sele)
End If
End Sub

Private Sub llenarybuscar(nf As Integer)
Dim llena As ADODB.Recordset
Dim marcar, donde As Integer

donde = 0
Set llena = New ADODB.Recordset

llena.Open "select * from cob_cartaformato where nformato=" & str(nf), conn

text2.Text = llena!nformato
Text3.Text = llena!titulo
Text4.Text = llena!descripcion
marcar = llena!cond_cuotas
 
llena.Close

llenacombocuotas (marcar)
 
Set llena = New ADODB.Recordset

llena.Open "Select * from cob_cartacabdeta where nformato=" & str(nf), conn

While Not llena.EOF
    If llena!tpar = "CAB" Then
        donde = 0
    ElseIf llena!tpar = "CUE" Then
        donde = 1
    ElseIf llena!tpar = "DET" Then
        donde = 2
    ElseIf llena!tpar = "POS" Then
        donde = 3
    ElseIf llena!tpar = "FIN" Then
        donde = 4
    End If
    TxDes(donde).Text = llena!texto
    llena.MoveNext
Wend

llena.Close


End Sub

Private Sub llenarcmbimgsql(cmbi As ImageCombo, constr As String)
    Dim tablaconsulta As ADODB.Recordset
    Dim contador As Integer
    cmbi.ComboItems.Clear
    contador = 0
    
    Set tablaconsulta = New ADODB.Recordset

    tablaconsulta.Open constr, conn
    contador = 1
    cmbi.ComboItems.Clear
   While Not tablaconsulta.EOF
        
        cmbi.ComboItems.Add contador, , tablaconsulta!texto
        contador = contador + 1
        tablaconsulta.MoveNext
    Wend
    tablaconsulta.Close
    If cmbi.ComboItems.count > 0 Then Set cmbi.SelectedItem = cmbi.ComboItems.Item(1)
End Sub

Private Sub formatgrill()
Dim xconsql As ADODB.Recordset
Dim pone As Integer
pone = 1
filtrocuales = ""
With Me.msfgcobra
     .Rows = 1
     .Row = 0
     .Col = 0
     .Text = "Folio"
     .CellFontBold = True
     .ColWidth(0) = 850
     .Col = 1
     .Text = "Formato"
     .CellFontBold = True
     .ColWidth(1) = 850
     .Col = 2
     .Text = "Rut Deudor"
     .CellFontBold = True
     .ColWidth(2) = 1000
     .Col = 3
     .Text = "Apellidos Nombre"
     .CellFontBold = True
     .ColWidth(3) = 3150
     .Col = 4
     .Text = "Deuda"
     .CellFontBold = True
     .ColWidth(4) = 1000
     .Col = 5
     .Text = "A la fecha"
     .CellFontBold = True
     .ColWidth(5) = 1268
     
    Set xconsql = New ADODB.Recordset
    xconsql.Open "Select hist_cobcartacab.fol_aut,hist_cobcartacab.rut_apo,concat(apoderados.ape1_apo,' ',apoderados.noms_apo) as apodera , hist_cobcartacab.nformato, hist_cobcartacab.total_deuda, date_format(hist_cobcartacab.fec_gen,'%d-%m-%Y') as fec_gen from hist_cobcartacab join apoderados where hist_cobcartacab.rut_apo=apoderados.rut_apo and month(fec_gen)=" & currmes & " and year(fec_gen)=" & curragno & " and left(cursoentrega,3)='" & CURRENS & "' and mid(cursoentrega,4,2)='" & CURRCUR & "'", conn
    .Rows = xconsql.RecordCount + 1
    While Not xconsql.EOF
        .Row = pone
        .Col = 0
        .Text = xconsql!fol_aut
        filtrocuales = filtrocuales & "{hist_cobcartacab.FOL_AUT} = " & Trim(xconsql!fol_aut) & " or "
        .Col = 1
        .Text = xconsql!nformato
        .Col = 2
        .Text = xconsql!rut_apo
        .Col = 3
        .Text = xconsql!apodera
        .Col = 4
        .Text = xconsql!total_deuda
        .Col = 5
        .Text = xconsql!fec_gen
        pone = pone + 1
        xconsql.MoveNext
    Wend
  End With
  If Len(filtrocuales) > 0 Then filtrocuales = Left(filtrocuales, Len(filtrocuales) - 3)
  xconsql.Close
End Sub
Private Sub formatgrill1()
Dim xconsql As ADODB.Recordset
Dim pone As Integer

pone = 1
With Me.mgcur
     .Rows = 1
     .Row = 0
     .Col = 0
     .Text = "Codens"
     .ColWidth(0) = 0
     .Col = 1
     .Text = "Enseñanza"
     .CellFontBold = True
     .ColWidth(1) = 1050
     .Col = 2
     .Text = "Curso"
     .CellFontBold = True
     .ColWidth(1) = 850
     .Col = 3
     .Text = "Mes"
     .CellFontBold = True
     .ColWidth(2) = 1000
     .Col = 4
     .Text = "Año"
     .CellFontBold = True
     .ColWidth(2) = 1000
    End With
     
    Set xconsql = New ADODB.Recordset
    xconsql.Open "Select left(cursoentrega,3) as cod_ens, concat(mid(cursoentrega,4,1),'º',mid(cursoentrega,5,1)) as curso, month(fec_gen) as mes,year(fec_gen) as agno from hist_cobcartacab where month(fec_gen)=" & currmes & " and year(fec_gen)=" & curragno & " group by cod_ens,curso,mes,agno order by 1,2,3,4", conn
    
    If xconsql.RecordCount > 0 Then
    With Me.mgcur
    .Rows = xconsql.RecordCount + 1
    While Not xconsql.EOF
        .Row = pone
        .Col = 0
        If Trim(xconsql!Cod_Ens) = "" Then
            .Text = "NODEF"
        Else
            .Text = xconsql!Cod_Ens
        End If
        .Col = 1
        If Trim(xconsql!Cod_Ens = "") Then
            .Text = "INDEFINIDO"
        ElseIf Trim(xconsql!Cod_Ens = "310") Then
            .Text = "Media"
        ElseIf Trim(xconsql!Cod_Ens = "110") Then
            .Text = "Basica"
        ElseIf Trim(xconsql!Cod_Ens) = "010" Then
            .Text = "Parvularia"
        ElseIf Trim(xconsql!Cod_Ens) = "996" Then
            .Text = "PreKinder"
        End If
        .Col = 2
        .Text = xconsql!curso
        .Col = 3
        .Text = xconsql!mes
        .Col = 4
        .Text = xconsql!agno
        xconsql.MoveNext
        pone = pone + 1
    Wend
  End With
  xconsql.MoveFirst
  CURRENS = xconsql!Cod_Ens
  xconsql.Close
  End If
End Sub


Private Sub imcmes_Click()
    currmes = imcmes.Text
    formatgrill1
    formatgrill
End Sub

Private Sub mgcur_Click()
    mgcur.Col = 0
    CURRENS = Trim(mgcur.Text)
    mgcur.Col = 2
    CURRCUR = Left(Trim(mgcur.Text), 1) & Right(Trim(mgcur.Text), 1)
    If CURRENS = "NODEF" Then CURRENS = ""
    If CURRCUR = "ºº" Then CURRCUR = ""
    formatgrill
    mgcur.Col = 0
    mgcur.ColSel = mgcur.Cols - 1

End Sub

Private Sub MSFGcartas_Click()
    MSFGcartas.ColSel = MSFGcartas.Cols - 1
End Sub

Private Sub msfgcobra_DblClick()
    Dim Actual As String
    msfgcobra.Col = 0
    Actual = Trim(msfgcobra.Text)
    LimpiaFormulas Form_main.CrystalReport, 30
    If Trim(RetornaCampo("CFG", "valor", "param='CODBC'", conn)) = "LIN001" Then
        Form_main.CrystalReport.ReportFileName = App.Path & "\rpt\cob_cartadecobranza_ln.rpt"
    Else
        Form_main.CrystalReport.ReportFileName = App.Path & "\rpt\cob_cartadecobranza.rpt"
    End If
   Form_main.CrystalReport.WindowState = crptMaximized
   Form_main.CrystalReport.WindowTitle = "Cartas de Aviso de Atraso"
   Form_main.CrystalReport.ReplaceSelectionFormula ("")
   Form_main.CrystalReport.ReplaceSelectionFormula ("{hist_cobcartacab.FOL_AUT}=" & Actual)
   Form_main.CrystalReport.Destination = crptToWindow
   Form_main.CrystalReport.Action = 1
   msfgcobra.ColSel = msfgcobra.Cols - 1
End Sub

