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.0#0"; "mscomctl.ocx"
Begin VB.Form Form_DesaPerSoc_Eval 
   BorderStyle     =   1  'Fixed Single
   Caption         =   "Evaluacion del Alumno"
   ClientHeight    =   7050
   ClientLeft      =   45
   ClientTop       =   330
   ClientWidth     =   10050
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MDIChild        =   -1  'True
   MinButton       =   0   'False
   ScaleHeight     =   7050
   ScaleWidth      =   10050
   Begin VB.Frame frmpregunta 
      Caption         =   "Periodos"
      BeginProperty Font 
         Name            =   "Arial"
         Size            =   8.25
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H00C00000&
      Height          =   1455
      Left            =   2880
      TabIndex        =   60
      Top             =   3480
      Visible         =   0   'False
      Width           =   4095
      Begin VB.ComboBox Combo1 
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   330
         ItemData        =   "Form_DesaPerSoc_Eval.frx":0000
         Left            =   120
         List            =   "Form_DesaPerSoc_Eval.frx":000A
         TabIndex        =   63
         Top             =   600
         Width           =   1935
      End
      Begin VB.CommandButton Command11 
         Caption         =   "Vista Preliminar"
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   495
         Left            =   2160
         TabIndex        =   62
         Top             =   240
         Width           =   1815
      End
      Begin VB.CommandButton Command12 
         Caption         =   "&Cancelar"
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   495
         Left            =   2160
         TabIndex        =   61
         Top             =   840
         Width           =   1815
      End
   End
   Begin VB.Frame Frame_Obs 
      Caption         =   "Observaciones Para el Alumno"
      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          =   2415
      Left            =   1080
      TabIndex        =   55
      Top             =   3000
      Visible         =   0   'False
      Width           =   7935
      Begin VB.TextBox text_Obs 
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   1335
         Left            =   240
         MaxLength       =   200
         MultiLine       =   -1  'True
         TabIndex        =   57
         Top             =   360
         Width           =   7455
      End
      Begin VB.CommandButton Command9 
         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            =   3000
         TabIndex        =   56
         Top             =   1800
         Width           =   1695
      End
   End
   Begin VB.Frame Frame_pregunta 
      Enabled         =   0   'False
      Height          =   2535
      Left            =   2160
      TabIndex        =   26
      Top             =   3000
      Visible         =   0   'False
      Width           =   5535
      Begin MSComctlLib.ImageCombo ICRes 
         Height          =   345
         Left            =   2160
         TabIndex        =   33
         Top             =   1440
         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
         Locked          =   -1  'True
      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            =   2160
         TabIndex        =   32
         Top             =   2040
         Visible         =   0   'False
         Width           =   375
      End
      Begin VB.CommandButton Command5 
         Caption         =   "Cancelar"
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   495
         Left            =   3840
         TabIndex        =   28
         Top             =   1920
         Width           =   1575
      End
      Begin VB.CommandButton Command4 
         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
         Index           =   0
         Left            =   240
         TabIndex        =   27
         Top             =   1920
         Width           =   1455
      End
      Begin VB.Label Pregunta 
         BackColor       =   &H80000005&
         BorderStyle     =   1  'Fixed Single
         Caption         =   "Pregunta Item"
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   1095
         Left            =   240
         TabIndex        =   29
         Top             =   240
         Width           =   5055
      End
      Begin VB.Label Respuesta_Label 
         Caption         =   "Respuesta:"
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   255
         Left            =   600
         TabIndex        =   34
         Top             =   1440
         Width           =   1335
      End
   End
   Begin VB.Frame Frame1 
      Caption         =   "Cursos Activos del Profesor"
      BeginProperty Font 
         Name            =   "Arial"
         Size            =   8.25
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H00C00000&
      Height          =   1695
      Left            =   120
      TabIndex        =   0
      Top             =   120
      Width           =   9735
      Begin MSFlexGridLib.MSFlexGrid MSFlexGrid1 
         Height          =   1335
         Left            =   120
         TabIndex        =   1
         Top             =   240
         Width           =   9495
         _ExtentX        =   16748
         _ExtentY        =   2355
         _Version        =   393216
         Cols            =   6
         FixedCols       =   0
         BackColorSel    =   16761024
         ForeColorSel    =   -2147483641
         TextStyleFixed  =   3
         HighLight       =   2
         FillStyle       =   1
         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 Frame2 
      Caption         =   "Alumnos del Curso Actual"
      BeginProperty Font 
         Name            =   "Arial"
         Size            =   8.25
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H00C00000&
      Height          =   5055
      Left            =   120
      TabIndex        =   2
      Top             =   1800
      Width           =   9735
      Begin VB.CommandButton Command10 
         Caption         =   "&Ver Historial"
         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            =   8160
         Picture         =   "Form_DesaPerSoc_Eval.frx":0028
         Style           =   1  'Graphical
         TabIndex        =   59
         Top             =   2040
         Visible         =   0   'False
         Width           =   1335
      End
      Begin VB.CommandButton Command1 
         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
         Left            =   8160
         Picture         =   "Form_DesaPerSoc_Eval.frx":0656
         Style           =   1  'Graphical
         TabIndex        =   36
         Top             =   3000
         Width           =   1335
      End
      Begin VB.CommandButton Command2 
         Caption         =   "&Ir alumno"
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   735
         Left            =   8160
         Picture         =   "Form_DesaPerSoc_Eval.frx":0BB3
         Style           =   1  'Graphical
         TabIndex        =   5
         Top             =   1080
         Width           =   1335
      End
      Begin MSFlexGridLib.MSFlexGrid MSFlexGrid2 
         Height          =   4455
         Left            =   120
         TabIndex        =   3
         Top             =   360
         Width           =   7935
         _ExtentX        =   13996
         _ExtentY        =   7858
         _Version        =   393216
         Cols            =   8
         FixedCols       =   0
         BackColorSel    =   16761024
         ForeColorSel    =   -2147483640
         TextStyleFixed  =   3
         FocusRect       =   2
         FillStyle       =   1
         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 Frame4 
      Caption         =   "Evaluación"
      BeginProperty Font 
         Name            =   "Arial"
         Size            =   8.25
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H00C00000&
      Height          =   5055
      Left            =   120
      TabIndex        =   37
      Top             =   1800
      Visible         =   0   'False
      Width           =   9735
      Begin TabDlg.SSTab SSTab1 
         Height          =   4695
         Left            =   120
         TabIndex        =   38
         Top             =   240
         Width           =   9255
         _ExtentX        =   16325
         _ExtentY        =   8281
         _Version        =   393216
         Tabs            =   4
         TabsPerRow      =   4
         TabHeight       =   520
         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)   =   "Tab 0"
         TabPicture(0)   =   "Form_DesaPerSoc_Eval.frx":1183
         Tab(0).ControlEnabled=   -1  'True
         Tab(0).Control(0)=   "Command6(0)"
         Tab(0).Control(0).Enabled=   0   'False
         Tab(0).Control(1)=   "msflexpre(0)"
         Tab(0).Control(1).Enabled=   0   'False
         Tab(0).Control(2)=   "Command8(0)"
         Tab(0).Control(2).Enabled=   0   'False
         Tab(0).Control(3)=   "Command7(0)"
         Tab(0).Control(3).Enabled=   0   'False
         Tab(0).ControlCount=   4
         TabCaption(1)   =   "Tab 1"
         TabPicture(1)   =   "Form_DesaPerSoc_Eval.frx":119F
         Tab(1).ControlEnabled=   0   'False
         Tab(1).Control(0)=   "msflexpre(1)"
         Tab(1).Control(0).Enabled=   0   'False
         Tab(1).Control(1)=   "Command6(1)"
         Tab(1).Control(1).Enabled=   0   'False
         Tab(1).Control(2)=   "Command7(1)"
         Tab(1).Control(2).Enabled=   0   'False
         Tab(1).Control(3)=   "Command8(1)"
         Tab(1).Control(3).Enabled=   0   'False
         Tab(1).ControlCount=   4
         TabCaption(2)   =   "Tab 2"
         TabPicture(2)   =   "Form_DesaPerSoc_Eval.frx":11BB
         Tab(2).ControlEnabled=   0   'False
         Tab(2).Control(0)=   "msflexpre(2)"
         Tab(2).Control(0).Enabled=   0   'False
         Tab(2).Control(1)=   "Command6(2)"
         Tab(2).Control(1).Enabled=   0   'False
         Tab(2).Control(2)=   "Command7(2)"
         Tab(2).Control(2).Enabled=   0   'False
         Tab(2).Control(3)=   "Command8(2)"
         Tab(2).Control(3).Enabled=   0   'False
         Tab(2).ControlCount=   4
         TabCaption(3)   =   "Tab 3"
         TabPicture(3)   =   "Form_DesaPerSoc_Eval.frx":11D7
         Tab(3).ControlEnabled=   0   'False
         Tab(3).Control(0)=   "msflexpre(3)"
         Tab(3).Control(0).Enabled=   0   'False
         Tab(3).Control(1)=   "Command6(3)"
         Tab(3).Control(1).Enabled=   0   'False
         Tab(3).Control(2)=   "Command7(3)"
         Tab(3).Control(2).Enabled=   0   'False
         Tab(3).Control(3)=   "Command8(3)"
         Tab(3).Control(3).Enabled=   0   'False
         Tab(3).ControlCount=   4
         Begin VB.CommandButton Command7 
            Caption         =   "&Cancelar Todo"
            Height          =   975
            Index           =   0
            Left            =   3840
            Picture         =   "Form_DesaPerSoc_Eval.frx":11F3
            Style           =   1  'Graphical
            TabIndex        =   49
            Top             =   3600
            Width           =   1695
         End
         Begin VB.CommandButton Command8 
            Caption         =   "Volver"
            BeginProperty Font 
               Name            =   "Arial"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   975
            Index           =   0
            Left            =   7320
            Picture         =   "Form_DesaPerSoc_Eval.frx":1635
            Style           =   1  'Graphical
            TabIndex        =   48
            Top             =   3600
            Width           =   1695
         End
         Begin VB.CommandButton Command8 
            Caption         =   "Volver"
            Height          =   975
            Index           =   1
            Left            =   -67680
            Picture         =   "Form_DesaPerSoc_Eval.frx":1C05
            Style           =   1  'Graphical
            TabIndex        =   47
            Top             =   3720
            Width           =   1695
         End
         Begin VB.CommandButton Command7 
            Caption         =   "&Cancelar Todo los Datos Ingresados"
            Height          =   975
            Index           =   1
            Left            =   -71160
            Picture         =   "Form_DesaPerSoc_Eval.frx":2137
            Style           =   1  'Graphical
            TabIndex        =   46
            Top             =   3720
            Width           =   1695
         End
         Begin VB.CommandButton Command6 
            Caption         =   "&Guardar Informe del Alumno"
            Height          =   975
            Index           =   1
            Left            =   -74880
            Picture         =   "Form_DesaPerSoc_Eval.frx":2579
            Style           =   1  'Graphical
            TabIndex        =   45
            Top             =   3720
            Width           =   1695
         End
         Begin VB.CommandButton Command8 
            Caption         =   "Volver"
            Height          =   975
            Index           =   2
            Left            =   -67680
            Picture         =   "Form_DesaPerSoc_Eval.frx":2883
            Style           =   1  'Graphical
            TabIndex        =   44
            Top             =   3720
            Width           =   1695
         End
         Begin VB.CommandButton Command7 
            Caption         =   "&Cancelar Todo los Datos Ingresados"
            Height          =   975
            Index           =   2
            Left            =   -71160
            Picture         =   "Form_DesaPerSoc_Eval.frx":2DB5
            Style           =   1  'Graphical
            TabIndex        =   43
            Top             =   3720
            Width           =   1695
         End
         Begin VB.CommandButton Command6 
            Caption         =   "&Guardar Informe del Alumno"
            Height          =   975
            Index           =   2
            Left            =   -74880
            Picture         =   "Form_DesaPerSoc_Eval.frx":31F7
            Style           =   1  'Graphical
            TabIndex        =   42
            Top             =   3720
            Width           =   1695
         End
         Begin VB.CommandButton Command8 
            Caption         =   "Volver"
            Height          =   735
            Index           =   3
            Left            =   -68400
            Picture         =   "Form_DesaPerSoc_Eval.frx":3501
            Style           =   1  'Graphical
            TabIndex        =   41
            Top             =   3840
            Width           =   2415
         End
         Begin VB.CommandButton Command7 
            Caption         =   "&Cancelar Todo los Datos Ingresados"
            Height          =   735
            Index           =   3
            Left            =   -71760
            Picture         =   "Form_DesaPerSoc_Eval.frx":3A33
            Style           =   1  'Graphical
            TabIndex        =   40
            Top             =   3840
            Width           =   2775
         End
         Begin VB.CommandButton Command6 
            Caption         =   "&Guardar Informe del Alumno"
            Height          =   735
            Index           =   3
            Left            =   -74880
            Picture         =   "Form_DesaPerSoc_Eval.frx":3E75
            Style           =   1  'Graphical
            TabIndex        =   39
            Top             =   3840
            Width           =   2415
         End
         Begin MSFlexGridLib.MSFlexGrid msflexpre 
            Height          =   3015
            Index           =   0
            Left            =   120
            TabIndex        =   51
            Top             =   600
            Width           =   8895
            _ExtentX        =   15690
            _ExtentY        =   5318
            _Version        =   393216
            Rows            =   5
            Cols            =   7
            FixedCols       =   0
            BackColor       =   12648447
            BackColorSel    =   16761024
            ForeColorSel    =   -2147483641
            AllowBigSelection=   0   'False
            FocusRect       =   2
            SelectionMode   =   1
            AllowUserResizing=   2
            BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
               Name            =   "Arial"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
         End
         Begin MSFlexGridLib.MSFlexGrid msflexpre 
            Height          =   3015
            Index           =   1
            Left            =   -74880
            TabIndex        =   52
            Top             =   600
            Width           =   8895
            _ExtentX        =   15690
            _ExtentY        =   5318
            _Version        =   393216
            Rows            =   5
            Cols            =   7
            FixedCols       =   0
            BackColor       =   12648447
            BackColorSel    =   16761024
            ForeColorSel    =   -2147483641
            AllowBigSelection=   0   'False
            FocusRect       =   2
            ScrollBars      =   2
            SelectionMode   =   1
            AllowUserResizing=   2
            BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
               Name            =   "Arial"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
         End
         Begin MSFlexGridLib.MSFlexGrid msflexpre 
            Height          =   3015
            Index           =   2
            Left            =   -74880
            TabIndex        =   53
            Top             =   600
            Width           =   8895
            _ExtentX        =   15690
            _ExtentY        =   5318
            _Version        =   393216
            Rows            =   5
            Cols            =   7
            FixedCols       =   0
            BackColor       =   12648447
            BackColorSel    =   16761024
            ForeColorSel    =   -2147483641
            AllowBigSelection=   0   'False
            FocusRect       =   2
            ScrollBars      =   2
            SelectionMode   =   1
            AllowUserResizing=   2
            BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
               Name            =   "Arial"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
         End
         Begin MSFlexGridLib.MSFlexGrid msflexpre 
            Height          =   3015
            Index           =   3
            Left            =   -74880
            TabIndex        =   54
            Top             =   600
            Width           =   8895
            _ExtentX        =   15690
            _ExtentY        =   5318
            _Version        =   393216
            Rows            =   5
            Cols            =   7
            FixedCols       =   0
            BackColor       =   12648447
            BackColorSel    =   16761024
            ForeColorSel    =   -2147483641
            AllowBigSelection=   0   'False
            FocusRect       =   2
            ScrollBars      =   2
            SelectionMode   =   1
            AllowUserResizing=   2
            BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
               Name            =   "Arial"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
         End
         Begin VB.CommandButton Command6 
            Caption         =   "&Guardar Informe"
            Height          =   735
            Index           =   0
            Left            =   2280
            Picture         =   "Form_DesaPerSoc_Eval.frx":417F
            Style           =   1  'Graphical
            TabIndex        =   50
            Top             =   3720
            Width           =   1455
         End
      End
   End
   Begin VB.Frame Frame3 
      Caption         =   "Datos del Informe de Desarrollo Personal y Social"
      BeginProperty Font 
         Name            =   "Arial"
         Size            =   8.25
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H00C00000&
      Height          =   6735
      Left            =   120
      TabIndex        =   4
      Top             =   120
      Width           =   9735
      Begin VB.CommandButton comimpre2 
         Caption         =   "&Imprimir Juntos"
         Height          =   735
         Left            =   4560
         Picture         =   "Form_DesaPerSoc_Eval.frx":4489
         Style           =   1  'Graphical
         TabIndex        =   64
         Top             =   5640
         Width           =   1335
      End
      Begin VB.CommandButton Command3 
         Caption         =   "&Volver"
         Height          =   735
         Index           =   3
         Left            =   7920
         Picture         =   "Form_DesaPerSoc_Eval.frx":49E6
         Style           =   1  'Graphical
         TabIndex        =   25
         Top             =   5640
         Width           =   1335
      End
      Begin VB.CommandButton Command3 
         Caption         =   "&Imprimir"
         Height          =   735
         Index           =   2
         Left            =   3120
         Picture         =   "Form_DesaPerSoc_Eval.frx":4FB6
         Style           =   1  'Graphical
         TabIndex        =   24
         Top             =   5640
         Width           =   1335
      End
      Begin VB.CommandButton Command3 
         Caption         =   "&Modificar"
         Height          =   735
         Index           =   1
         Left            =   1680
         Picture         =   "Form_DesaPerSoc_Eval.frx":5513
         Style           =   1  'Graphical
         TabIndex        =   23
         Top             =   5640
         Width           =   1335
      End
      Begin VB.TextBox Text1 
         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
         Index           =   8
         Left            =   8760
         TabIndex        =   22
         Text            =   "letra"
         Top             =   1200
         Visible         =   0   'False
         Width           =   615
      End
      Begin VB.TextBox Text1 
         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
         Index           =   7
         Left            =   7680
         TabIndex        =   21
         Text            =   "num_gra"
         Top             =   1200
         Visible         =   0   'False
         Width           =   1095
      End
      Begin VB.TextBox Text1 
         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
         Index           =   6
         Left            =   3240
         TabIndex        =   20
         Top             =   1200
         Width           =   735
      End
      Begin VB.TextBox Text1 
         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
         Index           =   5
         Left            =   4680
         TabIndex        =   18
         Top             =   1200
         Width           =   1095
      End
      Begin VB.TextBox Text1 
         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
         Index           =   4
         Left            =   7680
         TabIndex        =   16
         Top             =   840
         Width           =   1695
      End
      Begin VB.TextBox Text1 
         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
         Index           =   3
         Left            =   1680
         TabIndex        =   14
         Top             =   840
         Width           =   4095
      End
      Begin VB.CommandButton Command3 
         Caption         =   "&Informe"
         Height          =   735
         Index           =   0
         Left            =   240
         Picture         =   "Form_DesaPerSoc_Eval.frx":5AF9
         Style           =   1  'Graphical
         TabIndex        =   13
         Top             =   5640
         Width           =   1335
      End
      Begin VB.TextBox Text1 
         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
         Index           =   0
         Left            =   1680
         TabIndex        =   9
         Top             =   480
         Width           =   4095
      End
      Begin VB.TextBox Text1 
         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
         Index           =   1
         Left            =   7680
         TabIndex        =   8
         Top             =   480
         Width           =   1695
      End
      Begin VB.TextBox Text1 
         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
         Index           =   2
         Left            =   1680
         TabIndex        =   7
         Top             =   1200
         Width           =   735
      End
      Begin VB.CommandButton Command3 
         Caption         =   "A&probar"
         Height          =   735
         Index           =   4
         Left            =   6480
         Picture         =   "Form_DesaPerSoc_Eval.frx":6073
         Style           =   1  'Graphical
         TabIndex        =   35
         Top             =   5640
         Width           =   1335
      End
      Begin MSFlexGridLib.MSFlexGrid MSFlexGrid3 
         Height          =   3855
         Left            =   240
         TabIndex        =   6
         Top             =   1680
         Width           =   9015
         _ExtentX        =   15901
         _ExtentY        =   6800
         _Version        =   393216
         Cols            =   5
         FixedCols       =   0
         BackColorSel    =   16761024
         ForeColorSel    =   -2147483640
         FillStyle       =   1
         ScrollBars      =   2
         SelectionMode   =   1
      End
      Begin VB.Label Label1 
         AutoSize        =   -1  'True
         Caption         =   "Codigo:"
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   210
         Index           =   7
         Left            =   2640
         TabIndex        =   58
         Top             =   1200
         Width           =   540
      End
      Begin VB.Label Label1 
         AutoSize        =   -1  'True
         Caption         =   "Folio:"
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   210
         Index           =   6
         Left            =   6240
         TabIndex        =   31
         Top             =   1200
         Width           =   375
      End
      Begin VB.Label Label_NFolio 
         BackColor       =   &H80000005&
         BorderStyle     =   1  'Fixed Single
         BeginProperty Font 
            Name            =   "MS Sans Serif"
            Size            =   8.25
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   255
         Left            =   7680
         TabIndex        =   30
         Top             =   1200
         Width           =   1695
      End
      Begin VB.Label Label1 
         AutoSize        =   -1  'True
         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          =   210
         Index           =   5
         Left            =   4200
         TabIndex        =   19
         Top             =   1200
         Width           =   345
      End
      Begin VB.Label Label1 
         Caption         =   "RUT  Profesor:"
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   255
         Index           =   4
         Left            =   6240
         TabIndex        =   17
         Top             =   840
         Width           =   1455
      End
      Begin VB.Label Label1 
         Caption         =   "Nombre Profesor:"
         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            =   240
         TabIndex        =   15
         Top             =   840
         Width           =   1335
      End
      Begin VB.Label Label1 
         Caption         =   "Nombre Alumno:"
         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            =   240
         TabIndex        =   12
         Top             =   480
         Width           =   1335
      End
      Begin VB.Label Label1 
         Caption         =   "RUT  Alumno:"
         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            =   6240
         TabIndex        =   11
         Top             =   480
         Width           =   1455
      End
      Begin VB.Label Label1 
         AutoSize        =   -1  'True
         Caption         =   "Curso:"
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   210
         Index           =   2
         Left            =   1080
         TabIndex        =   10
         Top             =   1200
         Width           =   480
      End
   End
