VERSION 5.00
Object = "{86CF1D34-0C5F-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCT2.OCX"
Begin VB.Form Form_CRM_Interesados 
   BorderStyle     =   1  'Fixed Single
   Caption         =   "CRM Interesados"
   ClientHeight    =   9660
   ClientLeft      =   45
   ClientTop       =   330
   ClientWidth     =   9570
   Icon            =   "Form_CRM_Interesados.frx":0000
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MDIChild        =   -1  'True
   MinButton       =   0   'False
   ScaleHeight     =   9660
   ScaleWidth      =   9570
   Begin VB.Frame Frame1 
      Caption         =   "Formulario de Postulación"
      BeginProperty Font 
         Name            =   "Arial"
         Size            =   8.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H80000001&
      Height          =   9375
      Left            =   120
      TabIndex        =   0
      Top             =   120
      Width           =   9375
      Begin VB.CommandButton Cerrar 
         Caption         =   "Cerrar"
         Height          =   495
         Left            =   6720
         TabIndex        =   53
         Top             =   8640
         Width           =   2295
      End
      Begin VB.TextBox txtCorreo 
         Height          =   315
         Left            =   6720
         TabIndex        =   21
         Top             =   6360
         Width           =   2415
      End
      Begin VB.TextBox txtCel 
         Height          =   315
         Left            =   1920
         MaxLength       =   8
         TabIndex        =   20
         Top             =   6360
         Width           =   2415
      End
      Begin VB.TextBox txtApe_Mat_Apo 
         Height          =   315
         Left            =   6720
         TabIndex        =   19
         Top             =   5880
         Width           =   2415
      End
      Begin VB.TextBox txtApe_Apo 
         Height          =   315
         Left            =   1920
         TabIndex        =   18
         Top             =   5880
         Width           =   2415
      End
      Begin VB.TextBox txtNom_Apo 
         Height          =   315
         Left            =   6720
         TabIndex        =   17
         Top             =   5400
         Width           =   2415
      End
      Begin VB.TextBox txtRut_Apo 
         Height          =   315
         Left            =   1920
         MaxLength       =   8
         TabIndex        =   15
         Top             =   5400
         Width           =   1695
      End
      Begin VB.TextBox txtCol_proc 
         Height          =   315
         Left            =   6720
         TabIndex        =   11
         Top             =   3360
         Width           =   2415
      End
      Begin VB.TextBox txtComuna 
         Height          =   315
         Left            =   1920
         TabIndex        =   10
         Top             =   3240
         Width           =   2415
      End
      Begin VB.TextBox txtTel 
         Height          =   315
         Left            =   6720
         MaxLength       =   8
         TabIndex        =   8
         Top             =   2400
         Width           =   2415
      End
      Begin VB.TextBox txtDir 
         Height          =   315
         Left            =   6720
         TabIndex        =   7
         Top             =   1920
         Width           =   2415
      End
      Begin VB.TextBox txtApe_Mat 
         Height          =   315
         Left            =   6720
         TabIndex        =   5
         Top             =   1440
         Width           =   2415
      End
      Begin VB.TextBox txt_ape_pat 
         Height          =   315
         Left            =   1920
         TabIndex        =   4
         Top             =   1560
         Width           =   2415
      End
      Begin VB.TextBox txtNombre 
         Height          =   315
         Left            =   6720
         TabIndex        =   3
         Top             =   960
         Width           =   2415
      End
      Begin VB.TextBox txtRut 
         Height          =   315
         Left            =   1920
         MaxLength       =   8
         TabIndex        =   1
         Top             =   1080
         Width           =   1815
      End
      Begin VB.ComboBox cbxMedio 
         Height          =   315
         Left            =   6720
         TabIndex        =   13
         Top             =   3840
         Width           =   2415
      End
      Begin VB.TextBox txtVerifApo 
         Height          =   315
         Left            =   3960
         MaxLength       =   1
         TabIndex        =   16
         Top             =   5400
         Width           =   255
      End
      Begin MSComCtl2.DTPicker dtpFec_Pos 
         Height          =   375
         Left            =   1920
         TabIndex        =   50
         Top             =   2640
         Width           =   2415
         _ExtentX        =   4260
         _ExtentY        =   661
         _Version        =   393216
         Enabled         =   0   'False
         Format          =   50528257
         CurrentDate     =   41730
      End
      Begin VB.TextBox txtVerif 
         Height          =   315
         Left            =   4080
         MaxLength       =   1
         TabIndex        =   2
         Top             =   1080
         Width           =   255
      End
      Begin VB.CommandButton Command1 
         Caption         =   "Postular"
         Height          =   495
         Left            =   3960
         TabIndex        =   46
         Top             =   8640
         Width           =   2175
      End
      Begin VB.ComboBox cbxEnc2 
         Height          =   315
         Left            =   6720
         TabIndex        =   23
         Text            =   "Combo1"
         Top             =   7920
         Width           =   2415
      End
      Begin VB.ComboBox cbxEnc1 
         Height          =   315
         Left            =   6720
         TabIndex        =   22
         Text            =   "Combo1"
         Top             =   7440
         Width           =   2415
      End
      Begin VB.ComboBox cbxCurso 
         Height          =   315
         Left            =   6720
         TabIndex        =   9
         Text            =   "cbxCurso"
         Top             =   2880
         Width           =   2415
      End
      Begin VB.ComboBox cbxAgno 
         Height          =   315
         Left            =   1920
         TabIndex        =   14
         Text            =   "Combo1"
         Top             =   4200
         Width           =   2415
      End
      Begin VB.ComboBox cbxColegio 
         Height          =   315
         Left            =   1920
         TabIndex        =   12
         Text            =   "Combo1"
         Top             =   3720
         Width           =   2415
      End
      Begin MSComCtl2.DTPicker dtpFec_Nac 
         Height          =   375
         Left            =   1920
         TabIndex        =   6
         Top             =   2040
         Width           =   2415
         _ExtentX        =   4260
         _ExtentY        =   661
         _Version        =   393216
         Format          =   50528257
         CurrentDate     =   41730
      End
      Begin VB.Label Label26 
         Caption         =   "Medio de Postulación"
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   255
         Left            =   4800
         TabIndex        =   52
         Top             =   3960
         Width           =   1935
      End
      Begin VB.Label Label25 
         Caption         =   "-"
         BeginProperty Font 
            Name            =   "MS Sans Serif"
            Size            =   13.5
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   375
         Left            =   3720
         TabIndex        =   51
         Top             =   5400
         Width           =   375
      End
      Begin VB.Label Label3 
         Caption         =   "Fecha de Postulación"
         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            =   120
         TabIndex        =   49
         Top             =   2760
         Width           =   1935
      End
      Begin VB.Label Label24 
         Caption         =   "Teléfono Celular"
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   255
         Left            =   120
         TabIndex        =   48
         Top             =   6480
         Width           =   1935
      End
      Begin VB.Label Label23 
         Caption         =   "-"
         BeginProperty Font 
            Name            =   "MS Sans Serif"
            Size            =   13.5
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   375
         Left            =   3840
         TabIndex        =   47
         Top             =   1080
         Width           =   375
      End
      Begin VB.Label Label22 
         Caption         =   "¿Por qué nos elije como opción educacional para su hijo(a)?"
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   375
         Left            =   120
         TabIndex        =   45
         Top             =   7920
         Width           =   4575
      End
      Begin VB.Label Label21 
         Caption         =   "¿Cómo se enteró de la Institución Educacional Boston College?"
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   375
         Left            =   120
         TabIndex        =   44
         Top             =   7440
         Width           =   4575
      End
      Begin VB.Label Label20 
         Caption         =   "Encuesta"
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   375
         Left            =   120
         TabIndex        =   43
         Top             =   7080
         Width           =   3375
      End
      Begin VB.Label Label19 
         Caption         =   "Datos de Alumno"
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   12
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H80000001&
         Height          =   375
         Left            =   120
         TabIndex        =   42
         Top             =   480
         Width           =   2535
      End
      Begin VB.Label Label18 
         Caption         =   "Datos de Apoderado "
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   12
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H80000001&
         Height          =   375
         Left            =   120
         TabIndex        =   41
         Top             =   4920
         Width           =   3375
      End
      Begin VB.Label Label17 
         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            =   120
         TabIndex        =   40
         Top             =   5400
         Width           =   1935
      End
      Begin VB.Label Label16 
         Caption         =   "Correo Electrónico"
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   255
         Left            =   4800
         TabIndex        =   39
         Top             =   6480
         Width           =   1935
      End
      Begin VB.Label Label15 
         Caption         =   "Apellidos"
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   255
         Left            =   120
         TabIndex        =   38
         Top             =   6000
         Width           =   1935
      End
      Begin VB.Label Label14 
         Caption         =   "Año al que Postula"
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   255
         Left            =   120
         TabIndex        =   37
         Top             =   4320
         Width           =   1935
      End
      Begin VB.Label Label13 
         Caption         =   "Apellido Materno"
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   255
         Left            =   4800
         TabIndex        =   36
         Top             =   6000
         Width           =   1935
      End
      Begin VB.Label Label12 
         Caption         =   "Nombres"
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   255
         Left            =   4800
         TabIndex        =   35
         Top             =   5520
         Width           =   1935
      End
      Begin VB.Label Label11 
         Caption         =   "Colegio de Procedencia"
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   255
         Left            =   4800
         TabIndex        =   34
         Top             =   3480
         Width           =   1935
      End
      Begin VB.Label Label10 
         Caption         =   "Curso al que Postula"
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   255
         Left            =   4800
         TabIndex        =   33
         Top             =   3000
         Width           =   1935
      End
      Begin VB.Label Label9 
         Caption         =   "Teléfono"
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   255
         Left            =   4800
         TabIndex        =   32
         Top             =   2520
         Width           =   1935
      End
      Begin VB.Label Label8 
         Caption         =   "Dirección"
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   255
         Left            =   4800
         TabIndex        =   31
         Top             =   2040
         Width           =   1935
      End
      Begin VB.Label Label7 
         Caption         =   "Apellido Materno"
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   255
         Left            =   4800
         TabIndex        =   30
         Top             =   1560
         Width           =   1935
      End
      Begin VB.Label Label6 
         Caption         =   "Nombres"
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   255
         Left            =   4800
         TabIndex        =   29
         Top             =   1080
         Width           =   1935
      End
      Begin VB.Label Label5 
         Caption         =   "Colegio al que Postula"
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   255
         Left            =   120
         TabIndex        =   28
         Top             =   3840
         Width           =   1935
      End
      Begin VB.Label Label4 
         Caption         =   "Comuna"
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   255
         Left            =   120
         TabIndex        =   27
         Top             =   3240
         Width           =   1935
      End
      Begin VB.Label Label3 
         Caption         =   "Fecha de Nacimiento"
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   255
         Index           =   0
         Left            =   120
         TabIndex        =   26
         Top             =   2160
         Width           =   1935
      End
      Begin VB.Label Label2 
         Caption         =   "Apellido Paterno"
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   255
         Left            =   120
         TabIndex        =   25
         Top             =   1680
         Width           =   1935
      End
      Begin VB.Label Label1 
         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            =   120
         TabIndex        =   24
         Top             =   1080
         Width           =   1935
      End
   End
