VERSION 5.00
Begin VB.Form Form_Ficha_Alu 
   BorderStyle     =   1  'Fixed Single
   Caption         =   "Ficha de Alumno"
   ClientHeight    =   6195
   ClientLeft      =   45
   ClientTop       =   330
   ClientWidth     =   10665
   Icon            =   "Form_Ficha_Alu.frx":0000
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MDIChild        =   -1  'True
   MinButton       =   0   'False
   ScaleHeight     =   6195
   ScaleWidth      =   10665
   Begin VB.ListBox List2 
      BeginProperty Font 
         Name            =   "Arial"
         Size            =   9.75
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   1740
      Left            =   7800
      TabIndex        =   22
      Top             =   840
      Visible         =   0   'False
      Width           =   1695
   End
   Begin VB.ListBox List1 
      BeginProperty Font 
         Name            =   "Arial"
         Size            =   9.75
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   1740
      Left            =   1200
      TabIndex        =   21
      Top             =   840
      Visible         =   0   'False
      Width           =   5775
   End
   Begin VB.Frame Frame4 
      Caption         =   "Buscar Alumno"
      BeginProperty Font 
         Name            =   "Arial"
         Size            =   8.25
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H00C00000&
      Height          =   975
      Left            =   120
      TabIndex        =   11
      Top             =   120
      Width           =   10335
      Begin VB.CommandButton Command3 
         Caption         =   "Ver"
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   615
         Left            =   9480
         Picture         =   "Form_Ficha_Alu.frx":2A8B2
         Style           =   1  'Graphical
         TabIndex        =   18
         Top             =   240
         Width           =   735
      End
      Begin VB.TextBox Text1 
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   9.75
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   400
         Left            =   1080
         MaxLength       =   100
         TabIndex        =   17
         Top             =   360
         Width           =   5775
      End
      Begin VB.TextBox Text2 
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   9.75
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   400
         Left            =   7680
         MaxLength       =   10
         TabIndex        =   16
         Top             =   360
         Width           =   1695
      End
      Begin VB.Label Label4 
         Caption         =   "RUT"
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   255
         Left            =   7080
         TabIndex        =   20
         Top             =   360
         Width           =   495
      End
      Begin VB.Label Label3 
         Caption         =   "Nombre"
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   255
         Left            =   240
         TabIndex        =   19
         Top             =   420
         Width           =   855
      End
   End
   Begin VB.Frame Frame1 
      Caption         =   "Proceso de Inscripció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          =   4815
      Left            =   3240
      TabIndex        =   8
      Top             =   1200
      Width           =   7215
      Begin VB.CommandButton btnPad 
         Enabled         =   0   'False
         Height          =   855
         Left            =   2160
         Picture         =   "Form_Ficha_Alu.frx":2AE29
         Style           =   1  'Graphical
         TabIndex        =   3
         Top             =   1320
         Width           =   1815
      End
      Begin VB.CommandButton btnAlu 
         Height          =   855
         Left            =   360
         Picture         =   "Form_Ficha_Alu.frx":2C49E
         Style           =   1  'Graphical
         TabIndex        =   2
         Top             =   360
         Width           =   1815
      End
      Begin VB.CommandButton btnApo 
         Enabled         =   0   'False
         Height          =   855
         Left            =   3960
         Picture         =   "Form_Ficha_Alu.frx":2DB01
         Style           =   1  'Graphical
         TabIndex        =   4
         Top             =   2400
         Width           =   1815
      End
      Begin VB.CommandButton btnDocumentos 
         Enabled         =   0   'False
         Height          =   855
         Left            =   360
         Picture         =   "Form_Ficha_Alu.frx":2F179
         Style           =   1  'Graphical
         TabIndex        =   5
         Top             =   3000
         Width           =   1815
      End
      Begin VB.TextBox Doc_Estado 
         Alignment       =   2  'Center
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   12
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H000000FF&
         Height          =   405
         Left            =   360
         TabIndex        =   9
         Text            =   "Desconocido"
         Top             =   4080
         Visible         =   0   'False
         Width           =   1815
      End
      Begin VB.Image Image4 
         Height          =   1005
         Left            =   2640
         Picture         =   "Form_Ficha_Alu.frx":307E0
         Top             =   2880
         Width           =   1050
      End
      Begin VB.Label Label5 
         Alignment       =   2  'Center
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   9.75
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H00C00000&
         Height          =   255
         Left            =   360
         TabIndex        =   23
         Top             =   4440
         Width           =   6495
      End
      Begin VB.Image Image1 
         Height          =   900
         Left            =   4320
         Picture         =   "Form_Ficha_Alu.frx":316EF
         Top             =   1320
         Width           =   1125
      End
      Begin VB.Image Image2 
         Height          =   1005
         Left            =   2520
         Picture         =   "Form_Ficha_Alu.frx":32379
         Top             =   240
         Width           =   900
      End
      Begin VB.Image Image3 
         Height          =   1050
         Left            =   6000
         Picture         =   "Form_Ficha_Alu.frx":32F57
         Top             =   2160
         Width           =   885
      End
      Begin VB.Line lnPad1 
         BorderColor     =   &H0000C000&
         BorderWidth     =   5
         Index           =   0
         Visible         =   0   'False
         X1              =   1080
         X2              =   1080
         Y1              =   1080
         Y2              =   1680
      End
      Begin VB.Line lnPad1 
         BorderColor     =   &H0000C000&
         BorderWidth     =   5
         Index           =   1
         Visible         =   0   'False
         X1              =   1080
         X2              =   2160
         Y1              =   1680
         Y2              =   1680
      End
      Begin VB.Line lnApo 
         BorderColor     =   &H0000C000&
         BorderWidth     =   5
         Index           =   0
         Visible         =   0   'False
         X1              =   2880
         X2              =   2880
         Y1              =   2040
         Y2              =   2640
      End
      Begin VB.Line lnApo 
         BorderColor     =   &H0000C000&
         BorderWidth     =   5
         Index           =   1
         Visible         =   0   'False
         X1              =   2880
         X2              =   3960
         Y1              =   2640
         Y2              =   2640
      End
      Begin VB.Line lnDoc 
         BorderColor     =   &H0000FFFF&
         BorderWidth     =   5
         Index           =   0
         Visible         =   0   'False
         X1              =   4680
         X2              =   4680
         Y1              =   2760
         Y2              =   3480
      End
      Begin VB.Line lnDoc 
         BorderColor     =   &H0000FFFF&
         BorderWidth     =   5
         Index           =   1
         Visible         =   0   'False
         X1              =   2040
         X2              =   4680
         Y1              =   3480
         Y2              =   3480
      End
   End
   Begin VB.Frame Frame2 
      Caption         =   "Alumno 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          =   4815
      Left            =   120
      TabIndex        =   1
      Top             =   1200
      Width           =   3015
      Begin VB.TextBox cl_Nombre 
         Alignment       =   2  'Center
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   12
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   735
         Left            =   120
         Locked          =   -1  'True
         MultiLine       =   -1  'True
         TabIndex        =   14
         Top             =   1320
         Width           =   2775
      End
      Begin VB.TextBox ALU_RUN 
         Alignment       =   2  'Center
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   12
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   405
         Left            =   120
         Locked          =   -1  'True
         MaxLength       =   10
         TabIndex        =   13
         Top             =   600
         Width           =   2775
      End
      Begin VB.CommandButton Command2 
         Caption         =   "&Ver Ficha"
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   855
         Left            =   600
         Picture         =   "Form_Ficha_Alu.frx":339AE
         Style           =   1  'Graphical
         TabIndex        =   10
         Top             =   2520
         Width           =   1695
      End
      Begin VB.CommandButton Command1 
         Caption         =   "&Buscar"
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   375
         Left            =   600
         TabIndex        =   0
         Top             =   2520
         Visible         =   0   'False
         Width           =   1695
      End
      Begin VB.Frame Frame3 
         Caption         =   "Estado Alumno"
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H00C00000&
         Height          =   975
         Left            =   120
         TabIndex        =   6
         Top             =   3720
         Width           =   2775
         Begin VB.Label Label2 
            Alignment       =   2  'Center
            BeginProperty Font 
               Name            =   "Arial"
               Size            =   12
               Charset         =   0
               Weight          =   700
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            ForeColor       =   &H0000C000&
            Height          =   615
            Left            =   120
            TabIndex        =   7
            Top             =   240
            Width           =   2535
         End
      End
      Begin VB.Label Label1 
         Caption         =   "Nombre:"
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H00000000&
         Height          =   255
         Index           =   1
         Left            =   120
         TabIndex        =   15
         Top             =   1080
         Width           =   2775
      End
      Begin VB.Label Label1 
         Caption         =   "RUN:"
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H00000000&
         Height          =   375
         Index           =   0
         Left            =   120
         TabIndex        =   12
         Top             =   300
         Width           =   1815
      End
   End