End
Attribute VB_Name = "Form_DesaPerSoc_Eval"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private cualprofe As String
Private cualcodens As String
Private cualnumgra As String
Private cualletra As String
Private periodo As Integer
Private Edi As Boolean
Private modificar As Boolean

Private Sub comimpre2_Click()
Dim crertmp As ADODB.Command
Dim ci_alu, curso As String
Dim xfol As Long
Dim xcod As String
Dim AF As String
Dim BF As String
Dim xnum As Integer
Dim textobs As String
Dim pre As Boolean


Set crertmp = New ADODB.Command
crertmp.ActiveConnection = conn
crertmp.CommandType = adCmdText
crertmp.CommandText = "CREATE TABLE if not exists`tmp_desapersoc` (" & _
    "`CI_ALU` varchar(10) NOT NULL default ''," & _
    "`CODNUMLET` varchar(5) NOT NULL default ''," & _
    "`T_ITEM` char(3) NOT NULL default ''," & _
    "`N_ITEM` tinyint(4) NOT NULL default '0'," & _
    "`SEMESTRE1` varchar(5) default NULL," & _
    "`SEMESTRE2` varchar(5) default NULL," & _
    "`RUT_PROF` varchar(10) NOT NULL default ''," & _
    "`AGNO` year(4) NOT NULL default '0000'," & _
    "PRIMARY KEY  (`CI_ALU`,`CODNUMLET`,`T_ITEM`,`N_ITEM`)" & _
    ") ENGINE=MyISAM"
    
 crertmp.Execute
 
 
 textos = ""
 MSFlexGrid3.Col = 3
 
 For i = 1 To MSFlexGrid3.Rows - 1
    MSFlexGrid3.Row = i
    textobs = textobs & MSFlexGrid3.Text & " "
 Next
 pre = True
 xcod = Text1(6).Text
 xnum = Val(Text1(7).Text)
 MSFlexGrid3.Col = 0
 nfol = Val(MSFlexGrid3.Text)
 MSFlexGrid3.Col = 2
 agnotext = Text1(5).Text
 nrowact = MSFlexGrid3.Row
 MSFlexGrid3.Row = 1
 MSFlexGrid3.Col = 2
 


 