End
Attribute VB_Name = "Form_CRM_Interesados"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False


Private Sub cbxAgno_KeyPress(KeyAscii As Integer)
KeyAscii = 0
End Sub

Private Sub cbxColegio_KeyPress(KeyAscii As Integer)
KeyAscii = 0
End Sub

Private Sub cbxCurso_KeyPress(KeyAscii As Integer)
KeyAscii = 0
End Sub

Private Sub cbxEnc1_KeyPress(KeyAscii As Integer)
KeyAscii = 0
End Sub

Private Sub cbxEnc2_KeyPress(KeyAscii As Integer)
KeyAscii = 0
End Sub

Private Sub cbxMedio_KeyPress(KeyAscii As Integer)
KeyAscii = 0
End Sub

Private Sub Cerrar_Click()
Unload Me
End Sub

Private Sub Command1_Click()
If Me.txtRut.Text = "" Or Me.txtVerif.Text = "" Or Me.txt_ape_pat.Text = "" Or Me.txtNombre.Text = "" _
    Or Me.txtApe_Mat.Text = "" Or Me.txtDir.Text = "" Or Me.txtTel.Text = "" Or Me.txtComuna.Text = "" _
    Or Me.txtCol_proc.Text = "" Or Me.txtRut_Apo.Text = "" Or Me.txtVerifApo.Text = "" Or Me.txtNom_Apo.Text = "" _
    Or Me.txtApe_Apo.Text = "" Or Me.txtApe_Mat_Apo.Text = "" Or Me.txtCel.Text = "" Or Me.txtCorreo.Text = "" _
    Or Me.cbxCurso.Text = "" Or Me.cbxMedio.Text = "" Or Me.cbxEnc1.Text = "" Or Me.cbxEnc2.Text = "" Then

    MsgBox "Hay Campos Vacios"
    
    