End
Attribute VB_Name = "Form_Ficha_Alu"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Public ci_aluaca As String
Dim Flag_sub As Boolean

Private Sub ALU_RUN_Change()
If Len(Me.ALU_RUN.Text) > 9 Then
    If Trim(ALU_RUN.Text) <> "" Then
        Command1_Click
    End If
Else
        lnApo(0).Visible = False
        lnApo(1).Visible = False
        Me.lnPad1(0).Visible = False
        Me.lnPad1(1).Visible = False
        Me.btnApo.Enabled = False
        Me.btnPad.Enabled = False
        Me.ci_aluaca = ""
        Me.cl_Nombre.Text = ""
        lnDoc(0).Visible = False
        lnDoc(1).Visible = False
        Me.btnDocumentos.Enabled = False
        Me.Doc_Estado.Visible = False
        Me.Doc_Estado.Text = "Desconocido"
End If
End Sub

Private Sub btnAlu_Click()
    Form_Ficha_Alu_Datos.Show
End Sub
Private Sub btnApo_Click()
    Form_Ficha_Alu_Apoderado.Show
End Sub

Private Sub btnDocumentos_Click()
    Form_Ficha_Alu_Docu.Show
End Sub

Private Sub btnPad_Click()
Form_Ficha_Alu_Padres.Show
End Sub

