VERSION 5.00
Object = "{BDC217C8-ED16-11CD-956C-0000C04E4C0A}#1.1#0"; "TABCTL32.OCX"
Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "mscomctl.ocx"
Begin VB.Form Form_avisos 
   BorderStyle     =   3  'Fixed Dialog
   Caption         =   "Formato de Avisos para Apoderados Reservados y no Contestados"
   ClientHeight    =   6255
   ClientLeft      =   45
   ClientTop       =   330
   ClientWidth     =   9135
   Icon            =   "Form_avisos.frx":0000
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MDIChild        =   -1  'True
   MinButton       =   0   'False
   ScaleHeight     =   6255
   ScaleWidth      =   9135
   ShowInTaskbar   =   0   'False
   Begin VB.Frame Frame2 
      Height          =   2535
      Left            =   2640
      TabIndex        =   12
      Top             =   1680
      Width           =   4215
      Begin VB.CommandButton Command3 
         Caption         =   "&Aceptar"
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   495
         Left            =   1320
         TabIndex        =   16
         Top             =   1800
         Width           =   1455
      End
      Begin VB.OptionButton Option2 
         Caption         =   "Apoderados No Matriculados Proximo 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            =   360
         TabIndex        =   15
         Top             =   1200
         Width           =   3375
      End
      Begin VB.OptionButton Option1 
         Caption         =   "Apoderados Para Reserva"
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   255
         Left            =   360
         TabIndex        =   14
         Top             =   840
         Value           =   -1  'True
         Width           =   3375
      End
      Begin VB.Label Label1 
         Alignment       =   2  'Center
         Caption         =   "Seleccion de Tipo de Carta de Aviso"
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H00800000&
         Height          =   375
         Left            =   120
         TabIndex        =   13
         Top             =   360
         Width           =   3975
      End
   End
   Begin VB.CommandButton Command2 
      Caption         =   "&Cancelar"
      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          =   495
      Left            =   4920
      TabIndex        =   11
      Top             =   5640
      Width           =   1935
   End
   Begin VB.CommandButton Command1 
      Caption         =   "&Aceptar"
      Enabled         =   0   'False
      BeginProperty Font 
         Name            =   "Arial"
         Size            =   8.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   495
      Left            =   2760
      TabIndex        =   10
      Top             =   5640
      Width           =   1935
   End
   Begin TabDlg.SSTab SSTab1 
      Height          =   5295
      Left            =   120
      TabIndex        =   0
      Top             =   120
      Width           =   8895
      _ExtentX        =   15690
      _ExtentY        =   9340
      _Version        =   393216
      Tab             =   1
      TabHeight       =   520
      Enabled         =   0   'False
      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)   =   "Encabezado"
      TabPicture(0)   =   "Form_avisos.frx":2A8B2
      Tab(0).ControlEnabled=   0   'False
      Tab(0).Control(0)=   "lbl1(0)"
      Tab(0).Control(0).Enabled=   0   'False
      Tab(0).Control(1)=   "textbox(0)"
      Tab(0).Control(1).Enabled=   0   'False
      Tab(0).Control(2)=   "IMC(0)"
      Tab(0).Control(2).Enabled=   0   'False
      Tab(0).ControlCount=   3
      TabCaption(1)   =   "Texto"
      TabPicture(1)   =   "Form_avisos.frx":2A8CE
      Tab(1).ControlEnabled=   -1  'True
      Tab(1).Control(0)=   "lbl1(1)"
      Tab(1).Control(0).Enabled=   0   'False
      Tab(1).Control(1)=   "IMC(1)"
      Tab(1).Control(1).Enabled=   0   'False
      Tab(1).Control(2)=   "textbox(1)"
      Tab(1).Control(2).Enabled=   0   'False
      Tab(1).ControlCount=   3
      TabCaption(2)   =   "Pie"
      TabPicture(2)   =   "Form_avisos.frx":2A8EA
      Tab(2).ControlEnabled=   0   'False
      Tab(2).Control(0)=   "lbl1(3)"
      Tab(2).Control(0).Enabled=   0   'False
      Tab(2).Control(1)=   "IMC(3)"
      Tab(2).Control(1).Enabled=   0   'False
      Tab(2).Control(2)=   "textbox(3)"
      Tab(2).Control(2).Enabled=   0   'False
      Tab(2).ControlCount=   3
      Begin MSComctlLib.ImageCombo IMC 
         Height          =   345
         Index           =   0
         Left            =   -71280
         TabIndex        =   5
         Top             =   4560
         Width           =   2655
         _ExtentX        =   4683
         _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
      End
      Begin VB.TextBox textbox 
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   3735
         Index           =   3
         Left            =   -74760
         MultiLine       =   -1  'True
         TabIndex        =   3
         Top             =   600
         Width           =   8415
      End
      Begin VB.TextBox textbox 
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   3735
         Index           =   1
         Left            =   240
         MultiLine       =   -1  'True
         TabIndex        =   2
         Top             =   600
         Width           =   8415
      End
      Begin VB.TextBox textbox 
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   3735
         Index           =   0
         Left            =   -74760
         MultiLine       =   -1  'True
         TabIndex        =   1
         Top             =   600
         Width           =   8415
      End
      Begin MSComctlLib.ImageCombo IMC 
         Height          =   345
         Index           =   1
         Left            =   3720
         TabIndex        =   7
         Top             =   4560
         Width           =   2655
         _ExtentX        =   4683
         _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
      End
      Begin MSComctlLib.ImageCombo IMC 
         Height          =   345
         Index           =   3
         Left            =   -71280
         TabIndex        =   9
         Top             =   4560
         Width           =   2655
         _ExtentX        =   4683
         _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
      End
      Begin VB.Label lbl1 
         Caption         =   "Insertar Campo:"
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   255
         Index           =   3
         Left            =   -72840
         TabIndex        =   8
         Top             =   4680
         Width           =   1455
      End
      Begin VB.Label lbl1 
         Caption         =   "Insertar Campo:"
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   255
         Index           =   1
         Left            =   2160
         TabIndex        =   6
         Top             =   4680
         Width           =   1455
      End
      Begin VB.Label lbl1 
         Caption         =   "Insertar Campo:"
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   255
         Index           =   0
         Left            =   -72840
         TabIndex        =   4
         Top             =   4680
         Width           =   1455
      End
   End