rutalum = Me.Text1(1).Text
rutprof = Me.Text1(4).Text
agnoinf = Me.Text1(5).Text
codnumlet = Trim(Me.Text1(6).Text & Me.Text1(7) & Me.Text1(8))




If Me.MSFlexGrid3.Rows = 2 Then
    MSFlexGrid3.Row = 1
    MSFlexGrid3.Col = 2
    
    If MSFlexGrid3.Text = "Cerrado" Then
        pre = False
    End If
    
    MSFlexGrid3.Col = 0
    
    AF = Me.MSFlexGrid3.Text
    BF = 0
    crearinf Me.Text1(1).Text, Trim(Me.Text1(6).Text & Me.Text1(7) & Me.Text1(8)), Me.Text1(4).Text, Val(Me.Text1(5).Text), AF, BF, 2
Else
    MSFlexGrid3.Row = 1
    MSFlexGrid3.Col = 2
    
    If MSFlexGrid3.Text = "Cerrado" Then
        pre = False
    End If
    
    MSFlexGrid3.Col = 0
    AF = MSFlexGrid3.Text
    
    
    Me.MSFlexGrid3.Row = 2
    MSFlexGrid3.Col = 2
    
    If MSFlexGrid3.Text = "Cerrado" Then
        pre = False
    End If
    
    Me.MSFlexGrid3.Col = 0
    BF = MSFlexGrid3.Text
    
    crearinf Me.Text1(1).Text, Trim(Me.Text1(6).Text & Me.Text1(7) & Me.Text1(8)), Me.Text1(4).Text, Val(Me.Text1(5).Text), BF, AF, 3