Public Sub Command1_Click()
       
    Dim buscar As ADODB.Recordset
    Dim filtra  As ADODB.Recordset
    Dim ci_p As String
    Dim ci_m As String
    Dim ci_a As String
    Label5.Caption = ""
    ci_a = Trim(Me.ALU_RUN.Text)
    Set buscar = New ADODB.Recordset
    Set filtra = New ADODB.Recordset
    buscar.Open "Select postulantes.ci_alu,rut_mad_alu as ci_madre, rut_pad_alu as ci_padre, concat(nom_alu,' ',ape_pat_alu,' ',ape_mat_alu) as clnombre from postulantes where postulantes.ci_alu='" & ci_a & "' and length(nom_alu)>0 and length(ape_pat_alu)>0 and length(ape_mat_alu)>0 " & _
    "and length(cod_geo)>0 and length(dire_alu)>0 and length(sex_alu)>0 and length(ind_ext_alu)>0 and length(fec_nacalu)>0 and length(fon_emergencia_alu)>0 and length(contacto_emergencia_alu)>0 and VI_Sol_Car_Esc is not null and indigena is not null and ind_embarazo is not null and VI_FOR_EXI_REL is not null and ci_alu not in (select ci_alu from apo_x_ins)", conn
    
    If buscar.RecordCount > 0 Then
    
       If Trim(buscar!ci_alu) = ci_a Then  'REDUNDANCIA PARA VERIFICACION
            filtra.Open "Select ci_alu, anno_mat from matriculas where ci_alu='" & ci_a & "' and fec_retiro='1111-11-11' and activo_alu='SI' ORDER BY Anno_mat DESC LIMIT 1;", conn
            If filtra.RecordCount < 1 Then
                buscar.Close
                filtra.Close
                MsgBox "El Alumno no Existe o es un inscrito", vbCritical, "Alumno no valido"
                Exit Sub
            End If
            
            Me.Label5.Caption = "Ficha Actualizada al Año " & filtra!anno_mat
            Me.cl_Nombre.Text = buscar!clnombre
            Me.lnPad1(0).Visible = True
            Me.lnPad1(1).Visible = True
            Me.btnPad.Enabled = True
            Me.ci_aluaca = buscar!ci_alu
            
            If IsNull(buscar!ci_padre) Then
                ci_p = ""
            Else
                ci_p = buscar!ci_padre
            End If
            
            If IsNull(buscar!ci_madre) Then
                ci_m = ""
            Else
                ci_m = buscar!ci_madre
            End If
       
        If ci_m = "" And ci_p = "" Then
            Exit Sub
        End If
    Else
        lnApo(0).Visible = False
        lnApo(1).Visible = False
        Me.lnPad1(0).Visible = False
        Me.lnPad1(1).Visible = False
        Me.btnApo.Enabled = False
        Me.btnPad.Enabled = False
        lnDoc(0).Visible = False
        lnDoc(1).Visible = False
        Label2.Caption = "FALTAN DATOS"
        buscar.Close
        Exit Sub
    End If
    
    buscar.Close
    
    buscar.Open "Select count(*) as cuantos from apoderados where rut_apo='" & ci_m & "' or rut_apo='" & ci_p & "'", conn
    
    lnApo(1).Visible = True
    lnApo(0).Visible = True
    Me.btnApo.Enabled = True
    lnDoc(0).Visible = False
    lnDoc(1).Visible = False
    Label2.Caption = "FALTAN DATOS"
    If buscar!cuantos > 0 Then
       
    Else
        buscar.Close
        Exit Sub
    End If
    
       buscar.Close
    buscar.Open "Select * from apo_x_alu where ci_alu='" & ci_a & "' ORDER BY agno DESC LIMIT 1;", conn
    
    If buscar.RecordCount > 0 Then
        lnDoc(0).Visible = True
        lnDoc(1).Visible = True
        Me.btnDocumentos.Enabled = True
        Label2.Caption = "LISTO"
    Else
        buscar.Close
        Exit Sub
    End If
    
    buscar.Close
    buscar.Open "Select ci_alu from postulantes where (V_CER_NAC is null or V_INF_NOT_PAR is Null or  V_CER_EST_ULT_CUR is Null or V_FOTOS is null or  V_CER_NAC=0 or V_INF_NOT_PAR=0 or  V_CER_EST_ULT_CUR=0 or V_FOTOS=0) and ci_alu='" & ci_a & "';", conn
    
    If buscar.RecordCount > 0 Then
        Me.Doc_Estado.Text = "FALTAN"
        Me.Doc_Estado.Visible = True
    Else
        Me.Doc_Estado.Text = "TODOS OK"
        Me.Doc_Estado.Visible = True
    End If