Else
        

Dim var_sql
Dim objRS As ADODB.Recordset
Set objRS = New ADODB.Recordset
Dim Numero As Integer
Dim med As Integer
Dim Col As String
Dim id_col As String


If Me.cbxMedio.Text = "Oficina" Then
    med = 3

End If
If Me.cbxMedio.Text = "Teléfono" Then
    med = 4
  
End If

If Me.cbxMedio.Text = "Mail" Then
    med = 5
  
End If

'SE MODIFICA 28-03-2022
If Len(Me.txtCorreo.Text) < 8 Or InStr(Me.txtCorreo.Text, "@") = 0 Or InStr(Me.txtCorreo.Text, ".") = 0 Then
    MsgBox "Correo no valido o no ingresado", vbInformation
    email_apo.Text = ""
    Exit Sub
End If


If Me.txtCorreo.Text <> "" Then
    If Not Validar_Email(Me.txtCorreo.Text) Then

        MsgBox "Debe ingresar dirección de correo electrónico valida", vbInformation
        Me.txtCorreo.Text = ""
        Exit Sub
    End If
End If



'Valido que NO se pueda volver a postular para el mismo AÑO
var_sql = "SELECT * FROM postulante_web WHERE rut_pos = '" & Me.txtRut.Text & "-" & Me.txtVerif.Text & "' AND anio = " & cbxAgno & " AND eliminado = 'NO'"
            conn.Execute var_sql