End If

If pre Then
    texto = "PRELIMINAR"
End If

If xcod = "310" Then
    Call LimpiaFormulas(Form_main.CrystalReport, 30)
    Form_main.CrystalReport.ReportFileName = App.Path & "\rpt\personlidad310.rpt"
    Form_main.CrystalReport.WindowState = crptMaximized
    Form_main.CrystalReport.WindowTitle = "Informe De Desarrollo Personal y Social"
    Form_main.CrystalReport.Formulas(2) = "obs ='" & textobs & "'"
    Form_main.CrystalReport.Formulas(5) = "pre ='" & texto & "'"
    Form_main.CrystalReport.ReplaceSelectionFormula ("")
    Form_main.CrystalReport.ReplaceSelectionFormula ("{tmp_desapersoc.ci_alu}='" & Text1(1).Text & "'")
    Form_main.CrystalReport.Destination = crptToWindow
    Form_main.CrystalReport.Action = 1
End If
If xcod = "110" And str(Trim(Text1(7).Text)) < 5 Then
    Call LimpiaFormulas(Form_main.CrystalReport, 30)
    Form_main.CrystalReport.ReportFileName = App.Path & "\rpt\personlidad11014.rpt"
    Form_main.CrystalReport.WindowState = crptMaximized
    Form_main.CrystalReport.WindowTitle = "Informe De Desarrollo Personal y Social"
    Form_main.CrystalReport.Formulas(2) = "obs ='" & textobs & "'"
    Form_main.CrystalReport.Formulas(5) = "pre ='" & texto & "'"
    Form_main.CrystalReport.ReplaceSelectionFormula ("")
    Form_main.CrystalReport.ReplaceSelectionFormula ("{tmp_desapersoc.ci_alu}='" & Text1(1).Text & "'")
    Form_main.CrystalReport.Destination = crptToWindow
    Form_main.CrystalReport.Action = 1
ElseIf xcod = "110" And str(Trim(Text1(7).Text)) > 4 Then
    Call LimpiaFormulas(Form_main.CrystalReport, 30)
    Form_main.CrystalReport.ReportFileName = App.Path & "\rpt\personlidad11058.rpt"
    Form_main.CrystalReport.WindowState = crptMaximized
    Form_main.CrystalReport.WindowTitle = "Informe De Desarrollo Personal y Social"
    Form_main.CrystalReport.Formulas(2) = "obs ='" & textobs & "'"
    Form_main.CrystalReport.Formulas(5) = "pre ='" & texto & "'"
    Form_main.CrystalReport.ReplaceSelectionFormula ("")
    Form_main.CrystalReport.ReplaceSelectionFormula ("{tmp_desapersoc.ci_alu}='" & Text1(1).Text & "'")
    Form_main.CrystalReport.Destination = crptToWindow
    Form_main.CrystalReport.Action = 1
End If

End Sub

Private Sub Command1_Click()
    Dim xagno, xrespuesta As Integer
    Dim xnum_gra, xcod, xletra As String
    Frame2.Enabled = False
    Frame1.Enabled = False
    
    'xrespuesta = MsgBox("Esta a punto de ver todos los informes del todo el Curso", vbOKCancel, "Informe Desarrollo Personal Curso")
    
    Me.frmpregunta.Visible = True
    Me.frmpregunta.Enabled = True
        
End Sub

Private Sub Command11_Click()
    Dim Per As String
    Per = ""
    If Me.Combo1.ListIndex = 0 Then
        Per = " and {desaper_cab.periodo}=1 "
    ElseIf Me.Combo1.ListIndex = 1 Then
        Per = " and {desaper_cab.periodo}=2 "
    End If
    
        MSFlexGrid2.Col = 0
        xcod = MSFlexGrid2.Text
        MSFlexGrid2.Col = 1
        xnum_gra = MSFlexGrid2.Text
        MSFlexGrid2.Col = 2
        xletra = MSFlexGrid2.Text
        xagno = Year(Date)
        'MsgBox xcod & " " & xnum_gra & " " & xletra
        If xcod = "110" And Val(xnum_gra) < 5 Then
             '************************IMPRESION DE INFORME PARA ALUMNOS DE NB1-NB2-NB3-NB4*******************
            Form_main.CrystalReport.ReportFileName = App.Path & "\rpt\informe_desaper110.rpt"
            Form_main.CrystalReport.WindowState = crptMaximized
            Form_main.CrystalReport.WindowTitle = "Informe De Desarrollo Personal y Social"
            Form_main.CrystalReport.ReplaceSelectionFormula ("")
            Form_main.CrystalReport.ReplaceSelectionFormula ("{desaper_cab.cod_ens}='" & xcod & "' and {desaper_cab.num_gra}='" & xnum_gra & "' and {desaper_cab.let_cur}='" & xletra & "' and {desaper_cab.agno}=" & str(xagno)) & Per
            Form_main.CrystalReport.Destination = crptToWindow
            Form_main.CrystalReport.Action = 1
        '************************FIN IMPRESION DE INFORME PARA ALUMNOS DE NB1-NB2-NB3-NB4
        ElseIf xcod = "110" And Val(xnum_gra) > 4 Then
        '************************IMPRESION DE INFORME PARA ALUMNOS DE NB5-NB6-NB7-NB8*******************
            Form_main.CrystalReport.ReportFileName = App.Path & "\rpt\informe_desaper1108.rpt"
            Form_main.CrystalReport.WindowState = crptMaximized
            Form_main.CrystalReport.WindowTitle = "Informe De Desarrollo Personal y Social"
            Form_main.CrystalReport.ReplaceSelectionFormula ("")
            Form_main.CrystalReport.ReplaceSelectionFormula ("{desaper_cab.cod_ens}='" & xcod & "' and {desaper_cab.num_gra}='" & xnum_gra & "' and {desaper_cab.let_cur}='" & xletra & "' and {desaper_cab.agno}=" & str(xagno)) & Per
            Form_main.CrystalReport.Destination = crptToWindow
            Form_main.CrystalReport.Action = 1
        '************************FIN IMPRESION DE INFORME PARA ALUMNOS DE NB5-NB6-NB7-NB8*******************
        ElseIf xcod = "310" Then
        '************************IMPRESION DE INFORME PARA ALUMNOS DE NM1 - NM2 - NM3 ******************
            Form_main.CrystalReport.ReportFileName = App.Path & "\rpt\informe_desaper310.rpt"
            Form_main.CrystalReport.WindowState = crptMaximized
            Form_main.CrystalReport.WindowTitle = "Informe De Desarrollo Personal y Social"
            Form_main.CrystalReport.ReplaceSelectionFormula ("")
            Form_main.CrystalReport.ReplaceSelectionFormula ("{desaper_cab.cod_ens}='" & xcod & "' and {desaper_cab.num_gra}='" & xnum_gra & "' and {desaper_cab.let_cur}='" & xletra & "' and {desaper_cab.agno}=" & str(xagno)) & Per
            Form_main.CrystalReport.Destination = crptToWindow
            Form_main.CrystalReport.Action = 1
        '************************FIN IMPRESION DE INFORME PARA ALUMNOS DE NM1 - NM2 - NM3 ******************
            
        End If
 
        
End Sub

Private Sub Command12_Click()
    Me.frmpregunta.Visible = False
    Me.frmpregunta.Enabled = False
    Me.Frame1.Enabled = True
    Me.Frame2.Enabled = True
End Sub

Private Sub Command2_Click()
    Frame1.Visible = False
    Frame2.Visible = False
    Frame3.Visible = True
    Command3(0).Enabled = True
    llenargrillacab
    
