VERSION 5.00
Object = "{5E9E78A0-531B-11CF-91F6-C2863C385E30}#1.0#0"; "MSFLXGRD.OCX"
Object = "{F39CBE5C-2D1B-11D6-8D4A-0050043A2E60}#2.0#0"; "ProgBarProzent.ocx"
Begin VB.Form Form_AluPer 
   BorderStyle     =   3  'Fixed Dialog
   Caption         =   "Alumnos perdidos"
   ClientHeight    =   4485
   ClientLeft      =   45
   ClientTop       =   330
   ClientWidth     =   11070
   Icon            =   "Form_AluPer.frx":0000
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MDIChild        =   -1  'True
   MinButton       =   0   'False
   ScaleHeight     =   4485
   ScaleWidth      =   11070
   ShowInTaskbar   =   0   'False
   Begin ProgBarProzent.ProgBar ProgBar1 
      Height          =   255
      Left            =   120
      TabIndex        =   3
      Top             =   4080
      Width           =   10815
      _ExtentX        =   19076
      _ExtentY        =   450
      BorderStyle     =   0
   End
   Begin VB.PictureBox Picture1 
      Height          =   3975
      Left            =   8880
      ScaleHeight     =   3915
      ScaleWidth      =   1995
      TabIndex        =   1
      Top             =   120
      Width           =   2055
      Begin VB.CommandButton BtnBusPer 
         Caption         =   "Buscar perdidos"
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   735
         Left            =   240
         Picture         =   "Form_AluPer.frx":2A8B2
         Style           =   1  'Graphical
         TabIndex        =   2
         Top             =   120
         Width           =   1575
      End
   End
   Begin MSFlexGridLib.MSFlexGrid MSFlexGrid1 
      Height          =   3975
      Left            =   120
      TabIndex        =   0
      Top             =   120
      Width           =   8775
      _ExtentX        =   15478
      _ExtentY        =   7011
      _Version        =   393216
      Cols            =   6
      FixedCols       =   0
      BorderStyle     =   0
      FormatString    =   $"Form_AluPer.frx":2AEA5
      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
Attribute VB_Name = "Form_AluPer"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Option1_Click()

End Sub

Private Sub BtnBusPer_Click()
Me.MSFlexGrid1.Clear
Me.MSFlexGrid1.Rows = 2
Me.MSFlexGrid1.FormatString = "Id     |Curso   |RUN            | Nombre                                                                                      |Situación Final| Año mat."
Dim Lista2003Vacia As Boolean
Dim rsAluPer As ADODB.Recordset
Set rsAluPer = New ADODB.Recordset
rsAluPer.CursorLocation = adUseClient

Dim rsAluAC As ADODB.Recordset
Set rsAluAC = New ADODB.Recordset
rsAluAC.CursorLocation = adUseClient


Lista2003Vacia = True

j = 0

    'a = "SELECT ac.num_gra, ac.let_cur, ac.cod_ens, m.ci_alu, concat(p.ape_pat_alu, ' ', p.ape_mat_alu,' ', p.nom_alu), m.cod_sit, m.anno_mat " & _
        "FROM alu_x_cur ac, matriculas m, postulantes p " & _
        "WHERE not isnull(m.cod_sit) and ac.ci_alu = m.ci_alu and m.ci_alu = p.ci_alu and m.activo_alu ='si' and ac.activo_alu = m.activo_alu and (m.anno_mat <>'2004' or  isnull(m.anno_mat)) order by p.ape_pat_alu, p.ape_mat_alu, p.nom_alu" ' ac.cod_ens, ac.num_gra, ac.let_cur,

    a = "select * from  matriculas  where activo_alu ='si' and isnull(cod_sit) and (isnull(anno_mat) or anno_mat='2003')"
rsAluAC.Open a, conn
If rsAluAC.RecordCount > 0 Then
    With ProgBar1
        .MaxValue = rsAluAC.RecordCount
        .Richtung = mDir
        .ProgressStyle = mStyle
        .ShowProzent = 1
        .Zusatztext = "%"
        .ShowProgress 0
    End With
    For i = 1 To rsAluAC.RecordCount
        If Not ExistReg("alu_x_cur", "ci_alu ='" & rsAluAC("ci_alu") & "'", conn) Then
            j = j + 1
            Me.MSFlexGrid1.TextMatrix(j, 0) = j
            Me.MSFlexGrid1.TextMatrix(j, 1) = rsAluAC("cod_ens") ' rsAluAC("num_gra") & rsAluAC("let_cur") & "-" & rsAluAC("cod_ens")
            Me.MSFlexGrid1.TextMatrix(j, 2) = rsAluAC("ci_alu")
            Me.MSFlexGrid1.AddItem ""
            Lista2003Vacia = False
        End If
        rsAluAC.MoveNext
        Me.ProgBar1.ShowProgress i
        DoEvents
    Next i
    Me.ProgBar1.ShowProgress Me.ProgBar1.MaxValue
    If Lista2003Vacia Then
        MsgBox "Todos los alumnos del año anterior se encuentran en el año " & Anno
    End If
     
End If
    
    
    
    

End Sub

Private Sub Form_Unload(Cancel As Integer)
Call menuhabilitado(True)
End Sub