objRS.Open var_sql, conn
 If objRS.RecordCount > 0 Then
 MsgBox "El Interesado tiene Postulacion Vigente para el año seleccionado", vbInformation
 
 Exit Sub
 End If
 
objRS.Close


var_sql = "SELECT ci_alu FROM matriculas WHERE ANNO_MAT = '2014' AND activo_alu = 'si' and ci_alu = '" & Me.txtRut.Text & "-" & Me.txtVerif.Text & "' "
            conn.Execute var_sql
objRS.Open var_sql, conn
 If objRS.RecordCount > 0 Then
 MsgBox "El Interesado tiene Matricula Vigente", vbInformation
 
 Exit Sub
 End If
 
objRS.Close



var_sql = "SELECT id_colegio AS id_cole FROM establecimientos "
            conn.Execute var_sql
            
objRS.Open var_sql, conn
id_col = objRS("id_cole")
objRS.Close

If id_col = "LA FARFANA" Then
    id_col = "FARFANA"
End If

If id_col = "LA FLORIDA" Then
    id_col = "FLORIDA"
End If




var_sql = "SELECT valor FROM cfg WHERE paraM = 'CODBC' "
            conn.Execute var_sql
            
objRS.Open var_sql, conn
Col = objRS("valor")
objRS.Close



var_sql = "SELECT MAX(numero) As numero FROM postulante_web "
            conn.Execute var_sql

objRS.Open var_sql, conn
Numero = objRS("numero") + 1
objRS.Close


        
var_sql = "INSERT INTO postulante_web (rut_pos,nombres_pos,ape_pat_pos,ape_mat_pos,fecha_nac,direccion,comuna,telefono,curso_pos,colegio_pos,nombres_apo,ape_pat_apo,ape_mat_apo,mail,preg1,preg2,fecha,numero,anio,col_pro,rut_apo,telefono_celular,oficina,renuncia,colegio) VALUES ('" & Me.txtRut.Text & "-" & Me.txtVerif.Text & "','" & Me.txtNombre.Text & "','" & Me.txt_ape_pat.Text & "','" & Me.txtApe_Mat.Text & "'," _
           & " '" & Me.dtpFec_Nac.Value & "','" & Me.txtDir.Text & "','" & Me.txtComuna.Text & "','" & Me.txtTel.Text & "','" & Me.cbxCurso.Text & "'," _
           & " '" & id_col & "','" & Me.txtNom_Apo.Text & "','" & Me.txtApe_Apo.Text & "','" & Me.txtApe_Mat_Apo.Text & "', " _
           & " '" & Me.txtCorreo.Text & "','" & Me.cbxEnc1.Text & "' , '" & Me.cbxEnc2.Text & " ','" & Me.dtpFec_Pos.Value & "','" & Numero & "','" & cbxAgno & "', " _
           & " '" & Me.txtCol_proc.Text & "','" & Me.txtRut_Apo.Text & "-" & Me.txtVerifApo.Text & "','" & Me.txtCel.Text & "','" & med & "','0','" & Col & "')"
        conn.Execute var_sql




        MsgBox "Los Datos Fueron Guardados Correctamente"



End If






End Sub




Private Sub dtpFec_Nac_Change()
KeyAscii = 0
End Sub

Private Sub Form_Load()
Dim var_sql, var_sql2, a, b, Res
Dim objRS As ADODB.Recordset
Set objRS = New ADODB.Recordset