End Sub

Private Sub Command3_Click(Index As Integer)
modificar = False
    If Index = 0 Then
        Frame4.Enabled = True
        Frame4.Visible = True
        Frame3.Enabled = False
        Frame3.Refresh
        Edi = False
        llenartodas
    ElseIf Index = 2 Then
        Dim xcod As String
        Dim xnum As Integer
        Dim xfol As Long
        xcod = Text1(6).Text
        xnum = Val(Text1(7).Text)
        MSFlexGrid3.Col = 0
        nfol = Val(MSFlexGrid3.Text)
        Call LimpiaFormulas(Form_main.CrystalReport, 30)
        If xcod = "110" And xnum < 5 Then
        '************************IMPRESION DE INFORME PARA ALUMNOS DE NB1-NB2-NB3-NB4*******************
            Form_main.CrystalReport.ReportFileName = App.Path & "\rpt\informe_desaper110.rpt"
            Form_main.CrystalReport.WindowState = crptMaximized
            Form_main.CrystalReport.WindowTitle = "Informe De Desarrollo Personal y Social"
            Form_main.CrystalReport.ReplaceSelectionFormula ("")
            Form_main.CrystalReport.ReplaceSelectionFormula ("{desaper_cab.folio_persoc}=" & str(nfol))
            Form_main.CrystalReport.Destination = crptToWindow
            Form_main.CrystalReport.Action = 1
        '************************FIN IMPRESION DE INFORME PARA ALUMNOS DE NB1-NB2-NB3-NB4
        ElseIf xcod = "110" And xnum > 4 Then
        '************************IMPRESION DE INFORME PARA ALUMNOS DE NB5-NB6-NB7-NB8*******************
            Form_main.CrystalReport.ReportFileName = App.Path & "\rpt\informe_desaper1108.rpt"
            Form_main.CrystalReport.WindowState = crptMaximized
            Form_main.CrystalReport.WindowTitle = "Informe De Desarrollo Personal y Social"
            Form_main.CrystalReport.ReplaceSelectionFormula ("")
            Form_main.CrystalReport.ReplaceSelectionFormula ("{desaper_cab.folio_persoc}=" & str(nfol))
            Form_main.CrystalReport.Destination = crptToWindow
            Form_main.CrystalReport.Action = 1
        '************************FIN IMPRESION DE INFORME PARA ALUMNOS DE NB5-NB6-NB7-NB8*******************
        ElseIf xcod = "310" Then
        '************************IMPRESION DE INFORME PARA ALUMNOS DE NM1 - NM2 - NM3 ******************
            Form_main.CrystalReport.ReportFileName = App.Path & "\rpt\informe_desaper310.rpt"
            Form_main.CrystalReport.WindowState = crptMaximized
            Form_main.CrystalReport.WindowTitle = "Informe De Desarrollo Personal y Social"
            Form_main.CrystalReport.ReplaceSelectionFormula ("")
            Form_main.CrystalReport.ReplaceSelectionFormula ("{desaper_cab.folio_persoc}=" & str(nfol))
            Form_main.CrystalReport.Destination = crptToWindow
            Form_main.CrystalReport.Action = 1
        '************************FIN IMPRESION DE INFORME PARA ALUMNOS DE NM1 - NM2 - NM3 ******************
            
        End If
    
    ElseIf Index = 3 Then
        Frame3.Visible = False
        Frame2.Visible = True
        Frame1.Visible = True
        msflexpre(0).Rows = 1
        msflexpre(1).Rows = 1
        msflexpre(2).Rows = 1
        msflexpre(3).Rows = 1
        ICRes.ComboItems.Clear
        For i = 0 To 8
            Text1(i).Text = ""
            periodo = 0
        Next i
        MSFlexGrid3.Rows = 1
    ElseIf Index = 1 Then
        MSFlexGrid3.Col = 2
        modificar = True
        If MSFlexGrid3.Text = "Cerrado" Then
            MsgBox "Informe Cerrado, imposible de modificar", vbCritical, "Imposible"
        Else
        
            Frame4.Visible = True
            Frame4.Enabled = True
            Frame3.Refresh
            MSFlexGrid3.Col = 0
            Label_NFolio.Caption = str(MSFlexGrid3.Text)
            If Text1(6).Text = "310" Then
                llenartodo msflexpre(0), "FE", 0
                llenartodo msflexpre(1), "ACP", 1
                llenartodo msflexpre(2), "DP", 2
                llenartodo msflexpre(3), "RPE", 3
            Else
                llenartodo msflexpre(0), "FE", 0
                llenartodo msflexpre(1), "ACP", 1
                llenartodo msflexpre(2), "RPE", 2
                llenartodo msflexpre(3), "CFC", 3
            End If
            Edi = True
            MSFlexGrid3.Col = 1
            periodo = Val(MSFlexGrid3.Text)
            MSFlexGrid3.Col = 3
            text_Obs.Text = MSFlexGrid3.Text
        End If
    ElseIf Index = 4 Then
        Frame4.Enabled = False
        Dim respuesta As Integer
        
        respuesta = MsgBox("La aprobación final hará que el informe no pueda ser modicado posteriormente " & Chr(13) & Chr(10) & "¿Esta Seguro de Aprobar el Informe ? ", vbOKCancel, "Aprobacion Final y Cierre")
        If respuesta = 1 Then
            Dim buscaryaprobar As ADODB.Recordset
            
            MSFlexGrid3.Col = 0
            nfol = Val(MSFlexGrid3.Text)
            
            Set buscaryaprobar = New ADODB.Recordset
            
            buscaryaprobar.Open "Select count(*) as verific from desaper_item_deta where folio_persoc=" & str(nfol) & " and valor=' '", conn
            If buscaryaprobar!verific > 0 Then
                MsgBox "Quedan elementos que evaluar en el informe, por favor complete los datos", vbExclamation, "Verificacion Fallida"
                buscaryaprobar.Close
            Else
                MsgBox "El informe ha sido verificado y aprobado", vbMsgBoxRight, "Aprobaciön"
                MSFlexGrid3.Col = 2
                MSFlexGrid3.Text = "Cerrado"
                buscaryaprobar.Close
                Set buscaryaprobar = New ADODB.Recordset
                buscaryaprobar.Open "Update desaper_cab set ESTADO='C' where FOLIO_PERSOC=" & str(nfol), conn
                
                
            End If
       
        End If
            
        Frame4.Enabled = True
    End If
End Sub

Private Sub Command4_Click(Index As Integer)
    msflexpre(Val(Text2.Text)).Col = 4
    msflexpre(Val(Text2.Text)).Text = ICRes.SelectedItem.Text
    msflexpre(Val(Text2.Text)).Col = 6
    msflexpre(Val(Text2.Text)).Text = ICRes.SelectedItem.Key
    Command5_Click
    
End Sub

Private Sub Command5_Click()
    Frame4.Enabled = True ' activa el Frame con las preguntas
    Frame_pregunta.Visible = False
    Frame_pregunta.Enabled = False
    msflexpre(Val(Text2.Text)).Col = 0
    msflexpre(Val(Text2.Text)).ColSel = msflexpre(Val(Text2.Text)).Cols - 1
    
End Sub