End
Attribute VB_Name = "Form_avisos"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim cualdb As String
Private Sub llenacombocampos()
Dim i As Integer
Dim campos As ADODB.Recordset

i = 1

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

While Not campos.EOF
    IMC(0).ComboItems.Add i, campos!Label, campos!descripcion
    IMC(1).ComboItems.Add i, campos!Label, campos!descripcion
    IMC(3).ComboItems.Add i, campos!Label, campos!descripcion
    i = i + 1
    campos.MoveNext
Wend

campos.Close

End Sub

Private Sub Command1_Click()
Dim grabarfor As ADODB.Recordset

Set grabarfor = New ADODB.Recordset
grabarfor.Open "Update " & cualdb & " set texto='" & Me.textbox(0).Text & "' where tipo='ENCAB'", conn
grabarfor.Open "Update " & cualdb & " set texto='" & Me.textbox(1).Text & "' where tipo='TEXTO'", conn
grabarfor.Open "Update " & cualdb & " set texto='" & Me.textbox(3).Text & "' where tipo='PIE'", conn

End Sub

Private Sub Command2_Click()
    Unload Me
    
End Sub

Private Sub Command3_Click()
cualdb = ""
If Me.Option1.Value = True Then
    cualdb = "aviso_formato"
ElseIf Me.Option2.Value = True Then
    cualdb = "avisotros_formato"
End If
Dim llenartxt As ADODB.Recordset

Set llenartxt = New ADODB.Recordset
llenartxt.Open "select * from " & cualdb & " order by orden", conn

While Not llenartxt.EOF
    textbox(llenartxt!Orden).Text = llenartxt!texto
    llenartxt.MoveNext
Wend
llenartxt.Close
Me.SSTab1.Enabled = True
Me.Command1.Enabled = True
Me.Command2.Enabled = True
'Me.Frame1.Visible = False
Me.Frame2.Visible = False
Me.Refresh
End Sub

Private Sub Form_Load()
llenacombocampos
Me.Show
End Sub

Private Sub IMC_Change(Index As Integer)
 textbox(Index).Text = textbox(Index).Text & IMC(Index).SelectedItem.Key
End Sub

Private Sub IMC_Click(Index As Integer)
 textbox(Index).Text = textbox(Index).Text & IMC(Index).SelectedItem.Key
End Sub