var_sql = "SELECT nom_est AS ESTABLECIMIENTO FROM establecimientos"

conn.Execute var_sql

Me.cbxColegio.Text = ""
objRS.Open var_sql, conn
Me.cbxColegio.AddItem (objRS("establecimiento"))
Me.cbxColegio.Text = (objRS("establecimiento"))
objRS.Close


Me.cbxAgno.Text = ""
Me.cbxAgno.AddItem (Anno)
Me.cbxAgno.AddItem (Anno + 1)

Me.cbxMedio.Text = ""
Me.cbxMedio.AddItem ("Oficina")
Me.cbxMedio.AddItem ("Teléfono")
Me.cbxMedio.AddItem ("Mail")

dtpFec_Pos.Value = Date



    var_sql = "SELECT CONCAT(IF (a.cod_ens = '111' OR a.cod_ens = '996' OR a.cod_ens = '010','',c.des_gra),' ',a.des_ens_abrev)   AS grado" _
& " FROM codigos_ensenanza a" _
& " INNER JOIN grados c ON a.cod_ens = c.cod_ens" _
& " ORDER BY a.ord_ens, grado ASC"
    objRS.Open var_sql, conn

 Me.cbxCurso.Text = ""
 
While Not objRS.EOF

        Me.cbxCurso.AddItem (objRS("grado"))
       
        objRS.MoveNext
Wend
objRS.Close

Me.cbxEnc1.Text = ""
Me.cbxEnc2.Text = ""

Me.cbxEnc1.AddItem ("Vìa Pública")
Me.cbxEnc1.AddItem ("Publicidad en Revistas")
Me.cbxEnc1.AddItem ("Publicidad en Colegio")
Me.cbxEnc1.AddItem ("Sitio Web")
Me.cbxEnc1.AddItem ("Buscador Internet")
Me.cbxEnc1.AddItem ("Mailing")
Me.cbxEnc1.AddItem ("Otros")
Me.cbxEnc1.AddItem ("Oficina de Admisión")

Me.cbxEnc2.AddItem ("Por Calidad Educativa")
Me.cbxEnc2.AddItem ("Por Cercania")
Me.cbxEnc2.AddItem ("Por Valores")
'Me.cbxEnc2.AddItem ("Sitio Web")
Me.cbxEnc2.AddItem ("Por el Deporte")
Me.cbxEnc2.AddItem ("Recomendación de un Apoderado del Colegio")






End Sub

Private Sub Text1_Change(Index As Integer)

If Len(Me.txtRut.Text) > 9 Then
    If Trim(txtRut.Text) <> "" Then
        MsgBox "El rut Excede el Maximo de Numeros"
    End If
    End If
End Sub

Private Sub txtCel_KeyPress(KeyAscii As Integer)
If IsNumeric(Chr(KeyAscii)) Then
Else
KeyAscii = 0
End If
End Sub

Private Sub txtRut_Apo_KeyPress(KeyAscii As Integer)
If IsNumeric(Chr(KeyAscii)) Then
Else
KeyAscii = 0
End If
End Sub

Private Sub txtRut_KeyPress(KeyAscii As Integer)
If IsNumeric(Chr(KeyAscii)) Then
Else
KeyAscii = 0
End If

End Sub


Private Sub txtTel_KeyPress(KeyAscii As Integer)
If IsNumeric(Chr(KeyAscii)) Then
Else
KeyAscii = 0
End If
End Sub

Private Sub txtVerif_KeyPress(KeyAscii As Integer)
If IsNumeric(Chr(KeyAscii)) Or KeyAscii = 107 Or KeyAscii = 75 Then
Else
KeyAscii = 0
End If
End Sub

Private Sub txtVerif_LostFocus()
Dim var_sql
Dim objRS As ADODB.Recordset
Set objRS = New ADODB.Recordset



'var_sql = "select * from "

'conn.Execute var_sql

 
 Dim dig As String
dig = digito(CStr(txtRut.Text))
 
 If UCase(dig) <> UCase(txtVerif.Text) Then
 
    MsgBox "El RUT del Alumno es Invalido .. "
    Me.txtRut.Text = ""
    Me.txtVerif.Text = ""
End If


End Sub




Private Sub txtVerifApo_LostFocus()
 
 Dim dig As String
dig = digito(CStr(txtRut_Apo.Text))
 
 If UCase(dig) <> UCase(txtVerifApo.Text) Then
 
    MsgBox "El RUT del Apoderado es Invalido .. "
    Me.txtRut_Apo.Text = ""
    Me.txtVerifApo.Text = ""
End If

End Sub