Private Sub Command6_Click(Index As Integer)
    Dim guardarinforme As ADODB.Command
    Dim guardardetalles As ADODB.Recordset
    
    Dim sqldetalles, sqlguarda As String
    Dim cambio1, cambio2 As String
    Dim X, fila, limiteg As Integer
    Dim sqlcuenta As ADODB.Recordset
    
    
    If modificar = True Then
        sqlguarda = "REPLACE INTO desaper_cab (FOLIO_PERSOC,PERIODO,ESTADO,CI_ALU,RUT_PROF,COD_ENS,NUM_GRA,LET_CUR,AGNO,OBSERVACIONES) Values "
    Else
        Set sqlcuenta = New ADODB.Recordset
        sqlcuenta.Open "Select count(*) as total from desaper_cab", conn
        Label_NFolio.Caption = sqlcuenta!total
        sqlguarda = "INSERT INTO desaper_cab (FOLIO_PERSOC,PERIODO,ESTADO,CI_ALU,RUT_PROF,COD_ENS,NUM_GRA,LET_CUR,AGNO,OBSERVACIONES) Values "
    End If

    sqlguarda = sqlguarda & "(" & Trim(Label_NFolio.Caption) & "," & str(periodo) & ",'A','" & Text1(1).Text & "','" & Text1(4).Text & "','" & Text1(6).Text & "','"
    sqlguarda = sqlguarda & Text1(7).Text & "','" & Text1(8).Text & "'," & Trim(Text1(5).Text) & ",'O')"
    
    Set guardarinforme = New ADODB.Command
    guardarinforme.CommandType = adCmdText
    guardarinforme.ActiveConnection = conn
    guardarinforme.CommandText = sqlguarda
    
    For X = 0 To 3
        With msflexpre(X)
        limiteg = .Rows
        Set guardardetalles = New ADODB.Recordset
        
        For fila = 1 To limiteg - 1
            .Row = fila
            .Col = 5
            cambio1 = .Text
            .Col = 6
            cambio2 = .Text
            If cambio1 <> cambio2 Then
                sqldetalles = "Replace INTO desaper_item_deta (FOLIO_PERSOC,T_ITEM,N_ITEM,VALOR) VALUES (" & Trim(Label_NFolio.Caption) & ","
                .Col = 1
                sqldetalles = sqldetalles & "'" & .Text & "',"
                .Col = 2
                sqldetalles = sqldetalles & .Text & ","
                .Col = 6
                sqldetalles = sqldetalles & "'" & .Text & "')"
                guardardetalles.Open sqldetalles, conn
            ElseIf cambio2 = " " And cambio1 = " " Then
                sqldetalles = "Replace INTO desaper_item_deta (FOLIO_PERSOC,T_ITEM,N_ITEM,VALOR) VALUES (" & Trim(Label_NFolio.Caption) & ","
                .Col = 1
                sqldetalles = sqldetalles & "'" & .Text & "',"
                .Col = 2
                sqldetalles = sqldetalles & .Text & ","
                .Col = 6
                sqldetalles = sqldetalles & "'" & .Text & "')"
                guardardetalles.Open sqldetalles, conn
            ElseIf Edi Then
                If cambio1 = cambio2 Then
                    sqldetalles = ""
                Else
                    sqldetalles = "Replace INTO desaper_item_deta (FOLIO_PERSOC,T_ITEM,N_ITEM,VALOR) VALUES (" & Trim(Label_NFolio.Caption) & ","
                    .Col = 1
                    sqldetalles = sqldetalles & "'" & .Text & "',"
                    .Col = 2
                    sqldetalles = sqldetalles & .Text & ","
                    .Col = 6
                    sqldetalles = sqldetalles & "'" & .Text & "')"
                    guardardetalles.Open sqldetalles, conn
                End If
            End If
            'MsgBox sqldetalles
        Next
        End With
    Next
    guardarinforme.Execute
    Frame3.Enabled = True
    Frame3.Visible = True
    Frame4.Enabled = False
    Frame_Obs.Enabled = True
    Frame_Obs.Visible = True
    text_Obs.SetFocus
    
End Sub

Private Sub Command7_Click(Index As Integer)
    Frame4.Visible = False
    Frame4.Refresh
    Frame3.Enabled = True
    Frame3.Visible = True
    Me.Refresh
    msflexpre(0).Rows = 1
    msflexpre(1).Rows = 1
    msflexpre(2).Rows = 1
    msflexpre(3).Rows = 1
    Edi = False
    ICRes.ComboItems.Clear
    
End Sub

Private Sub Command8_Click(Index As Integer)
    Frame4.Refresh
    Frame4.Visible = False
    Frame3.Enabled = True
    Frame3.Visible = True
    msflexpre(0).Rows = 1
    msflexpre(1).Rows = 1
    msflexpre(2).Rows = 1
    msflexpre(3).Rows = 1
    Me.Refresh
    Edi = False
    ICRes.ComboItems.Clear
    llenargrillacab
        
End Sub

Private Sub Command9_Click()
    Dim obs As ADODB.Recordset
    
    Set obs = New ADODB.Recordset
    obs.Open "Update desaper_cab set OBSERVACIONES='" & text_Obs & "' where FOLIO_PERSOC=" & Label_NFolio.Caption, conn
    text_Obs.Text = ""
    Frame_Obs.Enabled = False
    Frame_Obs.Visible = False
    Command8_Click (0)
    
End Sub

Private Sub Form_Load()
    Dim session_id, sqlcon As String
    Dim cualcurso As ADODB.Recordset
    Dim sacarrut As ADODB.Recordset
    
    Edi = False
    Frame3.Visible = False
    session_id = RutGlobal
    sqlcon = "Select RUT_USU from usuarios where AUT_NOMBRE_USUARIO='" & session_id & "'"
    
    Set sacarrut = New ADODB.Recordset
    
    sacarrut.Open sqlcon, conn
    session_rut = sacarrut!RUT_USU
    sacarrut.Close
    'MsgBox (session_rut)
    
    If session_rut = "" Then
        MsgBox "El usuario no tiene RUT definido, consulte al administrador de Bases de Datos", vbOKOnly, "Sistema GesCol"
        Exit Sub
    ElseIf CodPerfil = "#ADM#" Or CodPerfil = "#UTP#" Then
        sqlcon = "Select cursos.cod_ens,cursos.num_gra,cursos.let_cur,concat(cursos.num_gra,'º',cursos.let_cur) as comple,cursos.rut_prof,concat(profesores.ape1_prof,',    ',profesores.noms_prof) as nom_pr from cursos join profesores where cursos.rut_prof=profesores.rut_prof and cursos.agno=" & Anno
    Else
        sqlcon = "Select cursos.cod_ens,cursos.num_gra,cursos.let_cur,concat(cursos.num_gra,'º',cursos.let_cur) as comple, cursos.rut_prof,concat(profesores.ape1_prof,',   ',profesores.noms_prof) as nom_pr from cursos join profesores where cursos.rut_prof='" & session_rut & "' and cursos.agno=" & Anno
    End If
    
    Set cualcurso = New ADODB.Recordset
    
    cualcurso.Open sqlcon, conn
    
    llenargrillapro MSFlexGrid1, sqlcon, cualcurso
    cualcurso.Close
    
    MSFlexGrid1_Click
    Me.frmpregunta.Visible = False
    Me.frmpregunta.Enabled = False


End Sub
Private Sub llenargrillapro(grilla As MSFlexGrid, sqlstr As String, datos As ADODB.Recordset)
    Dim limite, recorre As Integer
    
    limite = datos.RecordCount
        
    With grilla
        .Rows = limite
        .Row = 0
        .Col = 0
        .ColWidth(0) = 0
        .Col = 1
        .ColWidth(1) = 1300
        .CellFontBold = True
        .Text = "Enseñanza"
        .Col = 2
        .ColWidth(2) = 0
        .Col = 3
        .Text = "Curso"
        .CellFontBold = True
        .ColWidth(3) = 700
        .Col = 4
        .Text = "Rut Profesor"
        .CellFontBold = True
        .ColWidth(4) = 1500
        .Col = 5
        .Text = "Apellido, Nombre Profesor"
        .CellFontBold = True
        .ColWidth(5) = 3600

    End With
    
    For recorre = 1 To limite - 1
        With grilla
            .Row = recorre
            .Col = 0
            .Text = datos!Num_Gra
            .Col = 1
            .Text = datos!Cod_Ens
            .Col = 2
            .Text = datos!Let_Cur
            .Col = 3
            .Text = datos!comple
            .Col = 4
            .Text = datos!rut_prof
            .Col = 5
            .Text = datos!nom_pr
        End With
        datos.MoveNext
    Next
    grilla.Row = 1
    grilla.Col = 0
    grilla.CellBackColor = &HC0FFC0
    
End Sub
Private Sub llenargrillacursos(grilla As MSFlexGrid, datos As ADODB.Recordset)
    Dim limite, recorre As Integer
    
    limite = datos.RecordCount
    
    With grilla
        .Rows = limite
        .Row = 0
        .Col = 0
        .ColWidth(0) = 0
        .ColWidth(1) = 0
        .ColWidth(2) = 0
        .ColWidth(3) = 0
        .ColWidth(4) = 0
        .ColWidth(5) = 600
        .ColWidth(6) = 0
        .ColWidth(7) = 7000
        .Col = 5
        .CellFontBold = True
        .Text = "Curso"
        .Col = 6
        .CellFontBold = True
        .Text = "Nº"
        .CellAlignment = 1
        .Col = 7
        .Text = "Nombre Completo Alumno"
        .CellFontBold = True
    End With
    
    For recorre = 1 To limite - 1
        With grilla
            .Row = recorre
            .Col = 0
            .Text = datos!ense
            .Col = 1
            .Text = datos!grado
            .Col = 2
            .Text = datos!Letra
            .Col = 3
            .Text = datos!rutalum
            .Col = 4
            .Text = cualprofe
            .Col = 5
            .Text = datos!grado & "º" & datos!Letra
            .Col = 6
            .Text = recorre
            .Col = 7
            .Text = datos!nombrecom
        End With
        datos.MoveNext
    Next
    grilla.Row = 1
    grilla.Col = 0
    grilla.CellBackColor = &HC0FFC0
   