Else
    lnApo(0).Visible = False
    lnApo(1).Visible = False
    Me.lnPad1(0).Visible = False
    Me.lnPad1(1).Visible = False
    Me.btnApo.Enabled = False
    Me.btnPad.Enabled = False
    lnDoc(0).Visible = False
    lnDoc(1).Visible = False
    Me.btnDocumentos.Enabled = False
    Label2.Caption = "FALTAN DATOS"
    Exit Sub
    
End If

End Sub

Private Sub Command2_Click()
Dim rec As ADODB.Recordset
Set rec = New ADODB.Recordset

rec.Open "SELECT agno FROM apo_x_alu WHERE ci_alu='" & Trim(ALU_RUN.Text) & "' ORDER BY agno DESC LIMIT 1;", conn

If rec.RecordCount > 0 Then
    'Form_main.CrystalReport.ReportFileName = App.Path & "\rpt\fichaper" & IIf((Mid(RetornaCampo("CFG", "valor", "param='CODBC'", conn), 1, 6) = "LIN001"), "lin", "") & ".rpt"
    
    cole = DevuelveCampo("cfg", "", "valor", "param = 'CODBC'", conn)
    If cole <> "ALT001" And cole <> "HUE001" Then
        Form_main.CrystalReport.ReportFileName = App.Path & "\rpt\fichaper_sub" & IIf((Mid(RetornaCampo("CFG", "valor", "param='CODBC'", conn), 1, 6) = "LIN001"), "lin", "") & ".rpt"
    Else
        Form_main.CrystalReport.ReportFileName = App.Path & "\rpt\fichaper" & IIf((Mid(RetornaCampo("CFG", "valor", "param='CODBC'", conn), 1, 6) = "LIN001"), "lin", "") & ".rpt"
    End If
    
    Form_main.CrystalReport.WindowState = crptMaximized
    Form_main.CrystalReport.WindowTitle = "Ficha Personal de Alumno"
    Form_main.CrystalReport.ReplaceSelectionFormula ("")
    Form_main.CrystalReport.ReplaceSelectionFormula ("{apo_x_alu.agno}=" & rec!agno & " and {postulantes.ci_alu}='" & Me.ALU_RUN.Text & "'")
    Form_main.CrystalReport.Destination = crptToWindow
    Form_main.CrystalReport.Action = 1