End Sub

Private Sub Frame3_DblClick()
    Command3_Click (1)
End Sub

Private Sub MSFlexGrid1_Click()
    Dim X As Integer
    Dim cualcurso As ADODB.Recordset
    
    X = MSFlexGrid1.Row
    MSFlexGrid1.Col = 0
    cualnumgra = MSFlexGrid1.Text
    MSFlexGrid1.Col = 1
    cualcodens = MSFlexGrid1.Text
    MSFlexGrid1.Col = 4
    cualprofe = MSFlexGrid1.Text
    MSFlexGrid1.Col = 2
    cualletra = MSFlexGrid1.Text
    MSFlexGrid1.Col = 0
    MSFlexGrid1.ColSel = MSFlexGrid1.Cols - 1
    
    sqlcon = "select alu_x_cur.cod_ens as ense, alu_x_cur.num_gra as grado, alu_x_cur.let_cur as letra, alu_x_cur.ci_alu as rutalum, concat(postulantes.ape_pat_alu,' ',postulantes.ape_mat_alu,', ',postulantes.nom_alu) as nombrecom from alu_x_cur join postulantes where alu_x_cur.cod_ens='" & cualcodens & "' and alu_x_cur.num_gra='" & cualnumgra & "' and alu_x_cur.let_cur='" & cualletra & "' and alu_x_cur.ci_alu=postulantes.ci_alu and alu_x_cur.agno=" & Anno & " order by 5"
    
    Set cualcurso = New ADODB.Recordset
    cualcurso.Open sqlcon, conn
    
    llenargrillacursos MSFlexGrid2, cualcurso
    cualcurso.Close
    
End Sub

Private Sub llenargrillacab()
    Dim cualesfichas As ADODB.Recordset
    Dim recorre As Integer
    
    With MSFlexGrid2
        .Col = 0
        Text1(6).Text = .Text
        .Col = 1
        Text1(7).Text = .Text
        .Col = 2
        Text1(8).Text = .Text
        .Col = 3
        Text1(1).Text = .Text
        .Col = 4
        Text1(4).Text = .Text
        .Col = 5
        Text1(2).Text = .Text
        .Col = 7
        Text1(0).Text = .Text
    End With
    Text1(5).Text = str(Year(Date))
    MSFlexGrid1.Col = 5
    Text1(3).Text = MSFlexGrid1.Text
    MSFlexGrid1.Col = 0
    MSFlexGrid1.ColSel = MSFlexGrid1.Cols - 1
    
    Set cualesfichas = New ADODB.Recordset
    
    sqlcon = "Select folio_persoc,periodo,estado,agno,observaciones from desaper_cab where ci_alu='" & Text1(1).Text & "' and rut_prof='" & Text1(4).Text & "' and agno=" & Anno & " order by 1"
    
    cualesfichas.Open sqlcon, conn
    With MSFlexGrid3
            .Col = 0
            .Row = 0
            .Text = "Número Folio"
            .CellFontBold = True
            .Col = 1
            .Text = "Periodo"
            .CellFontBold = True
            .Col = 2
            .Text = "Estado"
            .CellFontBold = True
            .Col = 3
            .Text = "Observaciones"
            .CellFontBold = True
            .ColWidth(0) = 1500
            .ColWidth(1) = 1000
            .ColWidth(2) = 1000
            .ColWidth(3) = 5000
            .ColWidth(4) = 0
            
    End With
    If cualesfichas.RecordCount = 0 Then
        MSFlexGrid3.Enabled = False
        Command3(1).Enabled = False
        Command3(2).Enabled = False
        Command3(0).Enabled = True
        periodo = 1
    Else
       periodo = cualesfichas.RecordCount + 1
        With MSFlexGrid3
            .Col = 0
            .Rows = cualesfichas.RecordCount + 1
            recorre = 1
            For recorre = 1 To cualesfichas.RecordCount
                .Row = recorre
                .Col = 0
                .Text = cualesfichas!folio_persoc
                .Col = 1
                .Text = cualesfichas!periodo
                .Col = 2
                If cualesfichas!Estado = "A" Then
                    .Text = "Abierto"
                Else
                    .Text = "Cerrado"
                End If
                .Col = 3
                .Text = cualesfichas!observaciones
                cualesfichas.MoveNext
            Next
                MSFlexGrid3.Enabled = True
                Command3(1).Enabled = True
                Command3(2).Enabled = True
        End With
        
        cualesfichas.Close
        Set cualesfichas = New ADODB.Recordset
        
        cualesfichas.Open "Select count(*) as numper from periodos where year(fec_ini_per)=" & Anno, conn
        If cualesfichas!numper < periodo Then
            Command3(0).Enabled = False
        Else
            Command3(0).Enabled = True
        End If
        cualesfichas.Close
    End If
    MSFlexGrid3.Enabled = True
    
    
End Sub
Private Sub MSFlexGrid1_DblClick()
    MSFlexGrid1.SetFocus
End Sub


Private Sub MSFlexGrid2_DblClick()
    Command2_Click
End Sub
Private Sub llenarpreguntasnuevas(grillapreguntas As MSFlexGrid, tItem As String, xtab As Integer)
    Dim llenar As ADODB.Recordset
    
    
    Dim sqlcon As String
    Dim recorre, limite As Integer
    
    SSTab1.Tab = xtab
    
    If tItem = "FE" Then
        SSTab1.Caption = "Formación Etica"
    ElseIf tItem = "ACP" Then
        SSTab1.Caption = "Autoafirmación y Crecimiento"
    ElseIf tItem = "RPE" Then
        SSTab1.Caption = "Relacion Persona y Entorno"
    ElseIf tItem = "CFC" Then
        SSTab1.Caption = "Compromiso Familia Comunidad"
    ElseIf tItem = "DP" Then
        SSTab1.Caption = "Desarollo Pensamiento"
    End If
    SSTab1.Tab = 0
    
    sqlcon = "Select desaper_formato_inf_agno.cod_ens, desaper_formato_inf_agno.num_gra,desaper_formato_inf_agno.t_item, desaper_formato_inf_agno.n_item, desaper_item_des.descripcion from desaper_formato_inf_agno join `desaper_item_des` where desaper_formato_inf_agno.cod_ens='" & Text1(6).Text & "' and desaper_formato_inf_agno.num_gra='" & Text1(7).Text & "' and desaper_formato_inf_agno.t_item='" & tItem & "' and desaper_formato_inf_agno.n_item=desaper_item_des.n_item and desaper_formato_inf_agno.t_item=desaper_item_des.t_item"
    Set llenar = New ADODB.Recordset
    llenar.Open sqlcon, conn
    
    limite = llenar.RecordCount
    
    grillapreguntas.Rows = limite + 1
    
    With grillapreguntas
        .Col = 0
        .Row = 0
        .Text = "Numero Folio"
        .Col = 1
        .Text = "Tipo Item"
        .Col = 2
        .Text = "N item"
        .Col = 3
        .Text = "Pregunta"
        .Col = 4
        .Text = "Valor"
        .ColWidth(0) = 0
        .ColWidth(1) = 0
        .ColWidth(2) = 0
        .ColWidth(3) = 6000
        .ColWidth(4) = 2500
        .ColWidth(5) = 0
        .ColWidth(6) = 0
        
        .Col = 0
        
        llenar.MoveFirst
    
        For recorre = 1 To limite
            .Row = recorre
            .Col = 0
            .Text = Label_NFolio.Caption
            .Col = 1
            .Text = llenar!t_item
            .Col = 2
            .Text = llenar!n_item
            .Col = 3
            .Text = llenar!descripcion
            .Col = 4
            .Text = " "
            .Col = 5
            .Text = " "
            .Col = 6
            .Text = " "
            llenar.MoveNext
            
        Next
        
    End With
    llenar.Close