Else
    MsgBox "No se encontro año de la ultima ficha de matricula.", vbInformation, "Alumno no disponible."
End If
rec.Close

End Sub

Private Sub Command3_Click()
    If Len(Text2.Text) = 10 Then
        List1.Visible = False
        List2.Visible = False
        ALU_RUN.Text = Text2.Text
        ci_aluaca = Text2.Text
    End If
End Sub

Private Sub Form_Load()
    Me.ci_aluaca = ""
    Flag_sub = False
End Sub

Private Sub List1_DblClick()
    Dim RC As ADODB.Recordset
    
    Text1.Text = List1.Text
    List1.Visible = False
    List2.Visible = False
    Set RC = New ADODB.Recordset
    RC.Open "SELECT p.ci_alu FROM postulantes p WHERE left(CONCAT(p.ape_pat_alu,' ',p.ape_mat_alu,' ',p.nom_alu)," & Len(Text1.Text) & ")='" & Text1.Text & "'  ORDER BY p.ape_pat_alu,p.ape_mat_alu,p.nom_alu LIMIT 50;", conn
    RC.MoveFirst
    Flag_sub = True
    Text2.Text = RC!ci_alu
    Flag_sub = False
    RC.Close
    
End Sub

Private Sub List2_Click()
    Dim RC As ADODB.Recordset
    
    Text2.Text = List2.Text
    List2.Visible = False
    List1.Visible = False
    Set RC = New ADODB.Recordset
    RC.Open "SELECT CONCAT(p.ape_pat_alu,' ',p.ape_mat_alu,' ',p.nom_alu) as nombre FROM postulantes p WHERE p.ci_alu='" & Text2.Text & "' ORDER BY ci_alu LIMIT 50;", conn
    RC.MoveFirst
    Flag_sub = True
    Text1.Text = RC!nombre
    Flag_sub = False
    RC.Close

End Sub

Private Sub Text1_Change()
    Dim RC As ADODB.Recordset
    ' Si el cambio lo hace un Sub no hacer nada
    If Flag_sub Then Exit Sub
    If Text1.Text = "" Then
        List1.Clear
        List1.Visible = False
        Exit Sub
    End If
    
    Set RC = New ADODB.Recordset

    RC.Open "SELECT DISTINCT CONCAT(p.ape_pat_alu,' ',p.ape_mat_alu,' ',p.nom_alu) as nombre FROM postulantes p, matriculas axa where left(CONCAT(p.ape_pat_alu,' ',p.ape_mat_alu,' ',p.nom_alu)," & Len(Text1.Text) & ")='" & Text1.Text & "' and p.ci_alu=axa.ci_alu ORDER BY p.ape_pat_alu,p.ape_mat_alu,p.nom_alu LIMIT 50;", conn
    List1.Clear
    While Not (RC.EOF)
        List1.AddItem RC!nombre
        RC.MoveNext
    Wend
    RC.Close
    List1.Visible = True
    List2.Visible = False
End Sub

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

Private Sub Text2_Change()
    Dim RC As ADODB.Recordset
    ' Si el cambio lo hace un Sub no hacer nada
    If Flag_sub Then Exit Sub
    If Text2.Text = "" Then
        List2.Clear
        List2.Visible = False
        Exit Sub
    End If
    
    Set RC = New ADODB.Recordset
    
    RC.Open "SELECT DISTINCT p.ci_alu FROM postulantes p, matriculas axa WHERE left(p.ci_alu," & Len(Text2.Text) & ")='" & Text2.Text & "' AND p.ci_alu=axa.ci_alu ORDER BY p.ci_alu LIMIT 50;", conn
    List2.Clear
    While Not (RC.EOF)
        List2.AddItem RC!ci_alu
        RC.MoveNext
    Wend
    RC.Close
    List2.Visible = True
    List1.Visible = False
End Sub

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