End Sub
Private Sub llenartodas()
    Dim pregun As ADODB.Recordset
    Dim connfolio As ADODB.Recordset
    
    Dim ttipo, sqlcon As String
    Dim X As Integer
    Dim nfol As Integer
    
    
    Set connfolio = New ADODB.Recordset
    connfolio.Open "select count(*) as totals from desaper_cab where agno=" & Anno, conn
    
    nfol = connfolio!totals + 1
    connfolio.Close
    
    Label_NFolio.Caption = str(nfol)
    Set pregun = New ADODB.Recordset
    sqlcon = "Select t_item from desaper_formato_inf_agno where cod_ens='" & Text1(6).Text & "' and num_gra='" & Text1(7).Text & "' group by t_item"
    
    pregun.Open sqlcon, conn
    
    'pregun.MoveFirst
    
    If Text1(6).Text = "310" Then
     For X = 0 To 3
            ttipo = pregun!t_item
            If ttipo = "FE" Then
                llenarpreguntasnuevas msflexpre(0), "FE", 0
            ElseIf ttipo = "ACP" Then
                llenarpreguntasnuevas msflexpre(1), "ACP", 1
            ElseIf ttipo = "DP" Then
                llenarpreguntasnuevas msflexpre(2), "DP", 2
            ElseIf ttipo = "RPE" Then
                llenarpreguntasnuevas msflexpre(3), "RPE", 3
            End If
            pregun.MoveNext
        Next
       
    Else
         For X = 0 To 3
            Tipo = pregun!t_item
            If Tipo = "FE" Then
                llenarpreguntasnuevas msflexpre(0), "FE", 0
            ElseIf Tipo = "ACP" Then
                llenarpreguntasnuevas msflexpre(1), "ACP", 1
            ElseIf Tipo = "RPE" Then
                llenarpreguntasnuevas msflexpre(2), "RPE", 2
            ElseIf Tipo = "CFC" Then
                llenarpreguntasnuevas msflexpre(3), "CFC", 3
            End If
            pregun.MoveNext
        Next
    End If
    pregun.Close
End Sub




Private Sub msflexpre_DblClick(Index As Integer)

    Frame4.Enabled = False ' Desactiva el Frame con las preguntas
    Frame_pregunta.Visible = True
    Frame_pregunta.Enabled = True
    
    msflexpre(Index).Col = 3
    Pregunta.Caption = msflexpre(Index).Text
    Text2.Text = str(Index)
    llenarrespuestas
    Set ICRes.SelectedItem = ICRes.ComboItems.Item(1)
End Sub
Private Sub llenarrespuestas()
    Dim Res As ADODB.Recordset
    Dim sqlcon As String
    Dim X, limite As Integer
    
    Set Res = New ADODB.Recordset
    
    sqlcon = "Select desaper_crit_eval_nivel.criterio, desaper_crit_eval.descripcion from desaper_crit_eval_nivel join desaper_crit_eval where desaper_crit_eval_nivel.cod_ens='" & Text1(6).Text & "' and desaper_crit_eval_nivel.criterio=desaper_crit_eval.criterio group by 1"
    Res.Open sqlcon, conn
    
    
    ICRes.ComboItems.Clear
    X = 1
    Res.MoveFirst
    
    While Not Res.EOF

        ICRes.ComboItems.Add X, Res!Criterio, Res!descripcion
        X = X + 1
        Res.MoveNext
    Wend
    Res.Close
End Sub
Private Sub llenartodo(grillapregunta As MSFlexGrid, tItem As String, xtab As Integer)
    Dim llenar As ADODB.Recordset
    
    
    Dim sqlcon As String
    Dim recorre, limite As Integer
    
    SSTab1.Tab = xtab
    
    If tItem = "FE" Then
        SSTab1.Caption = "Formación Etica"
    ElseIf tItem = "ACP" Then
        SSTab1.Caption = "Autoafirmación y Crecimiento"
    ElseIf tItem = "RPE" Then
        SSTab1.Caption = "Relacion Persona y Entorno"
    ElseIf tItem = "CFC" Then
        SSTab1.Caption = "Compromiso Familia Comunidad"
    ElseIf tItem = "DP" Then
        SSTab1.Caption = "Desarollo Pensamiento"
    End If
    SSTab1.Tab = 0
    sqlcon = "Select desaper_item_deta.folio_persoc, desaper_item_deta.t_item, desaper_item_deta.n_item, desaper_item_deta.valor , desaper_item_des.descripcion "
    sqlcon = sqlcon & "From desaper_item_deta,desaper_item_des where desaper_item_deta.t_item='" & tItem & "' and desaper_item_deta.t_item=desaper_item_des.t_item and desaper_item_deta.n_item=desaper_item_des.n_item and desaper_item_deta.folio_persoc=" & Label_NFolio.Caption
    
    Set llenar = New ADODB.Recordset
    llenar.Open sqlcon, conn
    
    limite = llenar.RecordCount
    
    grillapregunta.Rows = limite + 1
    
    With grillapregunta
        .Col = 0
        .Row = 0
        .Text = "Numero Folio"
        .Col = 1
        .Text = "Tipo Item"
        .Col = 2
        .Text = "N item"
        .Col = 3
        .Text = "Pregunta"
        .Col = 4
        .Text = "Valor"
        .ColWidth(0) = 0
        .ColWidth(1) = 0
        .ColWidth(2) = 0
        .ColWidth(3) = 6000
        .ColWidth(4) = 2500
        .ColWidth(5) = 0
        .ColWidth(6) = 0
        
        .Col = 0
        
        llenar.MoveFirst
    
        For recorre = 1 To limite
            .Row = recorre
            .Col = 0
            .Text = Label_NFolio.Caption
            .Col = 1
            .Text = llenar!t_item
            .Col = 2
            .Text = llenar!n_item
            .Col = 3
            .Text = llenar!descripcion
            .Col = 4
            If llenar!Valor = "L" Then
                .Text = "Logrado"
            ElseIf llenar!Valor = "N/L" Then
                .Text = "No Logrado"
            ElseIf llenar!Valor = "V/L" Then
                .Text = "Via de Logro"
            ElseIf llenar!Valor = "N/O" Then
                .Text = "No Observado"
            ElseIf llenar!Valor = "AD" Then
                .Text = "Altamente Desarrollado"
            ElseIf llenar!Valor = "DN" Then
                .Text = "Desarrollo Normal"
            ElseIf llenar!Valor = "PD" Then
                .Text = "Por Desarrollar"
            End If
            .Col = 5
            .Text = llenar!Valor
            .Col = 6
            .Text = llenar!Valor
            llenar.MoveNext
            
        Next
        
    End With
    llenar.Close
End Sub
Private Sub text_Obs_KeyPress(KeyAscii As Integer)
  If KeyAscii = 13 Then
        SendKeys "{BACKSPACE}"
        Command9.SetFocus
    ElseIf KeyAscii = 10 Then
            SendKeys "{BACKSPACE}{BACKSPACE}"
    End If
End Sub

Private Function crearinf(xrut As String, codnumlet As String, xprof As String, xagno As Integer, fol1 As String, fol2 As String, semestre As Integer) As Boolean
Dim sqljoin, sqlupdate As String
Dim crertmp As ADODB.Command
crearinf = True

Set crertmp = New ADODB.Command
crertmp.ActiveConnection = conn
crertmp.CommandType = adCmdText

sqljoin = "SELECT '" & xrut & "' as ci_alu, '" & codnumlet & "' as codnumlet,t1.t_item,t1.n_item,t1.valor,valor2,'" & xprof & "' as rutprof," & Trim(str(xagno)) & " as agno from desaper_item_deta as t1 " & _
    "LEFT JOIN ((" & _
    "Select t_item,n_item,valor as valor2 from `desaper_item_deta` where folio_persoc=" & Trim(str(fol2)) & ") as t2)" & _
    "ON (t1.t_item=t2.t_item and t1.n_item=t2.n_item)" & _
    "Where folio_persoc = " & fol1
    
If semestre = 2 Then
    sqljoin = "SELECT '" & xrut & "' as ci_alu, '" & codnumlet & "' as codnumlet,t1.t_item,t1.n_item,valor2 ,t1.valor,'" & xprof & "' as rutprof," & Trim(str(xagno)) & " as agno from desaper_item_deta as t1 " & _
    "LEFT JOIN ((" & _
    "Select t_item,n_item,valor as valor2 from `desaper_item_deta` where folio_persoc=" & Trim(str(fol2)) & ") as t2)" & _
    "ON (t1.t_item=t2.t_item and t1.n_item=t2.n_item)" & _
    "Where folio_persoc = " & fol1
End If

crertmp.CommandText = "Delete from tmp_desapersoc where ci_alu='" & xrut & "'"
crertmp.Execute

crertmp.CommandText = "INSERT into tmp_desapersoc " & sqljoin
crertmp.Execute

End Function


