UNIVERSIDAD TÉCNICA DE MANABÍ Facultad de Ciencias Informáticas
TESIS DE GRADO Previa a la Obtención del Título de:
TECNÓLOGO PROGRAMADOR TEMA: “Desarrollar un Sistema Informático de Ingreso de Matriculas y Control de Notas para la Escuela Fiscal Mixta “Portete de Tarqui” de la Parroquia Colón, Ciudad de Portoviejo”
AUTOR:
José Gabriel Macias Zambrano DIRECTOR DE TESIS:
Ing. Iraida Santana Portoviejo - Manabí - Ecuador 2010
ÍNDICE GENERAL
PÁGUINAS PRELIMINARES CERTIFICACIÓN
I
APROBACIÓN
II
DECLARACIÓN DE AUTORÍA
III
AGRADECIMIENTO
IV
DEDICATORIA
V
RESUMEN EJECUTIVO
VI
EXECUTIVE SUMMARY
VII
INTRODUCCIÓN
CAPÍTULO I 1.1. JUSTIFICACIÓN
.
2
1.2. PLANTEAMIENTO DEL PROBLEMA
3
1.3. FORMULACIÓN DEL PROBLEMA
3
1.4. DELIMITACIÓN DEL PROBLEMA
4
1.5. OBJETIVOS
4
1.5.1. OBJETIVO GENERAL
4
1.5.2. OBJETIVO ESPECÍFICO
4
1.6. BENEFICIARIOS
5
1.6.1. DIRECTOS
5
1.6.2. INDIRECTOS
5
CAPÍTULO II 2.1. MARCO CONCEPTUAL
6
2.1.1. MARCO REFERENCIAL
6
2.2. MARCO TEÓRICO
8
CAPÍTULO III 3.1. DISEÑO METODOLÓGICO
18
3.1.1. MÉTODOS
18
2
3.1.2. TÉCNICAS
18
3.1.3. INSTRUMENTOS
18
3.2. RECURSOS
19
3.2.1. RECURSOS HUMANOS
19
3.2.2. RECURSOS MATERIALES
19
3.2.3. RECURSOS TECNOLÓGICOS
19
3.2.4. RECURSOS TÉCNICOS
19
3.2.5. RECURSOS INSTITUCIONALES
20
3.2.6. RECURSOS ECONÓMICOS
20
3.3. PRESUPUESTO
21
CAPÍTULO IV 4.1. CONCLUSIONES
22
4.2. RECOMENDACIONES
22
CAPITULO V 5.1. DESCRIPCIÓN GENERAL DEL SISTEMA
24
5.2. DETERMINACIÓN DE REQUERIMIENTOS
25
5.3. RELACIONES EXISTENTES DE LA BASE DE DATO
26
5.4. DISEÑOS DE MODULOS
27
5.5. CRONOGRAMA VALORADO
28
BIBLIOGRAFÍA
29
3
CERTIFICACIÓN
Ing. Iraida Santana, certifica que la presente tesis ha sido elaborada por el Sr. José Gabriel Macias Zambrano; bajo mi dirección, control y seguimiento. El presente trabajo reúne los requisitos de una investigación y programación concluida mediante el esfuerzo, dedicación y constancia; tanto en parte teórica, investigativa y practica, lo que permite otorgar su originalidad.
Para constancia y validez, firmo el documento.
Atentamente,
Ing. Iraida Santana DIRECTORA DE TESIS
4
UNIVERSIDAD TÉCNICA DE MANABÍ FACULTAD DE CIENCIAS INFORMÁTICAS ESCUELA DE COMPUTACIÓN
TEMA: “Desarrollar un Sistema Informático de Ingreso de Matriculas y Control de Notas para la Escuela Fiscal Mixta “Portete de Tarqui” de la Parroquia Colón, Ciudad de Portoviejo”
TESIS DE GRADO Sometida a consideración del Tribunal de Revisión y Sustentación, legalizada por el Honorable Consejo Directivo como requisito previo a la obtención del Titulo de:
TECNÓLOGO PROGRAMADOR APROBADA POR:
Ing. Mercedes Cedeño Palma
Ing. Rosa Inés Rivadeneira
Ing. Christian Torres Moran
5
DECLARACIÓN DE AUTORÍA
José Gabriel Macias Zambrano, declaró que la presente tesis constituye requisito previo la obtención del título de Tecnólogo Programador bajo la supervisión de la Ing. Iraida Santana
Autorizó al centro de información de la Universidad para que el presente trabajo se convierta en un documento de lectura, de acuerdo a los requisitos establecidos por la institución. Finalmente expresó que el presente trabajo investigativo ha sido de mi autoría, razón por la cual cedo los derechos a la Universidad Técnica de Manabí.
José Macias Autor
6
AGRADECIMIENTO
Primeramente agradezco; dios por darme la vida, el que está sobre todo y ante todo ya que nunca me desampara en ningún momento, también un eterno agradecimiento a esta prestigiosa universidad la cual abre sus puertas a jóvenes como nosotros, preparándonos para un futuro competitivo y formándonos como personas de bien.
En la vida hay momentos de cambios donde hay que tomar decisiones y emprender nuevos propósitos. Yo estoy en ese instante de cambio, evolución, aprendizaje y superación gracias a mis padres, mi esposa y la empresa en la que laboro merecedores de mi agradecimiento, ellos que me brindaron todo el apoyo y la paciencia necesaria para culminar mi carrera.
7
DEDICATORIA
Dedico este proyecto de tesis a Dios, a mis padres y mi esposa e hijo. A Dios porque ha estado conmigo a cada paso que doy, cuidándome y dándome fortaleza para continuar, a mis padres, quienes a lo largo de mi vida han velado por mi bienestar y educación siendo mi apoyo en todo momento, a mi esposa y mi hijo que han depositado su entera confianza en cada reto que se me presentaba sin dudar ni un solo momento en mi inteligencia y capacidad. Es por eso que quiero que sepan y tengan siempre presente que no hay obstáculo capaz de imponerse; si queremos podemos llegar más lejos, si queremos podemos llegar más alto, si queremos podemos hacer lo que sea solo hay que proponérselo.
Es por ellos que soy lo que soy ahora. Los amo con mi vida.
8
RESUMEN EJECUTIVO En la actualidad todas las instituciones públicas o privadas no pueden prescindir de los adelantos tecnológicos, la informática se ha vuelto una herramienta indispensable para el desarrollo y servicio a la comunidad.
Toda la información recopilada que sirvió como argumento para respaldar este programa, se basa en cinco años de observaciones a los problemas vividos a diario en está escuela por la falta de un sistema basado en un software de fácil manejo, el que dará un cambio total a la atención en este lugar que presta tanto servicios a la comunidad de Portoviejo.
Este sistema será un soporte indispensable para la administración de la información de está escuela.
Dicho programa informático desarrollado en la siguiente tesis cumple con las características de normatividad en aplicaciones de escritorio. Posee además factibilidad justificada en su totalidad y respaldada económicamente, cuyo detalle están en el presente informe.
9
EXECUTIVE SUMMARY
As of the present moment all public or private institutions can not do without technological advances, information technology has become an indispensable tool for development and community service.
All compiled information that was useful for arguendo backing this program, is based on five years of observations to the problems enjoyed every day in the school is in favor of the lack of a system based in a user-friendly software, the one that will give a total change to attention in this place that gives help so much to Portoviejo's community.
This system will be an indispensable support for the administration of the information of the school is .
Saying programs information-technology developed in the following thesis he fulfills normatividad's characteristics in applications of desk. He possesses besides feasibility justified completely and backed economically, whose detail they are in the present report.
10
INTRODUCCIÓN Desde su aparición los sistemas informáticos se han convertido en una herramienta valiosa en el campo empresarial gracias a su fácil manejo, a su seguridad mediante su clave de acceso y por su gran capacidad de almacenamiento de datos.
Los registros de toda la información que generan en la Escuela Fiscal Mixta “Portete de Tarqui”, se recopilan y se organizan de forma automática sujeta sin errores, reduciendo espacio de acuerdo al nivel de almacenamiento de dichos documentos y sin pérdida de tiempo.
Ante los problemas que tenia la Escuela, se planteó como propuesta realizar una base de datos que permitiera obtener, el registro y control de las matriculas y notas para gestionar los datos de la información de una forma rápida, fácil, adecuada, en orden y actualizada que conlleve a un mejoramiento educacional brindando un mejor rendimiento y desempeño en las actividades que se realiza, conociendo nuevas opciones y oportunidades al ser implementado el sistema como alternativa de solución y todo esto fue realizado dando resultados excelentes para el bien de la institución y de la comunidad.
Este sistema informático es una herramienta de apoyo eficiente, que permite automatizar y obtener datos exactos, además es muy importante y trascendental, en el contexto socioeconómico y político, esto permite tener mayor facilidad para el manejo de la información.
11
CAPÍTULO I
1.1. JUSTIFICACIÓN Después de haber realizado las investigaciones en la Escuela Fiscal Mixta "Portete de Tarqui" se determinó que con el aumento de estudiantes en los últimos años se registró una gran cantidad de información por parte del departamento de secretaría estos procesos se realizaban sin mecanismos adecuados que agilicen, garanticen y organicen la información de manera segura sin riesgo de perdida o alteración de la información de los estudiantes, por está razón se consideró que el desarrollo del Sistema Informático es de fundamental importancia para la institución Educativa, logrando brindar servicios modernos y actualizados a quienes lo soliciten.
La implementación del sistema se la planteo a la Escuela con la finalidad de mejorar sus servicios para el mismo plantel educativo y brindar la información de una forma rápida moderna y actualizada que conlleve a un mejoramiento institucional y así elevar estándares de calidad. Durante el tiempo de estudios realizados se han asimilado los conocimientos impartidos por excelentes catedráticos; su dedicación por formar estudiantes emprendedores y capacitados para vencer nuevos retos, no ha sido en vano, ya que se venció uno de ellos, que es la finalización de esté proyecto que sirvió de sostén a ideales afines.
Con la culminación del sistema se ahorro tiempo y dinero; y al ingresar la información se evitó la realización de reportes y cálculos manuales. La finalización
12
del proyecto servio como guía para los estudiantes aportando nuevos conocimientos respecto a los sistemas informáticos.
1.2. PLANTEAMIENTO DEL PROBLEMA
Los procesos que se realizan en la Escuela Fiscal Mixta “Portete de Tarqui” son muy rápidos, reduciendo espacio, perdida de la información y la pérdida de tiempo al momento de realizar el proceso de forma manual, ya que tienen los medios necesario para apresurar el trabajo por está razón se implementó el sistema informático.
En está Institución Educativa resulto productivo, ya que se evitó la aglomeración y acumulación de los datos de las matriculas y notas, y así se brindó una mejor atención, se realizan ajustes satisfactorios que son beneficiosos para la institución y la comunidad.
1.3. FORMULACIÓN DEL PROBLEMA
¿Cómo incide la implementación de un Sistema Informático de ingreso de Matriculas y control de Notas para la Escuela Fiscal Mixta “Portete de Tarqui”?
13
1.4. DELIMITACIÓN DEL PROBLEMA
La presente tesis se llevo a cabo en la Escuela Fiscal Mixta "Portete de Tarqui", ubicado en la Parroquia Colón de la ciudad de Portoviejo provincia de Manabí en el periodo 2009 - 2010.
1.5. OBJETIVOS
1.5.1. OBJETIVO GENERAL
Mejorar los procesos mediante la implementación de un sistema informático para llevar los registros de Matriculas y control de Notas para la Escuela Fiscal Mixta "Portete de Tarqui", de la Parroquia Colón de la ciudad de Portoviejo provincia de Manabí.
1.5.2. OBJETIVO ESPECÍFICO Crear registros que contengan los datos de los estudiantes Obtener en orden y actualizada la información de datos personales de los estudiantes Controlar el ingreso de las notas de los trimestres Controlar de manera eficaz las inscripciones de matriculas para cada uno de los estudiantes Capacitar al personal en el manejo de la nueva información que presentará el sistema Tener un mejor control en la organización de los documentos
14
Permitir la obtención inmediata de reportes de matriculas y notas
1.6. BENEFICIARIOS
1.6.1. DIRECTOS
Al implementar esté sistema informático los beneficiarios directos serán las personas que acuden a la Escuela Fiscal Mixta Portete de Tarqui.
1.6.2. INDIRECTOS
La comunidad de la parroquia Colón de la ciudad de Portoviejo.
15
CAPÍTULO II
2.1. MARCO CONCEPTUAL
2.1.1. MARCO REFERENCIAL
HISTORIA
La informática se está introduciendo en nuestra actividad diaria de un modo vertiginoso y está siendo una necesidad conocerla y utilizarla bien como usuario o como profesionales.
Lo primero que se debe plantear una persona interesada en esta materia y que se quiera introducir en el mundo de la informática es conocer en que consiste está ciencia tecnológica y en que campos de acción se puede aplicar.
Para ello es que se propone la investigación del presente proyecto de tesis y que tiene que ver con la Escuela Fiscal Mixta "Portete de Tarqui" de la Ciudad de Portoviejo, que fue creada como municipal el 2 de Mayo de 1950, iniciándose con 120 alumnos en ambos sexos.
En la actualidad cuenta con un local propio moderno y funcional, ubicado en la vía Pachinche y 2 de Mayo, en el recinto el Cady de la parroquia Colón, Ciudad de Portoviejo, y cuenta con 250 alumnos entre niñas y niños, que oscilan de los 4 a los 14 años de edad, los mismos que en su mayoría son de escasos recursos
16
económicos. Su actual Director es el Lcdo. Humberto Palacios Saltos, contando con 10 profesores, 1 conserje.
Lo que nos da la idea de la importancia que reviste la modernización de sus controles de ingresos y calificaciones, tarea fácil de llevar a la practica porque se cuenta con las herramientas tecnológicas necesarias para este cometido y que redundará en beneficio de sus estudiantes y una forma más ágil y eficiente de servir a los mismos y a la colectividad Manabita.
Estos cambios que proponemos modificaran sustancialmente la distribución del trabajo, el uso del tiempo y la agilidad de los procesos, ahorro de dinero y materiales de oficina, como también un ahorro en el capital de trabajo que va a posibilitar su traslado en inversión tecnológica para la mejora de la calidad de los mismos.
Las exigencias actuales exigen directores de escuelas, profesores, trabajadores administrativos y de servicios junto a alumnos y padres de familias, capaces de generar iniciativas, tomar decisiones, conocimiento global e integral, visión estratégica, habituados al trabajo en equipo abiertos a los cambios y dispuestos a transitar los caminos más innovadores para cumplir los objetivos trazados y a través de esta investigación poder llevarla a la realidad.
Este es el siglo del alto desarrollo científico y tecnológico es al mismo tiempo el siglo en el cual las brechas mantiene contradicciones inmensas sin precedentes ya que el valor del conocimiento no beneficia a la mayoría de la población.
17
Lo correcto seria que la técnica tenga sentido contribuyendo al desarrollo humano, que incide directamente sobre los perfiles de desempeño de las personas y las organizaciones en los procesos ocupacionales, para permitir armonizar la incorporación de herramientas técnicas modernas, teniendo como eje la solución de problemas para mejorar la calidad de vida de la población.
Este sistema a implementar determinará los elementos básicos necesarios para poder desarrollar un software que mejore los procesos, utilizando códigos que darán mayor realce y presentación a las interfaces del usuario, las que pueden ser descargadas de paginas Web, dedicadas a la difusión de información sobre Visual Basic y otros lenguajes pero siempre ajustándose a las necesidades de esta institución educativa.
Bajo estos escenarios diremos que esta propuesta esta relacionada íntimamente con la mejora continua de la atención de sus usuarios (padres de familia), como también a la satisfacción de los objetivos de la escuela, rebasando el concepto de innovación en base a mejorar incorporando tecnología de punta, que abarca por el momento solo estas áreas y procesos.
2.2. MARCO TEÓRICO "Cualquier conjunto de datos organizados para su almacenamiento en la memoria de un ordenador o computadora, diseñado para facilitar su mantenimiento y acceso de una forma estándar. La información se organiza en campos y registros. Un
18
campo se refiere a un tipo o atributo dé información, Y un registro, a toda la información sobre un individuo.
Los datos pueden aparecer en forma de texto, números, gráficos, sonido o vídeo. Normalmente las bases de datos presentan la posibilidad de consultar datos, bien los de un registro o los de una serie de registros que cumplan una condición”. 1
"Desde su aparición en la década de 1950, estas aplicaciones se han hecho imprescindibles para las sociedades industriales. La primera base de datos para PC data de 1980; era el dBase II, desarrollado por el ingeniero estadounidense Wayne Ratliff. Desde entonces, su evolución ha seguido paralela a la que ha experimentado el software, y hoy existen desde bases de datos para una utilización personal hasta bases de datos corporativas, soportadas por grandes sistemas informáticos”. 2
Normalmente las bases de datos presentan la posibilidad de consultar datos, bien los de un registro o los de una serie de registros que cumplan una condición.
Visual Basic "El lenguaje de programación BASIC (Beginner's All purpose Simholic Instruction Code) se creó en el año 1964 como una herramienta destinada a principiantes, buscando una forma sencilla de realizar programas, empleando un lenguaje similar
1 2
MICROSOFT VISUAL Basic 6.0 MENTOR ENCICLOPEDIA TEMÁTICA ESTUDIANTIL OCÉANO (1997)
19
al que se utiliza en la vida cotidiana y con instrucciones muy sencillas. Teniendo en cuenta el año de su creación, este lenguaje cubría la mayoría de las necesidades para la ejecución de programas. Hay que tener en cuenta que las maquinas existentes en esa época estrenaban los transistores como elementos de conmutación, los ciclos de trabajo llegaron a la inimaginable cifra de 10.000 x seg. y la memoria en palabras de unos pocos K's en toroides de ferrita”. 3
Programación Visual Basic
La mayoría de aplicaciones Windows, así como otros programas, emplean una Interfaz Gráfica de Usuario (GUI), consistente en una o más pantallas llenas de objetos, menús, botones, líneas, cuadros de edición etc, todos inactivos hasta que el usuario provoca un evento al hacer clic con el ratón sobre un botón, barra de menús, en la formas, o un comando de tecla o de voz. Una vez que el evento ocurre, el usuario espera que cada objeto realice su función y se comporte de una manera confiable.
Este requerimiento de confiabilidad y predecibilidad es el que hace que la programación orientada a objetos y manejada por eventos sea perfecta para el desarrollo de aplicaciones Windows. Visual Basic proporciona un ambiente de desarrollo donde el trabajo tales como objetos y eventos llega a ser un proceso directo, y lo más importante, bien estructurado.
3
Manual de Visual Basic,www.canalvisualbasic.net
20
Eventos
Son las acciones que se producen y que nos interesan identificar para establecer algún tipo de respuesta por parte del objeto.
Propiedades
Es un atributo nominal de un objeto de programación. Las propiedades definen las características del objeto, tales como tamaño, color, longitud, diámetro, o algunas veces, la manera en la cual se comporta el objeto, por ejemplo si un cuadro de texto aceptará líneas de texto múltiples o sencillas.
Métodos
Una descripción completa de un objeto, no se limita a sus propiedades, debe comprender una definición de lo que hace.
Variables
Una variable es una ubicación de almacenamiento temporal con nombre que se encuentra en memoria. Una variable es capaz de contener un cierto tipo de datos que pueden modificarse durante la ejecución del programa.
Las variables en Visual Basic, deben limitarse a 255 caracteres, empezar con un carácter alfabético y no pueden contener un punto. Tampoco se pueden usar
21
nombres de variables, las palabras reservadas como por ejemplo: Sub, End o Function.
Constantes
Como su palabra lo dice es Información que no varía hace más fácil la comprensión del código y permite modificar un valor en un solo lugar no ocupa espacio extra.
Alcances de las variables
El alcance de las variables se refiere al área del programa en las cuales es visible la variable; es decir en áreas del proyecto tendremos disponible las variables. Las variables declaradas dentro de funciones o procedimientos, serán de alcance local. Estas variables son reinicializadas cada vez que se ejecuta el procedimiento. Las variables de nivel de formulario, estarán disponibles para todos los procedimientos del formulario.
Vectores y Matrices
Para declarar matrices debemos colocar entre paréntesis el número de elementos de los que constará a continuación del nombre de la variable. De esta forma tenemos un vector de 10 elementos identificados del O al 9. Podemos obligar a que el primer elemento de una matriz tenga el índice con valor 1.
22
Operadores
La tabla siguiente muestra un conjunto de operadores comunes que soporta Visual Basic para utilizarlos en programación:
Funciones
Es un procedimiento que realiza una tarea específica dentro de un programa y al final se obtiene un valor de retorno. Una función se define en un modulo que inicia con la instrucción Function y termina con la instrucción End Function
Conexión a una Base de Datos
El Control de Datos (Data) es un control integrado para conectar una aplicación Visual Basic con una fuente de datos que se selecciona. Los controles de dalos proporcionan una forma visual y fácil para navegar por los campos, registros y tablas de una o más Bases de Datos. También se usan para enlazar algunos controles, como cuadros de texto, etiquetas, cuadros de dibujo, etc. con los campos de tablas que se seleccionan en su base de datos. Una vez que un control, como un cuadro de texto, está asociado a un campo en particular, cualquier cambio en el contenido del cuadro de texto se registra automáticamente en el campo asociado. En pocas palabras, los controles de datos asociados permitirán que se creen aplicaciones de acceso de datos que requieran muy poca o ninguna codificación.” 4
4
Manual de Visual Basic
23
Data Grid
Gran parte de la información por que trata los programas informáticos, se presentan en forma de cuadrículas de columnas y filas, como las que se pueden halar en una hoja de cálculo. El control de DATA GRID es un nuevo control en VISUAL BASIC 6.0, le permite desplegar datos desde una base de datos en formato de cuadrículas. El control DATA GRID está diseñada para utilizarse en los nuevos objetivos de DATOS ACTIVES x (ADO).5
Formularios
Es un contenedor en el que están todos los demás controles (etiquetas, cuadros de textos e imágenes) que conforman la interfaz del usuario de un programa, la mayoría de programas usan unas series de formularios.6
Formularios MDI
MDI significan interfaz de documentos múltiples, que es el término utilizado por MICROSOFT para un entorno de ventas en donde una de ellas, denominado contenedor MDI o parte MDI, contiene muchas otras ventanas, denominadas normalmente formularios hijos.7
5
JEFF SPOTTS, Brian Spelt. Visual Basic. Edición Especial, 1999 JEFF SPOTTS, Brian Spler. Visual Basic. Edición Especial, 1999 7 JEFF SPOTTS, Brian Spler. Visual Basic. Edición Especial, 1999 6
24
Consultas
Es un programa gestor de base de datos, tiene que ocuparse de buscar rápidamente los datos de un registro que nosotros queramos consultar, y presentarlo en pantalla.
Esta es una de las principales ventanas de estos programas, pues el tiempo que interviene en localizar una información es infinitamente menor que el que emplearía una persona para buscar esta información manualmente en un enorme fichero. Las consultas sirven para recoger datos de las tablas para una mejor comprensión del Usuario.8
Lenguaje de Consulta SQL
Hace algunos años apareció un sistema de gestión de Base de Datos que se ha convertido en un estándar en la gestión de datos.
SQL.- Son las iníciales de Structured Query Languaje (Consulta mediante lenguaje estructurado).
En la gestión de datos, es necesario utilizar un lenguaje fácil, sencillo de manejar y rápido.
El SQL ofrece ampliamente dichos opciones mediante consultas generales bajo determinados parámetros que se especifican. 8
MICROSOFT CORPORATION. Manual del Usuario Access. Mc Graw-Hill, 1994
25
En realidad es un selector de datos que se conecta con la Base de datos que se le indique y se mueve uno a uno por todos los registros filtrando y analizando los datos para encontrar lo que se necesite.9 El lenguaje de consulta estructurado (SQL) es un lenguaje de base de datos normalizado, utilizado por el motor de base de datos de Microsoft Jet. SQL se utiliza para crear objetos QueryDef, como el argumento de origen del método OpenRecordSet y como la propiedad RecordSource del control de datos. También se puede utilizar con el método Execute para crear y manipular directamente las bases de datos Jet y crear consultas SQL de paso a través para manipular bases de datos remotas cliente - servidor."
Componentes del SQL
El lenguaje SQL está compuesto por comandos, cláusulas, operadores y funciones de agregado. Estos elementos se combinan en las instrucciones para crear, actualizar y manipular las bases de datos.
Comandos
Existen dos tipos de comandos SQL: Los DLL que permiten crear y definir nuevas bases de datos, campos e índices. Los DML que permiten generar consultas para ordenar, filtrar y extraer datos de la base de datos.10 9
Manual de Visual Basic y SQL, www.canalvisualbasic.net
26
Base de Datos Se define a una Base de Datos como un fichero en el cual se almacena informaci贸n de cualquier tipo.
En dicho fichero la informaci贸n se almacena en campos, por ejemplo, se puede almacenar el nombre y el apellido de las personas de modo separado, de esta forma se obtiene del fichero todos los nombres o todos los apellidos, ya sea de forma separada como de forma conjunta.
"Aunque en realidad se debe tener en cuenta, que una base de datos, tal y como se la conoce, no es solo el fichero en donde se guardan los datos, sino que en dicho fichero se encuentra la estructura de los datos, o sea, para saber que longitud tiene cada campo, es necesario saber como se llama el campo y que longitud en caracteres tiene, as铆 como el tipo de datos que se almacenan en dicho campo, por que guarda desde letras a n煤meros e incluso otros datos no sofisticados, esto depende de la estructura de la base de datos y del sistema que se utilice para saber cual es dicha estructura."11
10
11
Manual de Visual Basic, www.canalvisualbasic.net MICROSOFT CORPORATION. Manual del Usuario Access. Me Graw-Hill, 1994
27
CAPÍTULO III
3.1. DISEÑO METODOLÓGICO
3.1.1. MÉTODOS
Los métodos que se utilizaron en está investigación son los siguientes:
No experimental.-Como su nombre lo indica esté método se utilizó para el desarrollo del proyecto de investigación a estudiar; del cual no se llevó a cabo ninguna clase de prueba Inductivo.- La forma de trabajar con esté método es inducir y centrar con respecto a la investigación que se realizó mostrando características y propiedades bajó una observación para hacer conocer razones y hechos particulares en una forma general Bibliográfico.- Ayudó a recabar información para la investigación, para ello se consultó en libros, documentos de archivos, folletos y páginas Web.
3.1.2. TÉCNICAS Observación Entrevista
3.1.3. INSTRUMENTOS Formulario de Entrevista
28
Fichas Bibliográficas
3.2. RECURSOS
3.2.1. HUMANOS Miembros de la Escuela Fiscal Mixta "Portete de Tarqui" Director de Tesis Autor del Proyecto
José Gabriel Macías Zambrano
3.2.2. MATERIALES Textos Papel bond CD's Materiales de oficina (esfero, lápiz, borrador, carpetas, clips, perforadora,
grapadora, papel copia)
3.2.3. TECNOLÓGICOS Gestor de Base de Datos ACCESS Microsoft Visual Basic 6.0 Edición Empresarial
3.2.4. TÉCNICOS Hardware Software , Versión 2002
29
Computador Pentium 4 de 2.0 GHZ, 512 MB DE RAM
3.2.5. INSTITUCIONALES Universidad Técnica de Manabí Autoridades de la Escuela "Portete de Tarqui"
3.2.6. ECONÓMICOS
Los recursos económicos son solventados por el ejecutor del proyecto.
30
3.3. PRESUPUESTO
La investigación tuvo un costo de $518.02 dólares, valor que se cubrió con el aporte del autor de la investigación, el mismo que fue distribuido de la siguiente manera:
Unidad
Cantidad
Valor Unitario Valor Total
Recolección de datos (fotocopias)
150
0.03
4.50
CD-RW
7
1.40
9.80
Anillado
1
1.60
1.60
Resma de hojas DIN A4
7
4.50
31.50
Fotocopias del proyecto de Tesis
115
0.03
3.45
Refill de Tinta Negra
1
7.00
7.00
Refill de Tinta Color
1
9.00
9.00
Cartucho de tinta negra
1
21.00
21.00
Cartucho de tinta a color
1
23.00
23.00
Movilización
60.00
Impresión de la tesis
700 hojas
0.20
140.00
Internet
10 horas
1.00
10.00
Empastado de la tesis
6 ejemplares
6.00
36.00
Impresión de la tesis a color
250
0.40
100.00
Imprevistos 10%
30.00
TOTAL:
$ 518.02
31
CAPÍTULO IV
4.1. CONCLUSIONES Y RECOMENDACIONES
4.1.1. CONCLUSIONES
Luego de terminado el trabajo de investigación realizado con el apoyo de la informática, mediante la creación de un programa para el funcionamiento de la Escuela Fiscal Mixta Portete de Tarqui, se concluye:
Las actividades del establecimiento escolar en general fueron muy beneficiadas
Mejoró sustancialmente la calidad de atención saliendo beneficiadas especialmente la institución educativa
Con información que se almaceno en la base de dato se pueden realizar investigaciones estadísticas
4.1.2. RECOMENDACIONES
Toda institución educativa debe tener un programa que permita realizar las labores de atención y de investigación más eficientes
La utilización de un programa como esté debe de universalizarse, tomando en consideración todos los programas que para esté tipo de atención existan en el país, a fin de que teniendo un solo programa estandarizado a nivel nacional,
32
se pueda organizar de manera uniforme la atención de las instituciones educativas tanto como públicas y privadas en el Ecuador
Al universalizar un programa de matriculación y control de notas para las instituciones educativas, estaríamos como consecuencia estandarizando también los protocolos de atención referentes al trabajo que se realiza en las entidades educativas existentes en el país.
33
CAPÍTULO V
PROPUESTA
PORTETE TARQUI
5.1. DESCRIPCIÓN GENERAL DEL SISTEMA El programa llamado Portete Tarqui es un sistema informático que sirve para llevar registros de matriculación y control de notas que se dan en la Escuela Fiscal Mixta Portete de Tarqui, de una manera eficaz y automatizada para saber con exactitud todos los movimientos que constantemente se dan, como son las calificaciones, conductas, materias, datos del estudiante, etc.
El presente sistema informático lo conforman los siguientes módulos:
Formulario inicio de sesión
Formulario de bienvenida al sistema
Formulario Principal (MDI)
Formularios de Ingreso y modificación del estudiante
Formularios de ingreso y modificación del matriculas
Formularios de ingreso y modificación de las materias
Formularios de ingreso y modificación clave del sistema
34
Formularios de ingreso y modificación de datos de la institución
Formularios de ingreso y modificación de calificaciones
Formularios de ingreso y modificación del profesor
Formularios de reportes
5.2. DETERMINACIÓN DE REQUERIMIENTOS
Se requiere de un sistema de información basado en computadoras, para registrar información sobre matriculación y control de notas para la Escuela Fiscal Mixta Portete de Tarqui, para facilitar o mejorar las actividades que realiza en la misma.
Los requerimientos principales del equipo de computación que se necesita para un óptimo funcionamiento son:
Marca Mainboard:
Intel
Tipo de procesador:
Dual Core de 2.0 GHz o Superior
Tamaño de disco duro:
160 Gb de espacio inicial o Superior
Memoria RAM:
1 GB o Superior
Monitor:
VGA o SVGA
Unidad de CD:
DVD-Rom
Impresora:
Opcional
35
5.3. RELACIONES EXISTENTES DE LA BASE DE DATO
36
37
5.4. DISEÑOS DE MÓDULOS
PORTETE TARQUI
DATOS
VER
HERRAMIENTAS
REPORTES
AYUDA
REGISTRAR MATERIA MATERIAS ACTUALIZACIÓN DE MATERIAS
BARRA HERRAMIENTA
REGISTRAR PROFESOR BARRA ESTADO
PROFESORES
CLAVES CREAR NUEVA CLAVE
ACTUALIZACIÓN DE PROFESORES MODIFICAR CLAVE
REGISTRAR AÑO
ACERCA DEL.. MEJORES ESTUDIANTES EN EL PERIODO LISTA DE ESTUDIANTES POR AÑO BASICA
AÑO DE EDUCACIÓN BÁSICA ACTUALIZACIÓN DE AÑOS
ELIMINAR CLAVE
NOTAS DEL AÑO BASICA POR MATERIA
REGISTRAR ESTUDIANTE ESTUDIANTES
CONFIGURACIÓN
NOTAS DEL ESTUDIANTE POR TRIMESTRE
ACTUALIZACIÓN DE ESTUDIANTES REGISTRAR MATRICULA
NOTA GENERAL DEL ESTUDIANTE
ACTUALIZACIÓN DE MATRICULAS
CARNET DEL ESTUDIANTE
MATRICULAS
ACTA DE MATRICULA
INGRESO DE NOTAS S
CERTIFICADO DE CONDUCTA
SALIR
DATOS DEL PROFESOR
38
5.5. CRONOGRAMA VALORADO
TIEMPO EN MESES MES 1
MES 2
MES 3
MES 4
MES 5
MES 6
ACTIVIDADES
Elaboraciรณn y presentaciรณn del proyecto Estructuraciรณn de instrumentos Investigaciรณn de la parte Teรณrica Aplicaciรณn de instrumentos de trabajo, tabulaciรณn de los resultados y elaboraciรณn de los cuadros estadรญsticos. Presentaciรณn del trabajo en el Departamento correspondiente. Sustentaciรณn de la investigaciรณn.
HUMANOS 1
2
3
4
X
X
X
X
1
X
2
X
3
X
4
X
1
X
2
X
3
4
1
2
3
4
1
2
3
4
1
2
3
Facilitadores y autores del proyecto. Autoras y director de tesis. Autoras y director de tesis.
X
X
X
X
X
X
X
X
X
X
X
X
X
X
MATERIALES
COSTOS
4
X
X
Carpetas y Documentos
35,00
Instrumentos Papelotes
50,00
Textos, Folletos, Internet, Copias.
60,00
Autoras poblaciรณn involucradas.
Instrumentos.
100,00
Autoras y Tribunal.
Trabajo: empastado, anillado y grabado.
150,00
Autoras y Tribunal.
Tesis Final
123,02
TOTAL
518.02
39
BIBLIOGRAFÍA
BATINI, CERI Y NAVATHE. Diseño Conceptual de Bases de Datos. Adisson – Wesley. 1994. Biblioteca de Consulta Microsoft ® Encarta ® 2008. HALVARSON, Michael, VISUAL BASIC, (1982). KORTH, Henry y SILVERSCHATZ, Abraham, FUNDAMENTOS DE BASE DE DATOS, (1981). Manual de Visual Basic. MENTOR ENCICLOPEDIA TEMÁTICA ESTUDIANTIL OCÉANO (1997) MICROSOFT VISUAL Basic 6.0 PRESSMAN Roger S. Ingeniería del Software. McGraww-Hill. Tercera edición. 1993. Primera Edición MC.GRAW HILL. Españal993 www.canalvisualbasic.net
40
41
42
1. CODIFICACIĂ“N DEL PROGRAMA
1.1. FORMULARIO INGRESO AL SISTEMA
Dim Tabla As New ADODB.Recordset Dim Accede As Boolean Dim Oportunidades As Integer
Private Sub LlenarUsuarios() On Error GoTo salir Tabla.Open "Select nombre, iduser from usuarios order by nombre", Base.ConnectionString, adOpenDynamic usuarionombre.Clear While Not Tabla.EOF usuarionombre.AddItem Tabla!nombre usuarionombre.ItemData(usuarionombre.NewIndex) = Tabla!iduser Tabla.MoveNext Wend Tabla.Close Set Tabla = Nothing Exit Sub salir: If MsgBox(Err.Description, vbExclamation + vbRetryCancel) = vbRetry Then LlenarUsuarios Else Unload Me End Sub
Private Sub boton_Click(Index As Integer) On Error GoTo salir Select Case Index Case 0 If usuarionombre.ListIndex = -1 Then Exit Sub
43
If Tabla.State = 1 Then Tabla.Close Set Tabla = Nothing End If Tabla.Open
"Select
clave
from
usuarios
usuarionombre.ItemData(usuarionombre.ListIndex),
where
iduser
=
"
&
Base.ConnectionString,
adOpenDynamic If Tabla!clave <> Encripta(password.Text, 1) Then Oportunidades = Oportunidades + 1 If Oportunidades = 3 Then MsgBox "Oportunidades acabadas. Usted no es un usuario apto para acceder al sistema", vbExclamation Accede = False Unload Me Else MsgBox "Clave incorrecta. Lleva " & Oportunidades & " de 3 oportunidades", vbExclamation End If Else Accede = True Unload Me End If Case 1 Accede = False Unload Me End Select Exit Sub salir: If MsgBox(Err.Description, vbExclamation + vbRetryCancel) = vbRetry Then boton_Click (Index) Else Unload Me End Sub
44
Private Sub Form_Load() Accede = False Oportunidades = 0 LlenarUsuarios End Sub
Private Sub Form_Unload(Cancel As Integer) If Accede = True Then If Tabla.State = 1 Then Tabla.Close Set Tabla = Nothing End If UsuarioId = usuarionombre.ItemData(usuarionombre.ListIndex) End If End Sub
Private Sub password_KeyPress(KeyAscii As Integer) If KeyAscii = 13 Then If boton(0).Enabled = True Then boton(0).Value = True End If End Sub
1.2. FORMULARIO DE BIENVENIDA
Dim Tabla As New ADODB.Recordset Dim C As Integer
Private Sub Form_Load() C=0 Tabla.Open "Select * from institucion", Base.ConnectionString, adOpenStatic If Not Tabla.EOF Then If Tabla!nombre <> "" Then NombreInstitucion = Tabla!nombre
45
If Tabla!Direccion <> "" Then DireccionInstitucion = Tabla!Direccion If Tabla!Director <> "" Then DirectorInstitucion = Tabla!Director MaxParciales = Tabla!nparciales MaxAlumnos = Tabla!MaxAlumnos MaxNota = Tabla!nmaxima End If If Tabla.State = 1 Then Tabla.Close Set Tabla = Nothing End If autoriza(0).Caption = "Instituci贸n: " & NombreInstitucion autoriza(1).Caption = "Director: " & DirectorInstitucion Timer1.Interval = 60 '60 estaba actual mente End Sub
Private Sub Timer1_Timer() C=C+1 ProgressBar1.Value = C If C = 100 Then Unload Me End If End Sub
1.3. FORMULARIO PRINCIPAL
Dim TablaReporte As New ADODB.Recordset
Private Sub aboutof_Click() acercade.Show 1 End Sub
Private Sub addnewuser_Click()
46
nuser.Show 1 End Sub
Private Sub asentarmatricula_Click() matricula.Show 1 End Sub
Private Sub barraestado_Click() If barraestado.Checked = True Then barras.Visible = False barraestado.Checked = False Config.esta = False Else barras.Visible = True barraestado.Checked = True Config.esta = True End If MenuVer End Sub
Private Sub barrah_ButtonClick(ByVal Button As MSComctlLib.Button) Select Case Button.Index Case 9: Unload central End Select End Sub
Private
Sub
barrah_ButtonMenuClick(ByVal
ButtonMenu
As
MSComctlLib.ButtonMenu) Select Case ButtonMenu.Index Case 1 Select Case Left(ButtonMenu.Key, 4) Case "estu"
47
nestudiante.Show 1 Case "matr" matricula.Show 1 Case "prof" profesor.Show 1 Case "mate" materia.Show 1 Case "clas" curso.Show 1 End Select Case 2 Select Case Left(ButtonMenu.Key, 4) Case "estu" mestudiante.Show 1 Case "matr" mmatricula.Show 1 Case "prof" mprofesor.Show 1 Case "mate" mmateria.Show 1 Case "clas" mcurso.Show 1 End Select Case 3 notas.Show 1 End Select End Sub
Private Sub beststudentintime_Click() mejor.Show 1 End Sub
48
Private Sub deleteuser_Click() delusers.Show 1 End Sub
Private Sub listgeneralofstudent_Click() listadogeneral.Show 1 End Sub
Private Sub matriculas_Click() curso.Show 1 End Sub
Private Sub MDIForm_Load() On Error GoTo salir Cuadro.Height = 10000 Configuracion atras: barras.Panels.Item(1).Text = Format(Date, "dddd dd \de MMMM \de yyyy") mnubherramienta.Checked = Config.herra barrah.Visible = Config.herra barras.Visible = Config.esta barraestado.Checked = Config.esta a$ = AbrirBase If a$ <> "" Then If MsgBox("No se ha podido establecer una conexi贸n con la base de datos. Motivo: - " & a$ & "-", vbRetryCancel + vbInformation) = vbRetry Then GoTo atras archivo.Enabled = False mnuver.Enabled = False reportes.Enabled = False mnuusuarios.Enabled = False mnuayuda.Enabled = False
49
Exit Sub End If TablaReporte.Open
"Select
count(*)
as
total
from
usuarios",
Base.ConnectionString, adOpenDynamic If TablaReporte!total > 0 Then UsuarioId = 0 : TablaReporte.Close loginform.Show 1 If UsuarioId = 0 Then Unload Me: Exit Sub End If inicio.Show 1 If MaxParciales = 0 Then MaxParciales = 3 If MaxNota = 0 Then MaxNota = 20 If TablaReporte.State = 1 Then TablaReporte.Close Exit Sub salir: If MsgBox(Err.Description, vbExclamation + vbRetryCancel) = vbRetry Then MDIForm_Load End Sub
Private Sub MDIForm_Unload(Cancel As Integer) MENSAJE = MsgBox("¿Está seguro que desea salir del sistema?", vbInformation + vbYesNo) If MENSAJE = vbYes Then If TablaReporte.State = 1 Then TablaReporte.Close If Base.State = 1 Then Base.Close End End If Cancel = 1 End Sub
Private Sub mnuActaMatriculas_Click() Load RptMatriculas
50
RptMatriculas.Show 1 End Sub
Private Sub mnubherramienta_Click() If mnubherramienta.Checked = True Then mnubherramienta.Checked = False barrah.Visible = False Config.herra = False Else barrah.Visible = True Config.herra = True mnubherramienta.Checked = True End If MenuVer End Sub
Private Sub mnucascada_Click() central.Arrange vbCascade End Sub
Private Sub mnucarnet_Click() Load RptCarnet : RptCarnet.Show 1 End Sub
Private Sub mnuCertConducta_Click() RptCertificadoConducta.Show 1 End Sub
Private Sub mnuCertMatricula_Click() RptCertMatricula.Show 1 End Sub
51
Private Sub mnuDatosProfesor_Click() Load RptProfesor : RptProfesor.Show 1 End Sub
Private Sub mnuingresoNotas_Click() notas.Show 1 End Sub
Private Sub mnuLibretas_Click() ReportLibreta.Show 1 End Sub
Private Sub modificarmatricula_Click() mmatricula.Show 1 End Sub
Private Sub modificpassword_Click() mclave.Show 1 End Sub
Private Sub mosaichorizontal_Click() central.Arrange vbHorizontal End Sub
Private Sub mosaicvertival_Click() central.Arrange vbVertical End Sub
Private Sub nmateria_Click() materia.Show 1 End Sub
52
Private Sub notaofstuden_Click() ReportNotas.Show 1 End Sub
Private Sub notesofbasicyear_Click() notasmaterias.Show 1 End Sub
Private Sub nuevoestudiante_Click() nestudiante.Show 1 End Sub
Private Sub opci_Click() opciones.Show 1 End Sub
Private Sub organizeicons_Click() central.Arrange vbArrangeIcons End Sub
Private Sub profe_Click() profesor.Show 1 End Sub
Private Sub regestudiantes_Click() mestudiante.Show 1 End Sub
Private Sub regofaniosbasicos_Click() mcurso.Show 1 End Sub
53
Private Sub rofmaterias_Click() mmateria.Show 1 End Sub
Private Sub rofprofesores_Click() mprofesor.Show 1 End Sub
Private Sub salir_Click() MENSAJE = MsgBox("¿Está seguro que desea salir del sistema?", vbInformation + vbYesNo) If MENSAJE = vbYes Then If TablaReporte.State = 1 Then TablaReporte.Close If Base.State = 1 Then Base.Close End End If End Sub
1.4. FORMULARIO REGISTRAR MATERIA
Dim Tabla As New ADODB.Recordset
Private Sub bloquear(opcion As Boolean) nombre.Enabled = opcion rnumero.Enabled = opcion Label1(0).Enabled = opcion Label1(1).Enabled = opcion boton(0).Enabled = Not opcion End Sub
Private Sub boton_Click(Index As Integer) On Error GoTo salir
54
Select Case Index Case 0 bloquear (True) nombre.Text = "" Tabla.Open
"Select
count(nombre)
as
total
from
materias",
Base.ConnectionString, adOpenForwardOnly rnumero.Text = Tabla!total + 1 If Tabla.State = 1 Then Tabla.Close Set Tabla = Nothing End If If nombre.Enabled = True Then nombre.SetFocus boton(1).Enabled = False Case 1 Tabla.Open "Select count(nombre) as total from materias where nombre = '" & nombre.Text & "'", Base.ConnectionString, adOpenForwardOnly If Tabla!total Then MsgBox "La materia " & nombre.Text & " ya ha sido registrada en el sistema. Verifique el nombre y despu茅s vuelva a intentarlo", vbExclamation, "Profesor ya registrado" Tabla.Close Set Tabla = Nothing Exit Sub End If Tabla.Close Set Tabla = Nothing Base.Execute "Insert into materias(nombre) values('" & nombre.Text & "')" bloquear (False) boton(1).Enabled = False MsgBox "Materia " & nombre.Text & ", registrada a perfecci贸n", vbInformation Case Else Unload Me
55
End Select Exit Sub salir: If MsgBox(Err.Description, vbExclamation + vbRetryCancel) = vbRetry Then boton_Click (Index) Else Unload Me End Sub
Private Sub Form_Load() bloquear (False) boton(1).Enabled = False End Sub
Private Sub nombre_Change() If Len(nombre) Then boton(1).Enabled = True Else boton(1).Enabled = False End Sub
Private Sub nombre_KeyPress(KeyAscii As Integer) Select Case KeyAscii Case 32: If Len(nombre.Text) = 0 Then KeyAscii = 0 Case 65 To 90, 97 To 122, 8 Case Asc("á"), Asc("é"), Asc("í"), Asc("ó"), Asc("ú") Case Asc("Ñ"), Asc("ñ") Case 13: If boton(1).Enabled = True Then boton(1).SetFocus Case Else KeyAscii = 0 End Select End Sub
Private Sub nombre_LostFocus() nombre = StrConv(nombre, vbProperCase) End Sub
56
1.5. FORMULARIO ACTUALIZACIร N MATERIAS
Dim Tabla As New ADODB.Recordset
Private Sub boton_Click(Index As Integer) On Error GoTo salir If nombre.ListIndex = -1 And Index <> 3 Then Exit Sub Select Case Index Case 0 bloquear (True) boton(0).Enabled = False boton(1).Enabled = False If mpor.Enabled = True Then mpor.SetFocus: mpor.SelLength = Len(mpor) Case 1 Tabla.Open "Select count(materiaId) + 1 as total from aux where materiaId = " & nombre.ItemData(nombre.ListIndex),
Base.ConnectionString,
adOpenForwardOnly If Tabla!total > 1 Then MsgBox "Esta materia no puede ser eliminada ya que ha sido asignada a una o mรกs clases", vbInformation nombre.SetFocus Tabla.Close Set Tabla = Nothing Exit Sub End If Tabla.Close Set Tabla = Nothing Base.Execute
"Delete
*
from
materias
where
MateriaId
=
"
&
nombre.ItemData(nombre.ListIndex) bloquear (False) mpor.Text = "" nombre.SetFocus
57
LlenarMaterias MsgBox "Materia eliminada del sistema a perfecci贸n", vbInformation, "Materia eliminada" Case 2 If Len(mpor.Text) = 0 Then Exit Sub Tabla.Open "Select count(nombre) as total from materias where materiaId <> " & nombre.ItemData(nombre.ListIndex) & " and nombre = '" & nombre.Text & "'", Base.ConnectionString, adOpenForwardOnly If Tabla!total Then MsgBox "La materia " & nombre.Text & " ya ha sido registrada en el sistema. Verifique el nombre y despu茅s vuelva a intentarlo", vbExclamation, "Profesor ya registrado" Tabla.Close Set Tabla = Nothing mpor.SetFocus Exit Sub End If Tabla.Close Set Tabla = Nothing Base.Execute "Update materias set nombre = '" & mpor.Text & "' where materiaId = " & nombre.ItemData(nombre.ListIndex) bloquear (False) mpor.Text = "" LlenarMaterias nombre.SetFocus MsgBox "Materia modificada a perfecci贸n", vbInformation, "Materia modificada" Case 3 Unload Me End Select Exit Sub salir:
58
If MsgBox(Err.Description, vbRetryCancel + vbExclamation, Err.Source) = vbRetry Then boton_Click (Index) Else Unload Me End Sub
Private Sub bloquear(opcion As Boolean) nombre.Enabled = Not opcion boton(0).Enabled = opcion boton(1).Enabled = opcion boton(2).Enabled = opcion Label1(0).Enabled = Not opcion Label1(1).Enabled = opcion mpor.Enabled = opcion End Sub
Private Sub LlenarMaterias() On Error GoTo salir nombre.Clear Set Tabla = Base.Execute("Select * from materias order by nombre") While Not Tabla.EOF nombre.AddItem Tabla!nombre nombre.ItemData(nombre.NewIndex) = Tabla!MateriaId Tabla.MoveNext Wend Tabla.Close Set Tabla = Nothing Exit Sub salir: If MsgBox(Err.Description, vbExclamation + vbRetryCancel) = vbRetry Then LlenarMaterias Else Unload Me End Sub
59
Private Sub Form_Load() bloquear (False) LlenarMaterias
End Sub
Private Sub mpor_Change() If Len(mpor) > 0 And mpor.Enabled = True Then boton(2).Enabled = True Else boton(2).Enabled = False End Sub
Private Sub mpor_KeyPress(KeyAscii As Integer) Select Case KeyAscii Case 32 If Len(mpor.Text) = 0 Then KeyAscii = 0 Case 65 To 90, 97 To 122, 8 Case Asc("á"), Asc("é"), Asc("í"), Asc("ó"), Asc("ú") Case Asc("Ñ"), Asc("ñ") Case 13 If boton(2).Enabled = True Then boton(2).SetFocus Case Else KeyAscii = 0 End Select End Sub
Private Sub mpor_LostFocus() mpor = StrConv(mpor, vbProperCase) End Sub
Private Sub nombre_Click() If nombre.ListIndex = -1 Then Exit Sub boton(0).Enabled = True
60
boton(1).Enabled = True mpor.Text = nombre.Text End Sub
1.6. FORMULARIO REGISTRAR PROFESOR
Dim Tabla As New ADODB.Recordset
Private Sub bloquear(opcion As Boolean) nombre.Enabled = opcion Direccion.Enabled = opcion Telefono.Enabled = opcion Especialidad.Enabled = opcion rnumero.Enabled = opcion Label1(0).Enabled = opcion Label1(1).Enabled = opcion Label1(2).Enabled = opcion Label1(3).Enabled = opcion Label1(4).Enabled = opcion boton(0).Enabled = Not opcion End Sub
Private Sub boton_Click(Index As Integer) On Error GoTo salir Select Case Index Case 0 bloquear (True) nombre.Text = "" Direccion = "" Telefono = "" Especialidad = ""
61
Tabla.Open
"Select
count(nombre)
as
total
from
profesores",
Base.ConnectionString, adOpenForwardOnly rnumero.Text = Tabla!total + 1 If Tabla.State = 1 Then Tabla.Close Set Tabla = Nothing End If If nombre.Enabled = True Then nombre.SetFocus boton(1).Enabled = False Case 1 Tabla.Open "Select count(nombre) as total from profesores where nombre = '" & nombre.Text & "'", Base.ConnectionString, adOpenForwardOnly If Tabla!total Then MsgBox "El profesor " & nombre.Text & " ya ha sido registrado en el sistema. Verifique el nombre y despu茅s vuelva a intentarlo", vbExclamation, "Profesor ya registrado" Tabla.Close Set Tabla = Nothing Exit Sub End If Tabla.Close Set Tabla = Nothing Base.Execute "Insert into profesores(nombre,direccion,telefono,especialidad) values('" & Trim(nombre) & "','" & Trim(Direccion) & "','" & Telefono & "','" & Trim(Especialidad) & "')" bloquear (False) boton(1).Enabled = False MsgBox "Profesor " & nombre.Text & ", registrado a perfecci贸n", vbInformation Case Else Unload Me End Select Exit Sub
62
salir: If MsgBox(Err.Description, vbExclamation + vbRetryCancel) = vbRetry Then boton_Click (Index) Else Unload Me End Sub
Private Sub Direccion_KeyPress(Tecla As Integer) Select Case Tecla Case 13 Telefono.SetFocus End Select End Sub
Private Sub Direccion_LostFocus() Direccion = StrConv(Direccion, vbProperCase) End Sub
Private Sub Especialidad_KeyPress(Tecla As Integer) Select Case Tecla Case Asc("a") To Asc("z") Case Asc("A") To Asc("Z") Case Asc("á"), Asc("é"), Asc("í"), Asc("ó"), Asc("ú") Case 8, 32 Case 13: boton(1).SetFocus Case Else Tecla = 0 End Select End Sub
Private Sub Especialidad_LostFocus() Especialidad = StrConv(Especialidad, vbProperCase) End Sub
63
Private Sub Form_Load() bloquear (False) boton(1).Enabled = False End Sub
Private Sub nombre_Change() If Len(nombre) Then boton(1).Enabled = True Else boton(1).Enabled = False End Sub
Private Sub nombre_KeyPress(KeyAscii As Integer) Select Case KeyAscii Case 32 If Len(nombre.Text) = 0 Then KeyAscii = 0 Case 65 To 90, 97 To 122, 8 Case Asc("á"), Asc("é"), Asc("í"), Asc("ó"), Asc("ú") Case Asc("Ñ"), Asc("ñ") Case 13 Direccion.SetFocus Case Else KeyAscii = 0 End Select End Sub
Private Sub nombre_LostFocus() nombre = StrConv(nombre, vbProperCase) End Sub
Private Sub Telefono_KeyPress(Tecla As Integer) Select Case Tecla Case 48 To 57 Case 8 Case 13
64
Especialidad.SetFocus Case Else Tecla = 0 End Select End Sub
1.7. FORMULARIO ACTUALIZACIร N DE PROFESORES
Dim Tabla As New ADODB.Recordset
Private Sub boton_Click(Index As Integer) On Error GoTo salir If nombre.ListIndex = -1 And Index <> 3 Then Exit Sub Select Case Index Case 0 bloquear (True) boton(0).Enabled = False boton(1).Enabled = False If mpor.Enabled = True Then mpor.SetFocus: mpor.SelLength = Len(mpor) Case 1 Tabla.Open "Select count(ProfesorId) + 1 as total from aux where ProfesorId = " &
nombre.ItemData(nombre.ListIndex),
Base.ConnectionString,
adOpenForwardOnly If Tabla!total > 1 Then MsgBox "El profesor no puede ser eliminado del sistema ya que ha sido asignado a una o mรกs clases", vbInformation nombre.SetFocus Tabla.Close Set Tabla = Nothing Exit Sub End If Tabla.Close
65
Set Tabla = Nothing Base.Execute
"Delete
*
from
profesores
where
ProfesorId
=
"
&
nombre.ItemData(nombre.ListIndex) bloquear (False) mpor.Text = "" Direccion = "" Telefono = "" Especialidad = "" nombre.SetFocus LlenarProfesores MsgBox "Profesor eliminada del sistema a perfecci贸n", vbInformation, "Materia eliminada" Case 2 If Len(mpor.Text) = 0 Then Exit Sub Tabla.Open "Select count(nombre) as total from profesores where ProfesorId <> " & nombre.ItemData(nombre.ListIndex) & " and nombre = '" & nombre.Text & "'", Base.ConnectionString, adOpenForwardOnly If Tabla!total Then MsgBox "El profesor: " & nombre.Text & ", ya ha sido registrado en el sistema. Verifique el nombre y despu茅s vuelva a intentarlo", vbExclamation, "Profesor ya registrado" Tabla.Close : Set Tabla = Nothing mpor.SetFocus Exit Sub End If Tabla.Close Set Tabla = Nothing Base.Execute "Update profesores set nombre = '" & Trim(mpor) & "',direccion='" & Trim(Direccion) & "',telefono='" & Telefono & "',especialidad='" & Trim(Especialidad)
&
"'
where
ProfesorId
=
"
&
nombre.ItemData(nombre.ListIndex) bloquear (False)
66
mpor.Text = "" Direccion = "" Telefono = "" Especialidad = "" LlenarProfesores nombre.SetFocus MsgBox
"Profesor
modificado
a
perfecci贸n",
vbInformation,
"Materia
modificada" Case 3: Unload Me End Select Exit Sub salir: If MsgBox(Err.Description, vbRetryCancel + vbExclamation, Err.Source) = vbRetry Then boton_Click (Index) Else Unload Me End Sub
Private Sub bloquear(opcion As Boolean) nombre.Enabled = Not opcion boton(0).Enabled = opcion boton(1).Enabled = opcion boton(2).Enabled = opcion Label1(0).Enabled = Not opcion Label1(1).Enabled = opcion Label1(2).Enabled = opcion Label1(3).Enabled = opcion Label1(4).Enabled = opcion mpor.Enabled = opcion Direccion.Enabled = opcion Telefono.Enabled = opcion Especialidad.Enabled = opcion End Sub
67
Private Sub LlenarProfesores() On Error GoTo salir nombre.Clear Set Tabla = Base.Execute("Select * from Profesores order by nombre") While Not Tabla.EOF nombre.AddItem Tabla!nombre nombre.ItemData(nombre.NewIndex) = Tabla!profesorid Tabla.MoveNext Wend Tabla.Close Set Tabla = Nothing Exit Sub salir: If MsgBox(Err.Description, vbExclamation + vbRetryCancel) = vbRetry Then LlenarProfesores Else Unload Me End Sub
Private Sub Direccion_KeyPress(KeyAscii As Integer) Select Case KeyAscii Case 13 Telefono.SetFocus End Select End Sub
Private Sub Direccion_LostFocus() Direccion = StrConv(Direccion, vbProperCase) End Sub
Private Sub Especialidad_KeyPress(KeyAscii As Integer) Select Case KeyAscii Case 13 boton(2).SetFocus
68
End Select End Sub
Private Sub Especialidad_LostFocus() Especialidad = StrConv(Especialidad, vbProperCase) End Sub
Private Sub Form_Load() bloquear (False) LlenarProfesores End Sub
Private Sub mpor_Change() If Len(mpor) > 0 And mpor.Enabled = True Then boton(2).Enabled = True Else boton(2).Enabled = False End Sub
Private Sub mpor_KeyPress(KeyAscii As Integer) Select Case KeyAscii Case 32: If Len(mpor.Text) = 0 Then KeyAscii = 0 Case 65 To 90, 97 To 122, 8 Case Asc("á"), Asc("é"), Asc("í"), Asc("ó"), Asc("ú") Case Asc("Ñ"), Asc("ñ") Case 13: Direccion.SetFocus Case Else: KeyAscii = 0 End Select End Sub
Private Sub mpor_LostFocus() mpor = StrConv(mpor, vbProperCase) End Sub
69
Private Sub nombre_Click() If nombre.ListIndex = -1 Then Exit Sub boton(0).Enabled = True boton(1).Enabled = True On Error GoTo Trata If Tabla.State = 1 Then Tabla.Close Set Tabla = Base.Execute("select * from profesores where nombre='" & Trim(nombre.Text) & "'") mpor.Text = Tabla!nombre Direccion = Tabla!Direccion Telefono = Tabla!Telefono Especialidad = Tabla!Especialidad Tabla.Close Set Tabla = Nothing Exit Sub Trata: If Tabla.State = 1 Then Tabla.Close Set Tabla = Nothing End If End Sub
Private Sub Telefono_KeyPress(KeyAscii As Integer) Select Case KeyAscii Case 48 To 57, Asc("-"), 8 Case 13 Especialidad.SetFocus Case Else KeyAscii = 0 End Select End Sub
70
1.8. FORMULARIO REGISTRAR AÑO BÁSICO
Dim Tabla As New ADODB.Recordset
Private Sub agrega_Click() matprofe(0).AddItem materia.Text matprofe(0).ItemData(matprofe(0).NewIndex) = materia.ItemData(materia.ListIndex) materia.RemoveItem materia.ListIndex matprofe(1).AddItem profesor.Text matprofe(1).ItemData(matprofe(1).NewIndex) = profesor.ItemData(profesor.ListIndex) agrega.Enabled = False boton(1).Enabled = pregunta End Sub
Private Sub Limpiar() nombre.Text = "" matprofe(0).Clear matprofe(1).Clear End Sub
Private Sub boton_Click(Index As Integer) On Error GoTo salir Dim IdAnio As Long Select Case Index Case 0 bloquear (True) boton(1).Enabled = False LlenarMateria LlenarProfesor Limpiar
71
If nombre.Enabled = True Then nombre.SetFocus Case 1 Set Tabla = Base.Execute("Select count(*) as total from curso where nombre = '" & nombre.Text & "'") If Tabla!total > 0 Then MsgBox "El aula o año básico a crear ya ha sido registrado. Cambie el nombre si desea continuar", vbExclamation, "Año ya existente" nombre.SetFocus Exit Sub End If Tabla.Close Set Tabla = Nothing Base.Execute ("Insert into curso(nombre) values('" & nombre.Text & "')") Set Tabla = Base.Execute("Select IdAnio from curso where nombre = '" & nombre.Text & "'") If Not Tabla.EOF Then IdAnio = Tabla!IdAnio Tabla.Close Set Tabla = Nothing For i% = 0 To matprofe(0).ListCount - 1 Base.Execute ("Insert Into Aux(AnioId, MateriaId, ProfesorId) values(" & IdAnio & "," & matprofe(0).ItemData(i%) & "," & matprofe(1).ItemData(i%) & ")") Next MsgBox "Año básico creado a perfección", vbInformation bloquear (False) Case Else: Unload curso End Select Exit Sub salir: If MsgBox(Err.Description, vbExclamation + vbRetryCancel) = vbRetry Then boton_Click (Index) End Sub
72
Private Sub Form_Load() bloquear (False) End Sub
Private Sub bloquear(opcion As Boolean) Frame1.Enabled = opcion Frame2.Enabled = opcion nombre.Enabled = opcion Label1(0).Enabled = opcion Label1(1).Enabled = opcion Label1(2).Enabled = opcion agrega.Enabled = False materia.Enabled = opcion profesor.Enabled = opcion boton(0).Enabled = Not opcion boton(1).Enabled = opcion End Sub
Private Sub materia_Click() If materia.ListIndex <> -1 And profesor.ListIndex <> -1 Then agrega.Enabled = True Else agrega.Enabled = False End Sub
Private Sub matprofe_Click(Index As Integer) If Index Then matprofe(0).ListIndex = matprofe(1).ListIndex Else matprofe(1).ListIndex = matprofe(0).ListIndex End If End Sub
Private Sub LlenarMateria()
73
On Error GoTo salir materia.Clear Set Tabla = Base.Execute("Select * from materias order by nombre") While Not Tabla.EOF materia.AddItem Tabla!nombre materia.ItemData(materia.NewIndex) = Tabla!MateriaId Tabla.MoveNext Wend Tabla.Close Set Tabla = Nothing Exit Sub salir: If MsgBox(Err.Description, vbExclamation + vbRetryCancel) = vbRetry Then LlenarMateria End Sub
Private Sub LlenarProfesor() On Error GoTo salir profesor.Clear Set Tabla = Base.Execute("Select * from profesores order by nombre") While Not Tabla.EOF profesor.AddItem Tabla!nombre profesor.ItemData(profesor.NewIndex) = Tabla!profesorid Tabla.MoveNext Wend Tabla.Close : Set Tabla = Nothing Exit Sub salir: If MsgBox(Err.Description, vbExclamation + vbRetryCancel) = vbRetry Then LlenarProfesor End Sub
74
Private Sub matprofe_DblClick(Index As Integer) On Error Resume Next If MsgBox("Estรก usted seguro de eliminar la materia y al profesor seleccionado?", vbYesNo + vbQuestion) = vbYes Then materia.AddItem matprofe(0).Text materia.ItemData(materia.NewIndex)
=
matprofe(0).ItemData(matprofe(0).ListIndex) matprofe(0).RemoveItem (matprofe(0).ListIndex) matprofe(1).RemoveItem (matprofe(1).ListIndex) End If boton(1).Enabled = pregunta End Sub
Private Sub nombre_Change() boton(1).Enabled = pregunta End Sub
Private Sub nombre_LostFocus() nombre = StrConv(nombre, vbProperCase) End Sub
Private Sub profesor_Click() If materia.ListIndex <> -1 And profesor.ListIndex <> -1 Then agrega.Enabled = True Else agrega.Enabled = False End Sub
Private Function pregunta() As Boolean If Len(nombre.Text) > 0 And matprofe(0).ListCount > 0 Then pregunta = True Else pregunta = False End Function
75
1.9. FORMULARIO ACTUALIZACIÓN DE AÑOS BÁSICAS
Dim Tabla As New ADODB.Recordset Dim Aux As New ADODB.Connection
Private Sub agrega_Click() On Error GoTo sale Aux.Execute
"Insert
into
aux(anioid,materiaid,profesorid)
values("
&
nombre.ItemData(nombre.ListIndex)
&
","
&
materia.ItemData(materia.ListIndex)
&
","
&
profesor.ItemData(profesor.ListIndex) & ")" matprofe(0).AddItem materia.Text matprofe(0).ItemData(matprofe(0).NewIndex)
=
materia.ItemData(materia.ListIndex) materia.RemoveItem materia.ListIndex matprofe(1).AddItem profesor.Text matprofe(1).ItemData(matprofe(1).NewIndex)
=
profesor.ItemData(profesor.ListIndex) agrega.Enabled = False boton(2).Enabled = pregunta Exit Sub sale: If MsgBox(Err.Description, vbQuestion + vbRetryCancel) = vbRetry Then agrega_Click End Sub
Private Sub Limpiar() nombre.ListIndex = -1 matprofe(0).Clear mpor.Text = "" materia.Clear profesor.Clear
76
matprofe(1).Clear End Sub
Private Sub boton_Click(Index As Integer) On Error GoTo sale Dim IdAnio As Long Select Case Index Case 0 bloquear (True) boton(0).Enabled = False boton(1).Enabled = False boton(2).Enabled = True Aux.Open Base.ConnectionString Aux.BeginTrans mpor.SetFocus Case 1 If nombre.ListIndex = -1 Then Exit Sub Set Tabla = Base.Execute("Select count(*) + 1 as total from matriculas where IdCurso = " & nombre.ItemData(nombre.ListIndex)) If Tabla!total > 1 Then MsgBox "No se puede eliminar el año básico porque se han matriculado estudiantes en él.", vbExclamation nombre.SetFocus Tabla.Close Set Tabla = Nothing Exit Sub End If Tabla.Close Set Tabla = Nothing Base.Execute
("Delete
*
from
curso
where
idanio
=
"
&
nombre.ItemData(nombre.ListIndex)) LlenarCurso
77
Limpiar MsgBox "Año básico eliminado del sistema a perfección", vbInformation bloquear (False) Case 2 Set Tabla = Aux.Execute("Select count(*) + 1 as total from curso where nombre = '" & mpor.Text & "' and idanio <> " & nombre.ItemData(nombre.ListIndex)) If Tabla!total > 1 Then MsgBox "El aula o año básico a crear ya ha sido registrado. Cambie el nombre si desea continuar", vbExclamation, "Año ya existente" mpor.SetFocus Tabla.Close Set Tabla = Nothing Exit Sub End If Aux.Execute "Update curso set nombre = '" & mpor.Text & "' where idanio = " & nombre.ItemData(nombre.ListIndex) Tabla.Close Set Tabla = Nothing Aux.CommitTrans Aux.Close LlenarCurso Limpiar MsgBox "Año básico modificado a perfección", vbInformation bloquear (False) Case 3 If Aux.State = 1 Then Aux.RollbackTrans If Aux.State = 1 Then Aux.Close Unload Me End Select Exit Sub sale:
78
If MsgBox(Err.Description, vbQuestion + vbRetryCancel) = vbRetry Then boton_Click (Index) End Sub
Private Sub Form_Load() bloquear (False) LlenarCurso End Sub
Private Sub bloquear(opcion As Boolean) Frame2.Enabled = opcion nombre.Enabled = Not opcion Label1(0).Enabled = opcion Label1(1).Enabled = opcion Label1(2).Enabled = opcion mpor.Enabled = opcion matprofe(0).Enabled = opcion matprofe(1).Enabled = opcion Label1(3).Enabled = opcion agrega.Enabled = False materia.Enabled = opcion profesor.Enabled = opcion boton(0).Enabled = opcion boton(1).Enabled = opcion boton(2).Enabled = opcion End Sub
Private Sub materia_Click() If materia.ListIndex <> -1 And profesor.ListIndex <> -1 Then agrega.Enabled = True Else agrega.Enabled = False End Sub
79
Private Sub matprofe_Click(Index As Integer) If Index Then matprofe(0).ListIndex = matprofe(1).ListIndex Else matprofe(1).ListIndex = matprofe(0).ListIndex End If End Sub
Private Sub LlenarCurso() On Error GoTo sale nombre.Clear Set Tabla = Base.Execute("Select * from curso order by nombre") While Not Tabla.EOF nombre.AddItem Tabla!nombre nombre.ItemData(nombre.NewIndex) = Tabla!IdAnio Tabla.MoveNext Wend Tabla.Close Set Tabla = Nothing Exit Sub sale: If MsgBox(Err.Description, vbQuestion + vbRetryCancel) = vbRetry Then LlenarCurso End Sub
Private Sub LlenarTodo() On Error GoTo sale Dim FlagTabla As Boolean FlagTabla = False materia.Clear profesor.Clear matprofe(0).Clear
80
matprofe(1).Clear If nombre.ListIndex = -1 Then Exit Sub Tabla.Open
"SELECT
Materias.Nombre,
Materias.MateriaId,
Aux.AnioId,
Profesores.Nombre as Profesor, Profesores.ProfesorId " & _ "FROM
Profesores
INNER
JOIN
(Materias
INNER
JOIN
Aux
ON
Materias.MateriaId = Aux.MateriaId) ON Profesores.ProfesorId = Aux.ProfesorId "&_ "WHERE
Aux.AnioId
=
"
&
nombre.ItemData(nombre.ListIndex),
Base.ConnectionString, adOpenDynamic While Not Tabla.EOF matprofe(0).AddItem Tabla!nombre matprofe(0).ItemData(matprofe(0).NewIndex) = Tabla!MateriaId matprofe(1).AddItem Tabla!profesor matprofe(1).ItemData(matprofe(1).NewIndex) = Tabla!profesorid Tabla.MoveNext Wend Tabla.Close Set Tabla = Nothing Set Tabla = Base.Execute("Select * from profesores order by nombre") While Not Tabla.EOF profesor.AddItem Tabla!nombre profesor.ItemData(profesor.NewIndex) = Tabla!profesorid Tabla.MoveNext Wend Tabla.Close Set Tabla = Nothing Set Tabla = Base.Execute("Select * from materias order by nombre") While Not Tabla.EOF For i% = 0 To matprofe(0).ListCount - 1 FlagTabla = True If Tabla!MateriaId = matprofe(0).ItemData(i%) Then FlagTabla = False
81
Exit For End If Next If FlagTabla = True Then materia.AddItem Tabla!nombre materia.ItemData(materia.NewIndex) = Tabla!MateriaId End If Tabla.MoveNext Wend Tabla.Close Set Tabla = Nothing Exit Sub sale: If MsgBox(Err.Description, vbQuestion + vbRetryCancel) = vbRetry Then LlenarTodo End Sub
Private Sub matprofe_DblClick(Index As Integer) On Error GoTo salir If MsgBox("Estรก usted seguro de eliminar la materia y al profesor seleccionado?", vbYesNo + vbQuestion) = vbYes Then Aux.Execute
"delete
*
from
nombre.ItemData(nombre.ListIndex)
aux &
where
anioid
and
materiaid
"
= =
"
&
"
&
matprofe(0).ItemData(matprofe(0).ListIndex) materia.AddItem matprofe(0).Text materia.ItemData(materia.NewIndex)
=
matprofe(0).ItemData(matprofe(0).ListIndex) matprofe(0).RemoveItem (matprofe(0).ListIndex) matprofe(1).RemoveItem (matprofe(1).ListIndex) End If boton(2).Enabled = pregunta Exit Sub
82
salir: MsgBox "No se puede eliminar la materia selecionada debido a: " & Err.Description, vbExclamation End Sub
Private Sub mpor_Change() boton(2).Enabled = pregunta End Sub
Private Sub mpor_KeyPress(KeyAscii As Integer) Select Case KeyAscii Case 32 If Len(nombre.Text) = 0 Then KeyAscii = 0 Case 65 To 90, 97 To 122, 8 Case Asc("á"), Asc("é"), Asc("í"), Asc("ó"), Asc("ú") Case Asc("Ñ"), Asc("ñ") Case 13 materia.SetFocus Case Else KeyAscii = 0 End Select End Sub
Private Sub mpor_LostFocus() mpor = StrConv(mpor, vbProperCase) End Sub
Private Sub nombre_Click() mcurso.MousePointer = vbHourglass LlenarTodo boton(0).Enabled = True boton(1).Enabled = True
83
mpor.Text = nombre.Text mcurso.MousePointer = vbNormal End Sub
Private Sub profesor_Click() If materia.ListIndex <> -1 And profesor.ListIndex <> -1 Then agrega.Enabled = True Else agrega.Enabled = False End Sub
Private Function pregunta() As Boolean If boton(0).Enabled = False And Len(mpor.Text) > 0 And matprofe(0).ListCount > 0 Then pregunta = True Else pregunta = False End Function
1.10. FORMULARIO REGISTRAR ESTUDIANTE
Dim Tabla As New ADODB.Recordset Dim Sex As Integer
Private Sub anioescolar_KeyPress(KeyAscii As Integer) If KeyAscii = 13 Then calificacion.SetFocus End Sub
Private Sub anioescolar_LostFocus() anioescolar = StrConv(anioescolar.Text, vbProperCase) End Sub
Private Sub boton_Click(Index As Integer) On Error GoTo salir Select Case Index Case 0 bloquear (True)
84
Limpiar LlenarCombos boton(1).Enabled = False If nombre.Enabled = True Then nombre.SetFocus Case 1 If Len(nombre) = 0 Then MsgBox "Campo vacio", vbCritical nombre.SetFocus Exit Sub ElseIf Len(lnacido) = 0 Then MsgBox "Campo vacio", vbCritical lnacido.SetFocus Exit Sub ElseIf Len(procedencia) = 0 Then MsgBox "Campo vacio", vbCritical procedencia.SetFocus Exit Sub ElseIf Len(ciudad) = 0 Then MsgBox "Campo vacio", vbCritical ciudad.SetFocus Exit Sub ElseIf Len(claseescuela) = 0 Then MsgBox "Campo vacio", vbCritical claseescuela.SetFocus Exit Sub ElseIf Len(anioescolar) = 0 Then MsgBox "Campo vacio", vbCritical anioescolar.SetFocus Exit Sub ElseIf Len(calificacion) = 0 Then MsgBox "Campo vacio", vbCritical calificacion.SetFocus
85
Exit Sub ElseIf Len(origenmatricula) = 0 Then MsgBox "Campo vacio", vbCritical origenmatricula.SetFocus Exit Sub ElseIf Len(fono) = 0 Then MsgBox "Campo vacio", vbCritical fono.SetFocus Exit Sub ElseIf Len(nacionalidad) = 0 Then MsgBox "Campo vacio", vbCritical nacionalidad.SetFocus Exit Sub ElseIf Len(vivecon) = 0 Then MsgBox "Campo vacio", vbCritical vivecon.SetFocus Exit Sub ElseIf Len(padre) = 0 Then MsgBox "Campo vacio", vbCritical padre.SetFocus Exit Sub ElseIf Len(ocupacionp) = 0 Then MsgBox "Campo vacio", vbCritical ocupacionp.SetFocus Exit Sub ElseIf Len(madre) = 0 Then MsgBox "Campo vacio", vbCritical madre.SetFocus Exit Sub ElseIf Len(ocupacionm) = 0 Then MsgBox "Campo vacio", vbCritical ocupacionm.SetFocus
86
Exit Sub ElseIf Len(direcciona) = 0 Then MsgBox "Campo vacio", vbCritical direcciona.SetFocus Exit Sub ElseIf Len(situacion) = 0 Then MsgBox "Campo vacio", vbCritical situacion.SetFocus Exit Sub ElseIf Len(salud) = 0 Then MsgBox "Campo vacio", vbCritical salud.SetFocus Exit Sub End If Tabla.Open "select count(nombre) as total from datos where nombre = '" & nombre.Text & "'", Base.ConnectionString, adOpenForwardOnly If Tabla!total > 0 Then If MsgBox("Existen " & Tabla!total & " estudiante(s) registrado(s) con el mismo nombre. ¿Aún así desea continuar?.", vbExclamation + vbYesNo) = vbNo Then nombre.SetFocus: Tabla.Close: Exit Sub End If Tabla.Close Set Tabla = Nothing If Year(Date) - Year(nacido.Value) < 4 Then If MsgBox("La edad mínima del estudiante debe ser a partir de los 4 años. ¿Aún así desea continuar?", vbYesNo + vbExclamation, "Edad seleccionada = " & Year(Date) - Year(nacido.Value)) = vbNo Then Exit Sub End If If MsgBox("¿Esta seguro de querer registrar al estudiante " & nombre.Text & "?.", vbInformation + vbYesNo) = vbNo Then Exit Sub sql$
=
"Insert
into
datos(nombre,lnacimiento,fecha,procedencia,ciudad,claseescuela,anioescuela,calif
87
icacion,origenmatricula,nacionalidad,vivecon,fono,padre,madre,direapoderado,oc upacionp,ocupacionm,situacion,salud,sexo) values('" sql$ = sql$ & nombre.Text & "','" & Left(lnacido.Text, 30) & "','" & nacido.Value & "','" & Left(procedencia.Text, 30) & "','" & Left(ciudad.Text, 30) & "','" & Left(claseescuela.Text, 20) & "','" & Left(anioescolar.Text, 20) & "'," & Val(calificacion.Text) & ",'" & Left(origenmatricula.Text, 30) & "','" & Left(nacionalidad.Text, 20) & "','" & Left(vivecon.Text, 40) & "','" & fono.Text & "','" & padre.Text & "','" & madre.Text & "','" & direcciona.Text & "','" & ocupacionp & "','" & ocupacionm.Text & "','" & Left(situacion.Text, 10) & "','" & Left(salud.Text, 10) & "'," & Sex & ")" Base.Execute sql$ bloquear (False) MsgBox "Se ha registrado al estudiante " & nombre.Text & ", a perfecci贸n", vbInformation, "Estudiante registrado" Case Else Unload nestudiante End Select Exit Sub salir: If MsgBox(Err.Description, vbExclamation + vbRetryCancel) = vbRetry Then boton_Click (Index) Else Unload Me End Sub
Private Sub bloquear(opcion As Boolean) Frame1.Enabled = opcion boton(0).Enabled = Not opcion boton(1).Enabled = opcion Frame2.Enabled = opcion Sexo(0).Enabled = opcion Sexo(1).Enabled = opcion For i% = 0 To 18 Label1(i%).Enabled = opcion
88
Next End Sub
Private Sub Limpiar() nombre.Text = "" ciudad.Text = "" direcciona.Text = "" nacionalidad.Text = "" procedencia.Text = "" claseescuela.Text = "" anioescolar.Text = "" calificacion.Text = "" origenmatricula.Text = "" situacion.Text = "" vivecon.Text = "" salud.Text = "" lnacido.Text = "" padre.Text = "" madre.Text = "" ocupacionp.Text = "" fono.Text = "" ocupacionm.Text = "" fono.Text = "" End Sub
Private Sub calificacion_KeyPress(KeyAscii As Integer) Select Case KeyAscii Case 48 To 57 If (Val(calificacion) * 10 + KeyAscii - 48) > MaxNota Then KeyAscii = 0 Case 8 Case 13 origenmatricula.SetFocus
89
Case Else KeyAscii = 0 End Select End Sub
Private Sub calificacion_LostFocus() calificacion = Val(calificacion.Text) End Sub
Private Sub ciudad_KeyPress(KeyAscii As Integer) If KeyAscii = 13 Then claseescuela.SetFocus End Sub
Private Sub ciudad_LostFocus() ciudad = StrConv(ciudad.Text, vbProperCase) End Sub
Private Sub claseescuela_KeyPress(KeyAscii As Integer) Select Case KeyAscii Case 32 If Len(claseescuela.Text) = 0 Then KeyAscii = 0 Case 65 To 90, 97 To 122, 8 Case Asc("á"), Asc("é"), Asc("í"), Asc("ó"), Asc("ú") Case Asc("Ñ"), Asc("ñ") Case 13 anioescolar.SetFocus Case Else: KeyAscii = 0 End Select End Sub
Private Sub claseescuela_LostFocus() claseescuela = StrConv(claseescuela.Text, vbProperCase)
90
End Sub
Private Sub direcciona_KeyPress(KeyAscii As Integer) If KeyAscii = 13 Then situacion.SetFocus End Sub
Private Sub direcciona_LostFocus() direcciona = StrConv(direcciona.Text, vbProperCase) End Sub
Private Sub fono_KeyPress(KeyAscii As Integer) Select Case KeyAscii Case 48 To 57, Asc("-"), 8 Case 13 Sexo(0).SetFocus Case Else KeyAscii = 0 End Select End Sub
Private Sub Form_Load() bloquear (False) nacido.Value = Date nacido.MaxDate = Date Sex = 0 Sexo(0).Value = True End Sub
Private Sub madre_KeyPress(KeyAscii As Integer) Select Case KeyAscii Case 32 If Len(nombre.Text) = 0 Then KeyAscii = 0
91
Case 65 To 90, 97 To 122, 8 Case Asc("á"), Asc("é"), Asc("í"), Asc("ó"), Asc("ú") Case Asc("Ñ"), Asc("ñ") Case 13 ocupacionm.SetFocus Case Else KeyAscii = 0 End Select End Sub
Private Sub madre_LostFocus() madre = StrConv(madre.Text, vbProperCase) End Sub
Private Sub nacido_KeyDown(KeyCode As Integer, Shift As Integer) If KeyCode = 13 Then procedencia.SetFocus End If End Sub
Private Sub nacido_KeyPress(KeyAscii As Integer) If KeyAscii = 13 Then nhermanos.SetFocus End Sub
Private Sub nacionalidad_KeyPress(KeyAscii As Integer) Select Case KeyAscii Case 32 If Len(nombre.Text) = 0 Then KeyAscii = 0 Case 65 To 90, 97 To 122, 8 Case Asc("á"), Asc("é"), Asc("í"), Asc("ó"), Asc("ú") Case Asc("Ñ"), Asc("ñ") Case 13
92
vivecon.SetFocus Case Else KeyAscii = 0 End Select End Sub
Private Sub nacionalidad_LostFocus() nacionalidad = StrConv(nacionalidad.Text, vbProperCase) End Sub
Private Sub nombre_Change() If Len(nombre.Text) > 0 Then boton(1).Enabled = True Else boton(1).Enabled = False End Sub
Private Sub nombre_KeyPress(KeyAscii As Integer) Select Case KeyAscii Case 32 If Len(nombre.Text) = 0 Then KeyAscii = 0 Case 65 To 90, 97 To 122, 8 Case Asc("á"), Asc("é"), Asc("í"), Asc("ó"), Asc("ú") Case Asc("Ñ"), Asc("ñ") Case 13: lnacido.SetFocus Case Else KeyAscii = 0 End Select End Sub
Private Sub lnacido_KeyPress(KeyAscii As Integer) If KeyAscii = 13 Then nacido.SetFocus End Sub
93
Private Sub lnacido_LostFocus() lnacido.Text = StrConv(lnacido.Text, vbProperCase) End Sub
Private Sub nombre_LostFocus() nombre.Text = StrConv(nombre.Text, vbProperCase) End Sub
Private Sub ocupacionm_KeyPress(KeyAscii As Integer) Select Case KeyAscii Case 32 If Len(ocupacionm.Text) = 0 Then KeyAscii = 0 Case 65 To 90, 97 To 122, 8 Case Asc("á"), Asc("é"), Asc("í"), Asc("ó"), Asc("ú") Case Asc("Ñ"), Asc("ñ") Case 13 direcciona.SetFocus Case Else KeyAscii = 0 End Select End Sub
Private Sub ocupacionm_LostFocus() ocupacionm = StrConv(ocupacionm.Text, vbProperCase) End Sub
Private Sub ocupacionp_KeyPress(KeyAscii As Integer) Select Case KeyAscii Case 32 If Len(ocupacionp.Text) = 0 Then KeyAscii = 0 Case 65 To 90, 97 To 122, 8 Case Asc("á"), Asc("é"), Asc("í"), Asc("ó"), Asc("ú")
94
Case Asc("Ñ"), Asc("ñ") Case 13 madre.SetFocus Case Else KeyAscii = 0 End Select End Sub
Private Sub ocupacionp_LostFocus() ocupacionp = StrConv(ocupacionp.Text, vbProperCase) End Sub
Private Sub origenmatricula_KeyPress(KeyAscii As Integer) Select Case KeyAscii Case 32 If Len(origenmatricula.Text) = 0 Then KeyAscii = 0 Case 65 To 90, 97 To 122, 8 Case Asc("á"), Asc("é"), Asc("í"), Asc("ó"), Asc("ú") Case Asc("Ñ"), Asc("ñ") Case 13 fono.SetFocus Case Else KeyAscii = 0 End Select End Sub
Private Sub origenmatricula_LostFocus() origenmatricula = StrConv(origenmatricula.Text, vbProperCase) End Sub
Private Sub padre_KeyPress(KeyAscii As Integer) Select Case KeyAscii
95
Case 32 If Len(nombre.Text) = 0 Then KeyAscii = 0 Case 65 To 90, 97 To 122, 8 Case Asc("á"), Asc("é"), Asc("í"), Asc("ó"), Asc("ú") Case Asc("Ñ"), Asc("ñ") Case 13 ocupacionp.SetFocus Case Else KeyAscii = 0 End Select End Sub
Private Sub padre_LostFocus() padre = StrConv(padre.Text, vbProperCase) End Sub
Private Sub procedencia_KeyPress(KeyAscii As Integer) Select Case KeyAscii Case 48 To 57 Case 32 If Len(procedencia.Text) = 0 Then KeyAscii = 0 Case 65 To 90, 97 To 122, 8 Case Asc("á"), Asc("é"), Asc("í"), Asc("ó"), Asc("ú") Case Asc("Ñ"), Asc("ñ") Case 13 ciudad.SetFocus Case Else KeyAscii = 0 End Select End Sub
Private Sub procedencia_LostFocus()
96
procedencia = StrConv(procedencia.Text, vbProperCase) End Sub
Private Sub salud_KeyPress(KeyAscii As Integer) Select Case KeyAscii Case 32 If Len(nombre.Text) = 0 Then KeyAscii = 0 Case 65 To 90, 97 To 122, 8 Case Asc("á"), Asc("é"), Asc("í"), Asc("ó"), Asc("ú") Case Asc("Ñ"), Asc("ñ") Case 13 If boton(1).Enabled = True Then boton(1).SetFocus Case Else KeyAscii = 0 End Select End Sub
Private Sub salud_LostFocus() salud = StrConv(salud.Text, vbProperCase) End Sub
Private Sub sexo_Click(Index As Integer) Sex = Index End Sub
Private Sub sexo_KeyPress(Index As Integer, KeyAscii As Integer) If KeyAscii = 13 Then nacionalidad.SetFocus End Sub
Private Sub situacion_KeyPress(KeyAscii As Integer) Select Case KeyAscii Case 32
97
If Len(nombre.Text) = 0 Then KeyAscii = 0 Case 65 To 90, 97 To 122, 8 Case Asc("á"), Asc("é"), Asc("í"), Asc("ó"), Asc("ú") Case Asc("Ñ"), Asc("ñ") Case 13 salud.SetFocus Case Else KeyAscii = 0 End Select End Sub
Private Sub situacion_LostFocus() situacion = StrConv(situacion.Text, vbProperCase) End Sub
Private Sub vivecon_KeyPress(KeyAscii As Integer) Select Case KeyAscii Case 32 If Len(nombre.Text) = 0 Then KeyAscii = 0 Case 65 To 90, 97 To 122, 8 Case Asc("á"), Asc("é"), Asc("í"), Asc("ó"), Asc("ú") Case Asc("Ñ"), Asc("ñ") Case 13: padre.SetFocus Case Else KeyAscii = 0 End Select End Sub
Private Sub vivecon_LostFocus() vivecon = StrConv(vivecon.Text, vbProperCase) End Sub
98
Private Sub LlenarCombos() lnacido.Clear procedencia.Clear ciudad.Clear anioescolar.Clear origenmatricula.Clear claseescuela.Clear nacionalidad.Clear vivecon.Clear situacion.Clear salud.Clear Set Tabla = Base.Execute("Select DISTINCT lnacimiento FROM DATOS Where Lnacimiento <> '' order by lnacimiento") While Not Tabla.EOF lnacido.AddItem Tabla!lnacimiento Tabla.MoveNext Wend Tabla.Close Set Tabla = Nothing Set Tabla = Base.Execute("Select DISTINCT procedencia FROM Datos Where Procedencia <> '' order by procedencia") While Not Tabla.EOF procedencia.AddItem Tabla!procedencia Tabla.MoveNext Wend Tabla.Close Set Tabla = Nothing Set Tabla = Base.Execute("Select DISTINCT Ciudad from datos Where Ciudad <> '' order by ciudad") While Not Tabla.EOF ciudad.AddItem Tabla!ciudad Tabla.MoveNext
99
Wend Tabla.Close Set Tabla = Nothing Set Tabla = Base.Execute("Select DISTINCT OrigenMatricula from datos where OrigenMatricula <> '' order by OrigenMatricula") While Not Tabla.EOF origenmatricula.AddItem Tabla!origenmatricula Tabla.MoveNext Wend Tabla.Close Set Tabla = Nothing Set Tabla = Base.Execute("Select DISTINCT Nacionalidad from datos Where Nacionalidad <> '' order by nacionalidad") While Not Tabla.EOF nacionalidad.AddItem Tabla!nacionalidad Tabla.MoveNext Wend Tabla.Close Set Tabla = Nothing Set Tabla = Base.Execute("Select DISTINCT Vivecon from datos Where vivecon <> '' order by vivecon") While Not Tabla.EOF vivecon.AddItem Tabla!vivecon Tabla.MoveNext Wend Tabla.Close Set Tabla = Nothing Set Tabla = Base.Execute("Select DISTINCT Situacion from datos Where Situacion <> '' order by Situacion") While Not Tabla.EOF situacion.AddItem Tabla!situacion Tabla.MoveNext
100
Wend Tabla.Close : Set Tabla = Nothing Set Tabla = Base.Execute("Select DISTINCT Salud from datos Where salud <> '' order by salud") While Not Tabla.EOF salud.AddItem Tabla!salud Tabla.MoveNext Wend Tabla.Close : Set Tabla = Nothing Set Tabla = Base.Execute("Select DISTINCT AnioEscuela from datos Where AnioEscuela <> '' order by AnioEscuela") While Not Tabla.EOF anioescolar.AddItem Tabla!AnioEscuela Tabla.MoveNext Wend Tabla.Close : Set Tabla = Nothing Set Tabla = Base.Execute("Select DISTINCT ClaseEscuela from datos Where ClaseEscuela <> '' order by ClaseEscuela") While Not Tabla.EOF claseescuela.AddItem Tabla!claseescuela Tabla.MoveNext Wend Tabla.Close : Set Tabla = Nothing End Sub
1.11. FORMULARIO ACTUALIZACIĂ&#x201C;N DE ESTUDIANTES
Dim Tabla As New ADODB.Recordset Dim Nomb As String Dim Sex As Byte
Private Sub anioescolar_KeyPress(KeyAscii As Integer)
101
If KeyAscii = 13 Then calificacion.SetFocus End Sub
Private Sub anioescolar_LostFocus() anioescolar = StrConv(anioescolar.Text, vbProperCase) End Sub
Private Sub calificacion_KeyPress(KeyAscii As Integer) Select Case KeyAscii Case 48 To 57 If (Val(calificacion) * 10 + KeyAscii - 48) > MaxNota Then KeyAscii = 0 Case 8 Case 13 origenmatricula.SetFocus Case Else KeyAscii = 0 End Select End Sub
Private Sub calificacion_LostFocus() calificacion = Val(calificacion.Text) End Sub
Private Sub ciudad_KeyPress(KeyAscii As Integer) If KeyAscii = 13 Then claseescuela.SetFocus End Sub
Private Sub Direccion_KeyPress(KeyAscii As Integer) If KeyAscii = 13 Then fono.SetFocus End Sub
Private Sub ciudad_LostFocus()
102
ciudad = StrConv(ciudad.Text, vbProperCase) End Sub
Private Sub claseescuela_KeyPress(KeyAscii As Integer) Select Case KeyAscii Case 32 If Len(claseescuela.Text) = 0 Then KeyAscii = 0 Case 65 To 90, 97 To 122, 8 Case Asc("á"), Asc("é"), Asc("í"), Asc("ó"), Asc("ú") Case Asc("Ñ"), Asc("ñ") Case 13 anioescolar.SetFocus Case Else KeyAscii = 0 End Select End Sub
Private Sub claseescuela_LostFocus() claseescuela = StrConv(claseescuela.Text, vbProperCase) End Sub
Private Sub direcciona_KeyPress(KeyAscii As Integer) If KeyAscii = 13 Then situacion.SetFocus End Sub
Private Sub direcciona_LostFocus() direcciona = StrConv(direcciona.Text, vbProperCase) End Sub
Private Sub fono_KeyPress(KeyAscii As Integer) Select Case KeyAscii Case 48 To 57, Asc("-"), 8
103
Case 13 Sexo(0).SetFocus Case Else KeyAscii = 0 End Select End Sub
Private Sub madre_KeyPress(KeyAscii As Integer) Select Case KeyAscii Case 32 If Len(nombre.Text) = 0 Then KeyAscii = 0 Case 65 To 90, 97 To 122, 8 Case Asc("á"), Asc("é"), Asc("í"), Asc("ó"), Asc("ú") Case Asc("Ñ"), Asc("ñ") Case 13 ocupacionm.SetFocus Case Else KeyAscii = 0 End Select End Sub
Private Sub madre_LostFocus() madre = StrConv(madre.Text, vbProperCase) End Sub
Private Sub nacido_KeyDown(KeyCode As Integer, Shift As Integer) If KeyCode = 13 Then procedencia.SetFocus End Sub
Private Sub nacionalidad_KeyPress(KeyAscii As Integer) Select Case KeyAscii Case 32
104
If Len(nombre.Text) = 0 Then KeyAscii = 0 Case 65 To 90, 97 To 122, 8 Case Asc("á"), Asc("é"), Asc("í"), Asc("ó"), Asc("ú") Case Asc("Ñ"), Asc("ñ") Case 13 vivecon.SetFocus Case Else KeyAscii = 0 End Select End Sub
Private Sub nacionalidad_LostFocus() nacionalidad = StrConv(nacionalidad.Text, vbProperCase) End Sub
Private Sub nombre_Change() If Len(nombre.Text) > 0 And lnacido.Enabled = True Then boton(2).Enabled = True Else boton(2).Enabled = False End Sub
Private Sub nombre_KeyPress(KeyAscii As Integer) On Error Resume Next Select Case KeyAscii Case 32 If Len(nombre.Text) = 0 Then KeyAscii = 0 Case 65 To 90, 97 To 122, 8 Case Asc("á"), Asc("é"), Asc("í"), Asc("ó"), Asc("ú") Case Asc("Ñ"), Asc("ñ") Case 13 lnacido.SetFocus Case Else KeyAscii = 0
105
End Select End Sub
Private Sub lnacido_KeyPress(KeyAscii As Integer) If KeyAscii = 13 Then nacido.SetFocus End Sub
Private Sub lnacido_LostFocus() lnacido.Text = StrConv(lnacido.Text, vbProperCase) End Sub
Private Sub nombre_LostFocus() nombre.Text = StrConv(nombre.Text, vbProperCase) End Sub
Private Sub ocupacionm_KeyPress(KeyAscii As Integer) Select Case KeyAscii Case 32 If Len(ocupacionm.Text) = 0 Then KeyAscii = 0 Case 65 To 90, 97 To 122, 8 Case Asc("á"), Asc("é"), Asc("í"), Asc("ó"), Asc("ú") Case Asc("Ñ"), Asc("ñ") Case 13: direcciona.SetFocus Case Else KeyAscii = 0 End Select End Sub
Private Sub ocupacionm_LostFocus() ocupacionm = StrConv(ocupacionm.Text, vbProperCase) End Sub
106
Private Sub ocupacionp_KeyPress(KeyAscii As Integer) Select Case KeyAscii Case 32 If Len(ocupacionp.Text) = 0 Then KeyAscii = 0 Case 65 To 90, 97 To 122, 8 Case Asc("á"), Asc("é"), Asc("í"), Asc("ó"), Asc("ú") Case Asc("Ñ"), Asc("ñ") Case 13 madre.SetFocus Case Else KeyAscii = 0 End Select End Sub
Private Sub ocupacionp_LostFocus() ocupacionp = StrConv(ocupacionp.Text, vbProperCase) End Sub
Private Sub origenmatricula_KeyPress(KeyAscii As Integer) Select Case KeyAscii Case 32 If Len(origenmatricula.Text) = 0 Then KeyAscii = 0 Case 65 To 90, 97 To 122, 8 Case Asc("á"), Asc("é"), Asc("í"), Asc("ó"), Asc("ú") Case Asc("Ñ"), Asc("ñ") Case 13 fono.SetFocus Case Else KeyAscii = 0 End Select End Sub
107
Private Sub origenmatricula_LostFocus() origenmatricula = StrConv(origenmatricula.Text, vbProperCase) End Sub
Private Sub padre_KeyPress(KeyAscii As Integer) Select Case KeyAscii Case 32 If Len(nombre.Text) = 0 Then KeyAscii = 0 Case 65 To 90, 97 To 122, 8 Case Asc("á"), Asc("é"), Asc("í"), Asc("ó"), Asc("ú") Case Asc("Ñ"), Asc("ñ") Case 13 ocupacionp.SetFocus Case Else KeyAscii = 0 End Select End Sub
Private Sub padre_LostFocus() padre = StrConv(padre.Text, vbProperCase) End Sub
Private Sub procedencia_KeyPress(KeyAscii As Integer) Select Case KeyAscii Case 48 To 57 Case 32 If Len(procedencia.Text) = 0 Then KeyAscii = 0 Case 65 To 90, 97 To 122, 8 Case Asc("á"), Asc("é"), Asc("í"), Asc("ó"), Asc("ú") Case Asc("Ñ"), Asc("ñ") Case 13 ciudad.SetFocus
108
Case Else KeyAscii = 0 End Select End Sub
Private Sub procedencia_LostFocus() procedencia = StrConv(procedencia.Text, vbProperCase) End Sub
Private Sub salud_KeyPress(KeyAscii As Integer) Select Case KeyAscii Case 32 If Len(nombre.Text) = 0 Then KeyAscii = 0 Case 65 To 90, 97 To 122, 8 Case Asc("á"), Asc("é"), Asc("í"), Asc("ó"), Asc("ú") Case Asc("Ñ"), Asc("ñ") Case 13 If boton(1).Enabled = True Then boton(1).SetFocus Case Else KeyAscii = 0 End Select End Sub
Private Sub salud_LostFocus() salud = StrConv(salud.Text, vbProperCase) End Sub
Private Sub sexo_Click(Index As Integer) Sex = Index End Sub
Private Sub sexo_KeyPress(Index As Integer, KeyAscii As Integer)
109
If KeyAscii = 13 Then nacionalidad.SetFocus End Sub
Private Sub situacion_KeyPress(KeyAscii As Integer) Select Case KeyAscii Case 32 If Len(nombre.Text) = 0 Then KeyAscii = 0 Case 65 To 90, 97 To 122, 8 Case Asc("á"), Asc("é"), Asc("í"), Asc("ó"), Asc("ú") Case Asc("Ñ"), Asc("ñ") Case 13 salud.SetFocus Case Else KeyAscii = 0 End Select End Sub
Private Sub situacion_LostFocus() situacion = StrConv(situacion.Text, vbProperCase) End Sub
Private Sub vivecon_KeyPress(KeyAscii As Integer) Select Case KeyAscii Case 32 If Len(nombre.Text) = 0 Then KeyAscii = 0 Case 65 To 90, 97 To 122, 8 Case Asc("á"), Asc("é"), Asc("í"), Asc("ó"), Asc("ú") Case Asc("Ñ"), Asc("ñ") Case 13 padre.SetFocus Case Else KeyAscii = 0
110
End Select End Sub
Private Sub vivecon_LostFocus() vivecon = StrConv(vivecon.Text, vbProperCase) End Sub
Private Sub boton_Click(Index As Integer) On Error GoTo salir Select Case Index Case 0 ' Boton Modificar: Activar Todo bloquear (True) boton(1).Enabled = False boton(0).Enabled = False nombre.Text = Nomb Case 1 ' Boton Eliminar: Comprobar si tiene registros nombre.Text = Nomb Tabla.Open "Select count(numero) as total from matriculas where AlumnoId = " & BuscarOpcion, Base.ConnectionString, adOpenForwardOnly If Tabla!total > 0 Then MsgBox "El estudiante " & Nomb & ", no se puede eliminar debido a que ha sido registrado en la tabla de matrículas.", vbExclamation, "Alumno contiene " & Tabla!total Tabla.Close Set Tabla = Nothing Exit Sub End If Tabla.Close Set Tabla = Nothing If MsgBox("¿Está seguro de querer eliminar al estudiante " & Nomb & ", del sistema para siempre?", vbInformation + vbYesNo) = vbYes Then Base.Execute "Delete * from datos where AlumnoId = " & BuscarOpcion
111
MsgBox "Estudiante " & Nomb & ", eliminado totalmente de la base de datos", vbInformation Nomb = "" BuscarOpcion = "0" Limpiar bloquear (False) End If Case 2 ' Boton guardar If Year(Date) - Year(nacido.Value) < 4 Then If MsgBox("La edad mínima del estudiante debe ser a partir de los 4 años. ¿Aún así desea continuar?", vbYesNo + vbExclamation, "Edad seleccionada = " & Year(Date) - Year(nacido.Value)) = vbNo Then Exit Sub End If Base.Execute "Update datos set nombre = '" & nombre.Text & "', lnacimiento = '" & Left(lnacido.Text, 30) & "', fecha = '" & nacido.Value & "', Procedencia = '" & Left(procedencia.Text, 30) & "', Ciudad = '" & Left(ciudad.Text, 30) & "',claseescuela = '" & Left(claseescuela.Text, 20) & "', anioescuela = '" & Left(anioescolar.Text, 20) & "', calificacion = " & Val(calificacion) & ", origenmatricula = '" & Left(origenmatricula.Text, 30) & "',nacionalidad = '" & Left(nacionalidad.Text, 20) & "',vivecon = '" & Left(vivecon.Text, 40) & "',fono = '" & fono.Text & "',padre = '" & padre.Text & "', madre = '" & madre.Text & "',Direapoderado = '" & direcciona.Text & "',OcupacionP = '" & ocupacionp.Text &
"',OcupacionM
=
'"
& ocupacionm.Text
& "',Situacion
=
'"
&
Left(situacion.Text, 10) & "',salud = '" & Left(salud.Text, 20) & "',sexo = " & Sex & " Where AlumnoId = " & BuscarOpcion Nomb = nombre.Text MsgBox "Estudiante " & Nomb & ", modificado a perfección", vbInformation, "Estudiante modificado" bloquear (False) boton(0).Enabled = True boton(1).Enabled = True Case Else
112
Unload mestudiante End Select Exit Sub salir: If MsgBox(Err.Description, vbRetryCancel + vbQuestion, Err.Number) = vbRetry Then boton_Click (Index) Else Unload Me End Sub
Private Sub Command1_Click() bloquear (False) LlenarCombos boton(2).Enabled = False BuscarOpcion = "Select AlumnoId, Nombre from datos where left(nombre," & Len(nombre.Text) & ") = '" & nombre.Text & "' order by nombre;" Cuenta = "Select count(Nombre) as total from datos where left(nombre," & Len(nombre.Text) & ") = '" & nombre.Text & "'" consulta.Show 1 If BuscarOpcion = "0" Then bloquear (False): Limpiar: Exit Sub Tabla.Open "Select * from datos where alumnoid = " & BuscarOpcion, Base.ConnectionString, adOpenForwardOnly boton(0).Enabled = True boton(1).Enabled = True LlenarDatos Tabla.Close Set Tabla = Nothing boton(2).Enabled = False boton(0).SetFocus End Sub
Private Sub LlenarDatos() On Error GoTo salir Nomb = Tabla!nombre
113
nombre.Text = Tabla!nombre If Tabla!lnacimiento <> "" Then lnacido.Text = Tabla!lnacimiento Else lnacido.Text = "" If Tabla!vivecon <> "" Then vivecon.Text = Tabla!vivecon Else vivecon.Text = "" If Tabla!procedencia <> "" Then procedencia.Text = Tabla!procedencia Else procedencia.Text = "" If Tabla!ciudad <> "" Then ciudad.Text = Tabla!ciudad Else ciudad.Text = "" If Tabla!claseescuela <> "" Then claseescuela.Text = Tabla!claseescuela Else claseescuela.Text = "" If Tabla!AnioEscuela <> "" Then anioescolar.Text = Tabla!AnioEscuela Else anioescolar.Text = "" If Tabla!calificacion <> "" Then calificacion.Text = Tabla!calificacion Else calificacion.Text = "" If
Tabla!origenmatricula
<>
""
Then
origenmatricula.Text
=
Tabla!origenmatricula Else origenmatricula.Text = "" If Tabla!nacionalidad <> "" Then nacionalidad.Text = Tabla!nacionalidad Else nacionalidad.Text = "" If Tabla!fono <> "" Then fono.Text = Tabla!fono Else fono.Text = "" If Tabla!direapoderado <> "" Then direcciona.Text = Tabla!direapoderado Else direcciona.Text = "" If Tabla!padre <> "" Then padre.Text = Tabla!padre Else padre.Text = "" If Tabla!madre <> "" Then madre.Text = Tabla!madre Else madre.Text = "" If Tabla!ocupacionp <> "" Then ocupacionp.Text = Tabla!ocupacionp Else ocupacionp.Text = "" If Tabla!ocupacionm <> "" Then ocupacionm.Text = Tabla!ocupacionm Else ocupacionm.Text = "" If Tabla!situacion <> "" Then situacion.Text = Tabla!situacion Else situacion.Text = "" If Tabla!salud <> "" Then salud.Text = Tabla!salud Else salud.Text = "" If Tabla!padre <> "" Then padre.Text = Tabla!padre Else padre.Text = "" If Tabla!fecha <> "" Then nacido.Value = Tabla!fecha
114
Sexo(Tabla!Sexo).Value = True Sex = Tabla!Sexo Exit Sub salir: If MsgBox(Err.Description, vbExclamation + vbRetryCancel) = vbRetry Then LlenarDatos Else Unload Me End Sub
Private Sub bloquear(opcion As Boolean) ciudad.Enabled = opcion direcciona.Enabled = opcion nacionalidad.Enabled = opcion situacion.Enabled = opcion vivecon.Enabled = opcion salud.Enabled = opcion lnacido.Enabled = opcion padre.Enabled = opcion nacido.Enabled = opcion ocupacionp.Enabled = opcion madre.Enabled = opcion fono.Enabled = opcion procedencia.Enabled = opcion anioescolar.Enabled = opcion claseescuela.Enabled = opcion calificacion.Enabled = opcion origenmatricula.Enabled = opcion ocupacionm.Enabled = opcion fono.Enabled = opcion boton(0).Enabled = opcion boton(1).Enabled = opcion boton(2).Enabled = opcion Frame1.Enabled = opcion
115
Sexo(0).Enabled = opcion Sexo(1).Enabled = opcion For i% = 1 To 18 Label1(i%).Enabled = opcion Next End Sub
Private Sub Limpiar() nombre.Text = "" ciudad.Text = "" direcciona.Text = "" nacionalidad.Text = "" situacion.Text = "" procedencia.Text = "" anioescolar.Text = "" calificacion.Text = "" claseescuela.Text = "" origenmatricula.Text = "" vivecon.Text = "" salud.Text = "" lnacido.Text = "" padre.Text = "" ocupacionp.Text = "" fono.Text = "" madre.Text = "" ocupacionm.Text = "" fono.Text = "" End Sub
Private Sub Form_Load() bloquear (False) nacido.Value = Date
116
nacido.MaxDate = Date Sex = 0 Sexo(0).Value = True End Sub
Private Sub LlenarCombos() lnacido.Clear procedencia.Clear ciudad.Clear origenmatricula.Clear anioescolar.Clear claseescuela.Clear nacionalidad.Clear vivecon.Clear situacion.Clear salud.Clear Set Tabla = Base.Execute("Select DISTINCT lnacimiento FROM DATOS Where Lnacimiento <> '' order by lnacimiento") While Not Tabla.EOF lnacido.AddItem Tabla!lnacimiento Tabla.MoveNext Wend Tabla.Close Set Tabla = Nothing Set Tabla = Base.Execute("Select DISTINCT procedencia FROM Datos Where Procedencia <> '' order by procedencia") While Not Tabla.EOF procedencia.AddItem Tabla!procedencia Tabla.MoveNext Wend Tabla.Close Set Tabla = Nothing
117
Set Tabla = Base.Execute("Select DISTINCT Ciudad from datos Where Ciudad <> '' order by ciudad") While Not Tabla.EOF ciudad.AddItem Tabla!ciudad Tabla.MoveNext Wend Tabla.Close Set Tabla = Nothing Set Tabla = Base.Execute("Select DISTINCT OrigenMatricula from datos where OrigenMatricula <> '' order by OrigenMatricula") While Not Tabla.EOF origenmatricula.AddItem Tabla!origenmatricula Tabla.MoveNext Wend Tabla.Close Set Tabla = Nothing Set Tabla = Base.Execute("Select DISTINCT Nacionalidad from datos Where Nacionalidad <> '' order by nacionalidad") While Not Tabla.EOF nacionalidad.AddItem Tabla!nacionalidad Tabla.MoveNext Wend Tabla.Close Set Tabla = Nothing Set Tabla = Base.Execute("Select DISTINCT Vivecon from datos Where vivecon <> '' order by vivecon") While Not Tabla.EOF vivecon.AddItem Tabla!vivecon Tabla.MoveNext Wend Tabla.Close Set Tabla = Nothing
118
Set Tabla = Base.Execute("Select DISTINCT Situacion from datos Where Situacion <> '' order by Situacion") While Not Tabla.EOF situacion.AddItem Tabla!situacion Tabla.MoveNext Wend Tabla.Close Set Tabla = Nothing Set Tabla = Base.Execute("Select DISTINCT Salud from datos Where salud <> '' order by salud") While Not Tabla.EOF salud.AddItem Tabla!salud Tabla.MoveNext Wend Tabla.Close Set Tabla = Nothing Set Tabla = Base.Execute("Select DISTINCT AnioEscuela from datos Where AnioEscuela <> '' order by AnioEscuela") While Not Tabla.EOF anioescolar.AddItem Tabla!AnioEscuela Tabla.MoveNext Wend Tabla.Close Set Tabla = Nothing Set Tabla = Base.Execute("Select DISTINCT ClaseEscuela from datos Where ClaseEscuela <> '' order by ClaseEscuela") While Not Tabla.EOF claseescuela.AddItem Tabla!claseescuela Tabla.MoveNext Wend Tabla.Close Set Tabla = Nothing
119
End Sub
1.12. FORMULARIO REGISTRAR MATRICULA
Dim Tabla As New ADODB.Recordset
Private Sub boton_Click(Index As Integer) On Error GoTo salir Select Case Index Case 0 ado.Refresh busc.Text = "" LlenarCurso LlenarMateria Set Tabla = Base.Execute("Select (Max(numero) + 1) as numero from matriculas where lectivo = " & Year(Date)) If IsNull(Tabla!numero) Then numero = 1 Else numero = Val(Tabla!numero) Tabla.Close Set Tabla = Nothing bloquear (True) Case 1 If Len(curso) = 0 Then MsgBox "Campo vacio", vbExclamation curso.SetFocus Exit Sub ElseIf Len(representa) = 0 Then MsgBox "Campo vacio", vbExclamation representa.SetFocus Exit Sub ElseIf Len(obs) = 0 Then MsgBox "Campo vacio", vbExclamation obs.SetFocus
120
Exit Sub End If If curso.ListIndex = -1 Or Val(nombre.BoundText) = 0 Then MsgBox "Seleccione toda la información antes de continuar", vbExclamation: Exit Sub If MaxAlumnos > 0 Then Tabla.Open "Select count(*) + 1 as total from matriculas where idcurso = " & curso.ItemData(curso.ListIndex)
&
"
and
lectivo
=
"
&
Year(Date),
Base.ConnectionString, adOpenStatic If Tabla!total > MaxAlumnos Then MsgBox "No se pueden registrar más de " & MaxAlumnos & " en el año básico seleccionado", vbExclamation, "Limite del curso lleno" Tabla.Close Set Tabla = Nothing curso.SetFocus Exit Sub End If Tabla.Close Set Tabla = Nothing End If Tabla.Open "Select count(alumnoid) + 1 as total from matriculas where alumnoid = " & Val(nombre.BoundText) & " and lectivo = " & Year(Date), Base.ConnectionString, adOpenForwardOnly If Tabla!total > 1 Then MsgBox "El estudiante " & busc.Text & " ya ha sido matriculado en este año lectivo", vbExclamation, "Alumno ya matriculado" Tabla.Close Set Tabla = Nothing busc.SetFocus Exit Sub End If Tabla.Close Set Tabla = Nothing
121
Base.Execute
"Insert
Into
matriculas(numero,lectivo,AlumnoId,
IdCurso,Representante, fecha) values(" & Val(numero.Text) & "," & Year(Date) & "," & Val(nombre.BoundText) & "," & curso.ItemData(curso.ListIndex) & ",'" & representa.Text & "','" & Format(Now, "dd/mm/yyyy") & "')" MsgBox "Alumno matriculado a perfecci贸n", vbInformation bloquear (False) Case Else Unload Me ' Salir End Select Exit Sub salir: If MsgBox(Err.Description, vbExclamation + vbRetryCancel) = vbRetry Then boton_Click (Index) Else Unload Me End Sub
Private Sub busc_Change() nombre.Text = busc.Text If Len(busc) = 0 Then nombre.Visible = False Else nombre.Visible = True End Sub
Private Sub busc_KeyDown(KeyCode As Integer, Shift As Integer) If Len(busc) > 0 Then Select Case KeyCode Case 40, 38 If nombre.Visible = True Then nombre.SetFocus End Select End If End Sub
Private Sub busc_KeyPress(KeyAscii As Integer) Select Case KeyAscii
122
Case 13 If Not IsNull(nombre.SelectedItem) Then curso.SetFocus End If End Select End Sub
Private Sub LlenarCurso() On Error GoTo salir Tabla.Open "Select * from curso order by nombre", Base.ConnectionString, adOpenDynamic curso.Clear While Not Tabla.EOF curso.AddItem Tabla!nombre curso.ItemData(curso.NewIndex) = Tabla!IdAnio Tabla.MoveNext Wend Tabla.Close Set Tabla = Nothing Exit Sub salir: If MsgBox(Err.Description, vbExclamation + vbRetryCancel) = vbRetry Then LlenarCurso Else Unload Me End Sub
Private Sub curso_Click() LlenarMateria End Sub
Private Sub Form_Load() On Error GoTo salir lectivo.Text = Year(Date)
123
If Tabla.State = 1 Then Tabla.Close Set Tabla = Nothing End If ado.ConnectionString = Base.ConnectionString ado.RecordSource = "Select datos.Nombre, datos.AlumnoId from datos order by datos.nombre" bloquear (False) materia.Rows = 1 central.MousePointer = vbNormal Exit Sub salir: If MsgBox(Err.Description, vbExclamation + vbRetryCancel) = vbRetry Then Form_Load Else Unload Me End Sub
Private Sub bloquear(opcion As Boolean) nombre.Enabled = opcion numero.Enabled = opcion lectivo.Enabled = opcion materia.Enabled = opcion If opcion = False Then materia.ForeColorFixed = &H8000000C Else materia.ForeColorFixed = RGB(0, 0, 0) End If curso.Enabled = opcion obs.Enabled = opcion busc.Enabled = opcion boton(0).Enabled = Not opcion boton(1).Enabled = opcion representa.Enabled = opcion
124
For i% = 0 To 5 Label1(i%).Enabled = opcion Next End Sub
Private Sub nombre_DblClick(Area As Integer) nombre_KeyPress (13) End Sub
Private Sub nombre_GotFocus() SendKeys "{Down}" End Sub
Private Sub nombre_KeyPress(KeyAscii As Integer) Select Case KeyAscii Case 13 busc.Text = nombre.Text nombre.Visible = False curso.SetFocus Case Else KeyAscii = 0 End Select End Sub
Private Sub LlenarMateria() On Error GoTo salir materia.Clear materia.Rows = 1 materia.FormatString = "Materia|Profesor" materia.ColWidth(0) = 3500 materia.ColWidth(1) = 3500 If curso.ListIndex = -1 Then Exit Sub
125
Set Tabla = Base.Execute("Select materias.nombre as Materia, profesores.nombre as Profesor from aux, materias, profesores where materias.materiaid = aux.materiaid and profesores.profesorid = aux.profesorid and aux.anioid = " & curso.ItemData(curso.ListIndex) & " order by materias.nombre") While Not Tabla.EOF With materia .Rows = .Rows + 1 .Row = .Rows - 1 .Col = 0 .Text = Tabla!materia .Col = 1 .Text = Tabla!profesor End With Tabla.MoveNext Wend Tabla.Close Set Tabla = Nothing Exit Sub salir: If MsgBox(Err.Description, vbExclamation + vbRetryCancel) = vbRetry Then LlenarMateria Else Unload Me End Sub
Private Sub obs_KeyPress(KeyAscii As Integer) Select Case KeyAscii Case 32 If Len(obs.Text) = 0 Then KeyAscii = 0 Case 65 To 90, 97 To 122, 8 Case Asc("á"), Asc("é"), Asc("í"), Asc("ó"), Asc("ú") Case Asc("Ñ"), Asc("ñ") Case Else KeyAscii = 0
126
End Select End Sub
Private Sub obs_LostFocus() obs = StrConv(obs, vbProperCase) End Sub
Private Sub representa_KeyPress(KeyAscii As Integer) Select Case KeyAscii Case 32 If Len(representa.Text) = 0 Then KeyAscii = 0 Case 65 To 90, 97 To 122, 8 Case Asc("á"), Asc("é"), Asc("í"), Asc("ó"), Asc("ú") Case Asc("Ñ"), Asc("ñ") Case 13 obs.SetFocus Case Else KeyAscii = 0 End Select End Sub
Private Sub representa_LostFocus() representa = StrConv(representa, vbProperCase) End Sub
1.13. FORMULARIO ACTUALIZACIÓN DE MATRICULAS
Dim Tabla As New ADODB.Recordset
Private Sub boton_Click(Index As Integer) On Error GoTo salir Select Case Index
127
Case 0 bloquear (True) boton(0).Enabled = False boton(1).Enabled = False boton(2).Enabled = True If curso.Enabled = True Then curso.SetFocus Case 1 Base.Execute
"Delete
*
from
matriculas
where
numero
=
"
&
nombre.ItemData(nombre.ListIndex) & " and lectivo = " & Year(Date) bloquear (False) curso.ListIndex = -1 representa.Text = "" obs.Text = "" LlenarAlumnos MsgBox "Estudiante eliminado a perfecci贸n del sistema", vbInformation Case 2 Base.Execute
"Update
matriculas
set
idcurso
=
"
&
curso.ItemData(curso.ListIndex) & ", Representante = '" & representa.Text & "', observacion
=
'"
&
obs.Text
&
"'
where
numero
=
"
&
nombre.ItemData(nombre.ListIndex) & " and lectivo = " & Year(Date) curso.ListIndex = -1 representa.Text = "" obs.Text = "" LlenarAlumnos bloquear (False) boton(0).Enabled = False MsgBox "Estudiante modificado a perfecci贸n", vbInformation Case 3 Unload Me End Select Exit Sub salir:
128
Select Case Err.Number Case Existente MsgBox "El estudiante seleccionado tiene notas registradas en el sistema, por este motivo no se lo debe eliminar.", vbExclamation Case Else If MsgBox(Err.Description, vbExclamation + vbRetryCancel) = vbRetry Then boton_Click (Index) Else Unload Me End Select End Sub
Private Sub bloquear(opcion As Boolean) nombre.Enabled = Not opcion materia.Enabled = opcion If opcion = False Then materia.ForeColorFixed = &H8000000C Else materia.ForeColorFixed = RGB(0, 0, 0) End If curso.Enabled = opcion obs.Enabled = opcion boton(0).Enabled = opcion boton(1).Enabled = opcion boton(2).Enabled = opcin representa.Enabled = opcion Label1(0).Enabled = Not opcion Label1(4).Enabled = Not opcion For i% = 1 To 3 Label1(i%).Enabled = opcion Next End Sub
Private Sub curso_Click()
129
LlenarMateria End Sub
Private Sub Form_Load() bloquear (False) LlenarAlumnos LlenarCurso lectivo.Text = Year(Date) End Sub
Private Sub LlenarAlumnos() On Error GoTo salir nombre.Clear Tabla.Open "Select nombre, numero from datos, matriculas where lectivo = " & Year(Date)
&
"
and
datos.alumnoid
=
matriculas.alumnoid",
Base.ConnectionString, adOpenDynamic 'Set tabla = Base.Execute("Select nombre, numero from datos, matriculas where lectivo = " & Year(Date) & " and datos.alumnoid = matriculas.alumnoid", Base.ConnectionString, adOpenDynamic) While Not Tabla.EOF nombre.AddItem Tabla!nombre nombre.ItemData(nombre.NewIndex) = Tabla!numero Tabla.MoveNext Wend Tabla.Close Set Tabla = Nothing Exit Sub salir: If MsgBox(Err.Description, vbExclamation + vbRetryCancel) = vbRetry Then LlenarAlumnos Else Unload Me End Sub
130
Private Sub LlenarCurso() On Error GoTo salir Tabla.Open "Select * from curso order by nombre", Base.ConnectionString, adOpenDynamic While Not Tabla.EOF curso.AddItem Tabla!nombre curso.ItemData(curso.NewIndex) = Tabla!IdAnio Tabla.MoveNext Wend Tabla.Close Set Tabla = Nothing Exit Sub salir: If MsgBox(Err.Description, vbExclamation + vbRetryCancel) = vbRetry Then LlenarCurso Else Unload Me End Sub
Private Sub nombre_Click() On Error GoTo salir If nombre.ListIndex = -1 Then Exit Sub Set Tabla = Base.Execute("Select idcurso, representante, observacion from matriculas where numero = " & nombre.ItemData(nombre.ListIndex) & " and lectivo = " & Year(Date)) If Not Tabla.EOF Then If Not IsNull(Tabla!representante) Then representa.Text = Tabla!representante If Not IsNull(Tabla!observacion) Then obs.Text = Tabla!observacion For i% = 0 To curso.ListCount - 1 If Tabla!idcurso = curso.ItemData(i%) Then Tabla.Close Set Tabla = Nothing curso.ListIndex = i% Exit For
131
End If Next End If If Tabla.State = 1 Then Tabla.Close Set Tabla = Nothing End If boton(0).Enabled = True boton(1).Enabled = True Exit Sub salir: If MsgBox(Err.Description, vbExclamation + vbRetryCancel) = vbRetry Then nombre_Click Else Unload Me End Sub
Private Sub LlenarMateria() On Error GoTo salir materia.Clear materia.Rows = 1 materia.FormatString = "Materia|Profesor" materia.ColWidth(0) = 3500 materia.ColWidth(1) = 3500 If curso.ListIndex = -1 Then Exit Sub Set Tabla = Base.Execute("Select materias.nombre as Materia, profesores.nombre as Profesor from aux, materias, profesores where materias.materiaid = aux.materiaid and profesores.profesorid = aux.profesorid and aux.anioid = " & curso.ItemData(curso.ListIndex) & " order by materias.nombre") While Not Tabla.EOF With materia .Rows = .Rows + 1 .Row = .Rows - 1 .Col = 0
132
.Text = Tabla!materia .Col = 1 .Text = Tabla!profesor End With Tabla.MoveNext Wend Tabla.Close Set Tabla = Nothing Exit Sub salir: If MsgBox(Err.Description, vbExclamation + vbRetryCancel) = vbRetry Then LlenarMateria Else Unload Me End Sub
Private Sub obs_KeyPress(KeyAscii As Integer) Select Case KeyAscii Case 32 If Len(obs.Text) = 0 Then KeyAscii = 0 Case 65 To 90, 97 To 122, 8 Case Asc("á"), Asc("é"), Asc("í"), Asc("ó"), Asc("ú") Case Asc("Ñ"), Asc("ñ") Case Else KeyAscii = 0 End Select End Sub
Private Sub obs_LostFocus() obs = StrConv(obs, vbProperCase) End Sub
Private Sub representa_KeyPress(KeyAscii As Integer) Select Case KeyAscii
133
Case 32 If Len(representa.Text) = 0 Then KeyAscii = 0 Case 65 To 90, 97 To 122, 8 Case Asc("á"), Asc("é"), Asc("í"), Asc("ó"), Asc("ú") Case Asc("Ñ"), Asc("ñ") Case 13 obs.SetFocus Case Else KeyAscii = 0 End Select End Sub
Private Sub representa_LostFocus() representa = StrConv(representa, vbProperCase) End Sub
1.14. FORMULARIO INGRESO DE NOTAS
Dim Tabla As New ADODB.Recordset
Private Sub anio_Click() ciclo_Click End Sub
Private Sub anio_KeyPress(KeyAscii As Integer) Select Case KeyAscii Case 48 To 57 If Len(anio.Text) > 3 Then KeyAscii = 0 Case 8 Case Else KeyAscii = 0 End Select
134
End Sub
Private Sub boton_Click(Index As Integer) On Error GoTo salir Select Case Index Case 0 LlenarCiclo bloquear (True) boton(1).Enabled = False Case 1 For i% = 1 To nota.Rows - 1 nota.Row = i% nota.Col = 1 S$ = "Update notas set tareas = " & nota.Text nota.Col = 2 S$ = S$ & ", varios = " & Val(nota.Text) & "," nota.Col = 3 S$ = S$ & " aporte = " & Val(nota.Text) & "," nota.Col = 4 S$ = S$ & " examen = " & Val(nota.Text) & "," nota.Col = 5 S$ = S$ & " promedio = " & Val(nota.Text) & "," nota.Col = 6 S$ = S$ & " conducta = " & Val(nota.Text) S$ = S$ & " where numero = " & Val(alumno.BoundText) & " and lectivo = " & Val(anio.Text) & " and materiaid = " & nota.RowData(i%) & " and trimestre = " & Val(parcial.Text) Base.Execute S$ Next MsgBox "Notas registradas a perfecci贸n", vbInformation bloquear (False) Case 2
135
Unload Me End Select Exit Sub salir: If MsgBox(Err.Description, vbExclamation + vbRetryCancel) = vbRetry Then boton_Click (Index) Else Unload Me End Sub
Private Sub ciclo_Click() alumno.Text = "" If ciclo.ListIndex = -1 Then Exit Sub nombre.RecordSource = "Select datos.nombre, matriculas.numero from datos inner join matriculas on datos.alumnoid matriculas.Idcurso
=
"
&
= matriculas.alumnoid where
ciclo.ItemData(ciclo.ListIndex)
&
"
and
matriculas.lectivo = " & Val(anio.Text) nombre.Refresh End Sub
Private Sub Form_Load() nombre.ConnectionString = Base.ConnectionString nota.Rows = 1 UpDown1.Max = MaxParciales anio.ListIndex = ListCount - 1 bloquear (False) End Sub
Private Sub bloquear(opcion As Boolean) Frame1(0).Enabled = opcion Frame1(1).Enabled = opcion ciclo.Enabled = opcion If opcion = True Then
136
nombre.RecordSource = "Select datos.nombre, matriculas.numero from datos inner join matriculas on datos.alumnoid
= matriculas.alumnoid where
matriculas.Idcurso = 0 and matriculas.lectivo = 0" nombre.Refresh alumno.Text = "" nota.Clear nota.FormatString = "Materia|Tareas|Varios|Aporte|Examen|Promedio|Conducta" nota.ColWidth(0) = 1700 nota.Rows = 1 For i% = 1 To nota.Cols - 1 nota.ColWidth(i%) = 800 Next End If anio.Enabled = opcion alumno.Enabled = opcion muestra.Enabled = opcion boton(0).Enabled = Not opcion boton(1).Enabled = opcion nota.Enabled = opcion End Sub
Private Sub LlenarCiclo() On Error GoTo salir ciclo.Clear Set Tabla = Base.Execute("Select * from curso order by nombre") While Not Tabla.EOF ciclo.AddItem Tabla!nombre ciclo.ItemData(ciclo.NewIndex) = Tabla!IdAnio Tabla.MoveNext Wend Tabla.Close Set Tabla = Nothing
137
anio.Clear Set Tabla = Base.Execute("Select DISTINCT lectivo from matriculas group by lectivo order by lectivo") While Not Tabla.EOF anio.AddItem Tabla!lectivo Tabla.MoveNext Wend Tabla.Close Set Tabla = Nothing Exit Sub salir: If MsgBox(Err.Description, vbExclamation + vbRetryCancel) = vbRetry Then LlenarCiclo Else Unload Me End Sub
Private Sub muestra_Click() On Error GoTo salir If ciclo.ListIndex = -1 Or Val(anio.Text) <= 0 Or Val(alumno.BoundText) = 0 Then Exit Sub Tabla.Open "Select count(numero) as Total from notas where numero = " & Val(alumno.BoundText) & " and lectivo = " & Val(anio.Text) & " and trimestre = " & UpDown1.Value, Base.ConnectionString, adOpenDynamic If Tabla!total > 0 Then Tabla.Close 'Set Tabla = Nothing Else Tabla.Close Set Tabla = Nothing Base.Execute
("Insert into notas(numero,lectivo,materiaid,trimestre)
Select
materiaid-materiaid+ " & Val(alumno.BoundText) & " as codigo, materiaidmateriaid+ " & anio.Text & " as lectiv ,materiaid, materiaid-materiaid+" &
138
UpDown1.Value
&
"
as
trime
from
aux
where
anioid
=
"
&
ciclo.ItemData(ciclo.ListIndex)) Set Tabla = Base.Execute("select * from notas") Tabla.Requery Tabla.Close 'Set Tabla = Nothing End If nota.Clear nota.FormatString
=
"Materia
|Tareas
|Varios
|Aporte
|
Examen
|Promedio|Conducta" nota.ColWidth(0) = 1700 nota.Rows = 1 For i% = 1 To nota.Cols - 1 nota.ColWidth(i%) = 800 Next Tabla.Open
"Select
Materias.Materiaid,
tareas,varios,aporte,examen,conducta materias.materiaid
=
from
notas.materiaid
and
materias,
Materias.nombre, notas
notas.numero
=
where "
&
Val(alumno.BoundText) & " and notas.lectivo = " & Val(anio.Text) & " and notas.trimestre = " & Val(parcial.Text) & " order by materias.nombre" While Not Tabla.EOF With nota .Rows = .Rows + 1 .Row = .Rows - 1 .Col = 0 .RowData(.Rows - 1) = Tabla!MateriaId .Text = Tabla!nombre .Col = 1 .Text = Tabla!tareas .Col = 2 .Text = Tabla!varios .Col = 3
139
.Text = Tabla!aporte .Col = 4 .Text = Tabla!examen .Col = 5 .Text = (Tabla!tareas + Tabla!varios + Tabla!aporte + Tabla!examen) / 4 .Col = 6 .Text = Tabla!CONDUCTA End With Tabla.MoveNext Wend Tabla.Close Set Tabla = Nothing Frame1(1).Enabled = False boton(1).Enabled = True alumno.Enabled = False anio.Enabled = False ciclo.Enabled = False muestra.Enabled = False Exit Sub salir: If MsgBox(Err.Description, vbExclamation + vbRetryCancel) = vbRetry Then muestra_Click Else Unload Me End Sub
Private Sub nota_KeyDown(KeyCode As Integer, Shift As Integer) Dim promedio As Single If nota.Col <> 0 And nota.Col <> 5 Then If KeyCode = 46 Then nota.Text = 0 a% = nota.Col For i% = 1 To nota.Cols - 3 'estaba 2 nota.Col = i% promedio = promedio + Val(nota.Text)
140
Next promedio = promedio / 4 nota.Col = 5 nota.Text = Round(promedio, 2) nota.Col = a% End If End Sub
Private Sub nota_KeyPress(KeyAscii As Integer) On Error Resume Next Dim promedio As Single If nota.Col <> 0 And nota.Col <> 5 Then Select Case KeyAscii Case 48 To 57 nota.Text = Val(nota.Text) * 10 + (KeyAscii - 48) If nota.Text > MaxNota Then nota.Text = Int(nota.Text / 10) a% = nota.Col For i% = 1 To nota.Cols - 3 'estaba 2 nota.Col = i% promedio = promedio + Val(nota.Text) Next promedio = promedio / 4 nota.Col = 5 nota.Text = Round(promedio, 2) nota.Col = a% Case 8 nota.Text = 0 a% = nota.Col For i% = 1 To nota.Cols - 3 'estaba 2 nota.Col = i% promedio = promedio + Val(nota.Text) Next
141
promedio = promedio / 4 nota.Col = 5 nota.Text = Round(promedio, 2) nota.Col = a% Case 13 nota.Col = nota.Col + 1 If nota.Col = 5 Then nota.Row = nota.Row + 1: nota.Col = 1 Case Else KeyAscii = 0 End Select End If End Sub
1.15. FORMULARIO CREAR NUEVA CLAVE
Dim Tabla As New ADODB.Recordset
Private Sub boton_Click(Index As Integer) On Error GoTo salir Select Case Index Case 0 bloquear (True) userid.Text = "" password(0).Text = "" password(1).Text = "" boton(1).Enabled = False userid.SetFocus Case 1 If password(0).Text <> password(1).Text Then MsgBox "Clave confirmada incorrectamente, Vuelva a intentarlo si desea continuar", vbInformation, "Clave incorrecta" Exit Sub
142
End If Set Tabla = Base.Execute("Select count(*) as total from usuarios where nombre = '" & userid.Text & "'") If Tabla!total > 0 Then MsgBox "Ya se ha registrado " & Tabla!total & " un usuario en el sistema con el mismo id. Si desea continuar cambie el valor del campo y vuelva a intentarlo", vbInformation, "Usuario ya registrado" Tabla.Close : Set Tabla = Nothing Exit Sub End If Tabla.Close : Set Tabla = Nothing Base.Execute "Insert into usuarios(nombre,clave) values('" & userid.Text & "','" & Encripta(password(0).Text, 1) & "')" bloquear (False) MsgBox "Usuario '" & userid.Text & "' agregado al sistema a perfecci贸n", vbInformation, "Usuario registrado" Case 2: Unload Me End Select Exit Sub salir: If MsgBox(Err.Description, vbExclamation + vbRetryCancel) = vbRetry Then boton_Click (Index) Else Unload Me End Sub
Private Sub Check1_Click() If Check1.Value Then Config.mascara = True password(0).PasswordChar = "*": password(1).PasswordChar = "*" Else Config.mascara = False password(0).PasswordChar = "": password(1).PasswordChar = "" End If
143
MenuVer End Sub
Private Sub Form_Load() If Config.mascara = True Then password(0).PasswordChar = "*" password(1).PasswordChar = "*" Check1.Value = 1 Else Check1.Value = 0 password(0).PasswordChar = "" password(1).PasswordChar = "" End If bloquear (False) End Sub
Private Sub password_Change(Index As Integer) boton(1).Enabled = prueba End Sub
Private Sub password_KeyPress(Index As Integer, KeyAscii As Integer) If KeyAscii = 13 Then If Index = 0 Then password(1).SetFocus Else If boton(1).Enabled = True Then boton(1).SetFocus End If End Sub
Private Sub userid_Change() boton(1).Enabled = prueba End Sub
Private Sub userid_KeyPress(KeyAscii As Integer)
144
If KeyAscii = 13 Then password(0).SetFocus End Sub
Private Sub bloquear(opcion As Boolean) userid.Enabled = opcion Label1(0).Enabled = opcion Label1(1).Enabled = opcion Label1(2).Enabled = opcion password(0).Enabled = opcion password(1).Enabled = opcion Frame1.Enabled = opcion boton(0).Enabled = Not opcion boton(1).Enabled = opcion End Sub
Private Function prueba() As Boolean If Len(RTrim(userid.Text)) = 0 Or Len(RTrim(password(0).Text)) = 0 Or Len(RTrim(password(1).Text)) = 0 Then prueba = False Else prueba = True End Function
Private Sub userid_LostFocus() userid = StrConv(userid, vbProperCase) End Sub
1.16. FORMULARIO MODIFICAR CLAVE
Dim Tabla As New ADODB.Recordset
Private Sub boton_Click(Index As Integer) On Error GoTo salir Select Case Index Case 0
145
bloquear (True) password(0).Text = "" password(1).Text = "" password(2).Text = "" boton(1).Enabled = False Case 1 Set Tabla = Base.Execute("Select clave from usuarios where iduser = " & nombre.ItemData(nombre.ListIndex)) If Tabla!clave <> Encripta(password(0).Text, 1) Then MsgBox "La contraseña actual es incorrecta. Cambie la contraseña y vuelva a intentarlo", vbExclamation, "Contraseña incorrecta" Tabla.Close Set Tabla = Nothing password(0).SetFocus Exit Sub End If Tabla.Close Set Tabla = Nothing If password(1).Text <> password(2).Text Then MsgBox "Contraseña confirmada incorrectamente. Vuelva a confirmar la contrase e inténtelo de nuevo", vbExclamation, "Confirmación incorrecta" password(1).SetFocus Exit Sub End If Base.Execute "Update Usuarios set clave = '" & Encripta(password(1).Text, 1) & "' where iduser = " & nombre.ItemData(nombre.ListIndex), 1 bloquear (False) boton(0).Enabled = False LlenarUsuarios password(0).Text = "" password(1).Text = "" password(2).Text = ""
146
MsgBox "Cambio de clave realizado a perfecci贸n.", vbInformation Case 2 Unload Me End Select Exit Sub salir: If MsgBox(Err.Description, vbExclamation + vbRetryCancel) = vbRetry Then boton_Click (Index) Else Unload Me End Sub
Private Sub Check1_Click() If Check1.Value Then Config.mascara = True password(0).PasswordChar = "*" password(1).PasswordChar = "*" password(2).PasswordChar = "*" Else Config.mascara = False password(0).PasswordChar = "" password(1).PasswordChar = "" password(2).PasswordChar = "" End If MenuVer End Sub
Private Sub Form_Load() LlenarUsuarios If Config.mascara = True Then Check1.Value = 1 password(0).PasswordChar = "*" password(1).PasswordChar = "*" password(2).PasswordChar = "*"
147
Else Check1.Value = 0 password(0).PasswordChar = "" password(1).PasswordChar = "" password(2).PasswordChar = "" End If bloquear (False) boton(0).Enabled = False End Sub
Private Sub LlenarUsuarios() On Error GoTo salir Set Tabla = Base.Execute("Select * from Usuarios order by nombre") nombre.Clear While Not Tabla.EOF nombre.AddItem Tabla!nombre nombre.ItemData(nombre.NewIndex) = Tabla!iduser Tabla.MoveNext Wend Tabla.Close Set Tabla = Nothing Exit Sub salir: If MsgBox(Err.Description, vbExclamation + vbRetryCancel) = vbRetry Then LlenarUsuarios Else Unload Me End Sub
Private Sub bloquear(opcion As Boolean) nombre.Enabled = Not opcion password(0).Enabled = opcion password(1).Enabled = opcion password(2).Enabled = opcion
148
Label1(0).Enabled = Not opcion Label1(1).Enabled = opcion Label1(2).Enabled = opcion Label1(3).Enabled = opcion boton(0).Enabled = Not opcion boton(1).Enabled = opcion End Sub
Private Sub nombre_Click() If nombre.ListIndex = -1 Then boton(0).Enabled = False Else boton(0).Enabled = True End Sub
Private Sub password_Change(Index As Integer) boton(1).Enabled = prueba End Sub
Private Sub password_KeyPress(Index As Integer, KeyAscii As Integer) If KeyAscii = 13 Then If Index < 2 Then password(Index + 1).SetFocus Else boton(1).SetFocus End If End If End Sub
Private Function prueba() As Boolean If password(0).Text = "" Or password(1).Text = "" Or password(2).Text = "" Then prueba = False Else prueba = True End Function
149
1.17. FORMULARIO ELIMINAR CLAVE
Dim Tabla As New ADODB.Recordset
Private Sub LlenarUsuarios() On Error GoTo salir Set Tabla = Base.Execute("Select * from Usuarios order by nombre") nombre.Clear While Not Tabla.EOF nombre.AddItem Tabla!nombre nombre.ItemData(nombre.NewIndex) = Tabla!iduser Tabla.MoveNext Wend Tabla.Close Exit Sub salir: If MsgBox(Err.Description, vbExclamation + vbRetryCancel) = vbRetry Then LlenarUsuarios Else Unload Me End Sub
Private Sub boton_Click(Index As Integer) On Error GoTo salir Select Case Index Case 0 Tabla.Open
"Select
clave
from
usuarios
where
iduser
=
"
&
nombre.ItemData(nombre.ListIndex) If Tabla!clave <> Encripta(password.Text, 1) Then Tabla.Close MsgBox "La clave del usuario seleccionado para ser eliminado del sistema es incorrecta. Cambie la clave y vuelva a intentarlo.", vbExclamation, "Error de clave" password.SetFocus
150
Exit Sub End If Tabla.Close Base.Execute
"Delete
*
from
usuarios
where
iduser
=
"
&
nombre.ItemData(nombre.ListIndex) MsgBox "Usuario: " & nombre.Text & " eliminado del sistema correctamente. ", vbInformation, "Usuario eliminado" boton(0).Enabled = False password.Text = "" LlenarUsuarios Case 1: Unload Me End Select Exit Sub salir: If MsgBox(Err.Description, vbExclamation + vbRetryCancel) = vbRetry Then boton_Click (Index) Else Unload Me End Sub
Private Sub Form_Load() LlenarUsuarios boton(0).Enabled = False End Sub
Private Function prueba() As Boolean If nombre.ListIndex = -1 Or password.Text = "" Then prueba = False Else prueba = True End Function
Private Sub nombre_Click() boton(0).Enabled = prueba End Sub
151
Private Sub password_Change() boton(0).Enabled = prueba End Sub
1.18. FORMULARIO CONFIGURACIÓN
Dim Tabla As New ADODB.Recordset
Private Sub boton_Click(Index As Integer) Select Case Index Case 0 atras: If Base.State = 0 Then S$ = Server Server = pathserver.Text a$ = AbrirBase If a$ <> "" Then If MsgBox("No se ha podido establecer una conexión con la base de datos. Motivo: - " & a$ & "-", vbRetryCancel + vbInformation) = vbRetry Then GoTo atras MsgBox "El sistema debe estar conectado a la base de datos para trabajar", vbCritical Server = S$ Unload Me Exit Sub End If MenuVer MsgBox "Para que los cambios den resultado se va a" & vbCr & " cerrar el programa y volvera a abrir", vbInformation DirectorInstitucion = Director.Text NombreInstitucion = nombre.Text DireccionInstitucion = Dire.Text
152
MaxNota = Val(nmaxima) MaxAlumnos = Val(maxalum) MaxParciales = Val(parciales) Base.Execute
"Insert
Into
institucion(nombre,direccion,director,nmaxima,maxalumnos,nparciales) values('" & NombreInstitucion & "','" & DireccionInstitucion & "','" & DirectorInstitucion & "'," & MaxNota & "," & MaxAlumnos & "," & MaxParciales & ")" Else Base.Execute "delete * from institucion" DirectorInstitucion = Director.Text NombreInstitucion = nombre.Text DireccionInstitucion = Dire.Text MaxNota = Val(nmaxima) MaxAlumnos = Val(maxalum) MaxParciales = Val(parciales) Base.Execute
"Insert
Into
institucion(nombre,direccion,director,nmaxima,maxalumnos,nparciales) values('" & NombreInstitucion & "','" & DireccionInstitucion & "','" & DirectorInstitucion & "'," & MaxNota & "," & MaxAlumnos & "," & MaxParciales & ")" End If Unload Me 'Unload central 'Load central 'central.Show Case 1 Unload Me End Select End Sub
Private Sub Command1_Click() On Error GoTo salir If Base.State = 1 Then
153
If MsgBox("La base de datos está abierta. Aún así desea continuar", vbQuestion + vbYesNo) <> vbYes Then Exit Sub Base.Close End If dialogo.FileName = "Datos.mdb" dialogo.CancelError = True dialogo.Filter = "Base de datos del sistema | escuela.mdb" dialogo.ShowOpen pathserver = dialogo.FileName salir: Exit Sub End Sub
Private Sub Dire_KeyPress(Tecla As Integer) Select Case Tecla Case Asc("a") To Asc("z") Case Asc("A") To Asc("Z") Case Asc("0") To Asc("9") Case Asc("á"), Asc("Ñ"), Asc("í") Case Asc("é"), Asc("ó"), Asc("ú"), Asc("ñ") Case 8, 32 Case 13 Director.SetFocus Case Else Tecla = 0 End Select End Sub
Private Sub Dire_LostFocus() Dire = StrConv(Dire, vbProperCase) End Sub
154
Private Sub Director_KeyPress(Tecla As Integer) Select Case Tecla Case Asc("a") To Asc("z") Case Asc("A") To Asc("Z") Case Asc("á"), Asc("é"), Asc("í") Case Asc("ó"), Asc("ú"), Asc("ñ"), Asc("Ñ") Case 8, 32 Case 13 boton(0).SetFocus Case Else Tecla = 0 End Select End Sub
Private Sub Director_LostFocus() Director = StrConv(Director, vbProperCase) End Sub
Private Sub Form_Load() If Base.State <> 0 Then nombre.Text = NombreInstitucion Dire.Text = DireccionInstitucion Director.Text = DirectorInstitucion pathserver.Text = Server maxalum = MaxAlumnos parciales.Text = MaxParciales nmaxima.Text = MaxNota esta.Clear If Base.State = 1 Then esta.AddItem "La base de datos esta correctamente conectada y lista para trabajar" esta.AddItem "Ubicación de la base de datos: " & Server esta.AddItem "Fin del informe"
155
End If End If End Sub
Private Sub max_KeyPress(KeyAscii As Integer) Select Case KeyAscii Case 48 To 57 Case 8 Case Else KeyAscii = 0 End Select End Sub
Private Sub maxalum_KeyPress(KeyAscii As Integer) Select Case KeyAscii Case 48 To 57 Case 8 Case Else KeyAscii = 0 End Select End Sub
Private Sub nmaxima_KeyPress(KeyAscii As Integer) Select Case KeyAscii Case 48 To 57, 8 Case 13 maxalum.SetFocus Case Else KeyAscii = 0 End Select End Sub
156
Private Sub nombre_KeyPress(Tecla As Integer) Select Case Tecla Case Asc("a") To Asc("z") Case Asc("A") To Asc("Z") Case Asc("á"), Asc("é"), Asc("í"), Asc("ó"), Asc("ú") Case Asc("ñ"), Asc("Ñ") Case 8, 32 Case 13: Dire.SetFocus Case Else: Tecla = 0 End Select End Sub
Private Sub nombre_LostFocus() nombre = StrConv(nombre, vbProperCase) End Sub
Private Sub parciales_KeyPress(KeyAscii As Integer) Select Case KeyAscii Case 48 To 57 Case 8 Case 13: nmaxima.SetFocus Case Else: KeyAscii = 0 End Select End Sub
1.19. FORMULARIO MEJORES ESTUDIANTES DEL PERIODO
Dim Tabla As New ADODB.Recordset
Private Sub LlenarLectivo() If Tabla.State = 1 Then Tabla.Close
157
Set Tabla = Nothing End If Set Tabla = Base.Execute("Select DISTINCT lectivo from matriculas order by lectivo") lectivo.Clear While Not Tabla.EOF lectivo.AddItem Tabla!lectivo Tabla.MoveNext Wend Tabla.Close End Sub
Private Sub boton_Click(Index As Integer) Select Case Index Case 0 On Error GoTo Trata If lectivo.ListIndex = -1 Then MsgBox "Debe seleccionar el a帽o lectivo del cual desee mostrar la informaci贸n requerida", vbExclamation: Exit Sub If Tabla.State = 1 Then Tabla.Close End If Tabla.Open "SELECT Datos.Nombre, Matriculas.Numero, Curso.nombre as curso, Avg(Notas.Promedio) AS Promedio " & _ "FROM
Curso
INNER
Datos.AlumnoId (Matriculas.Lectivo
=
JOIN
((Datos
Matriculas.AlumnoId) =
Notas.Lectivo)
INNER
JOIN
INNER AND
Matriculas
JOIN
Notas
(Matriculas.Numero
ON ON =
Notas.Numero)) ON Curso.IdAnio = Matriculas.Idcurso " & _ "GROUP
BY
Datos.Nombre,
Matriculas.Numero,
Curso.nombre,
matriculas.lectivo " & _ "HAVING (((Matriculas.Lectivo)= " & Val(lectivo.Text) & ")) " & _ "ORDER BY Avg(Notas.Promedio) DESC;" Set mejores.DataSource = Tabla
158
mejores.Sections("cab").Controls("desde").Caption = lectivo.Text & "-" & Val(lectivo.Text) + 1 mejores.Sections("deta").Controls("numero").DataField = "numero" mejores.Sections("deta").Controls("nombre").DataField = "nombre" mejores.Sections("deta").Controls("ciclo").DataField = "curso" mejores.Sections("deta").Controls("promedio").DataField = "promedio" mejor.Hide mejores.Refresh mejores.Show Exit Sub Trata: Case 1 mejor.Hide End Select End Sub
Private Sub Form_Load() LlenarLectivo End Sub
1.20. FORMULARIO LISTA DE ESTUDIANTES POR AÑO BÁSICA
Dim Tabla As New ADODB.Recordset
Private Sub boton_Click(Index As Integer) Select Case Index Case 0 On Error GoTo Trata FRMEstudiantes2.ssQLL = "SELECT matriculas.numero, datos.Nombre AS Alunmo,
notas.lectivo,
curso.nombre AS
grado, format(matriculas.fecha-
datos.fecha,'yy') AS Edad, representante From datos, matriculas, notas, curso WHERE
datos.alumnoid=matriculas.alumnoid
and
159
matriculas.numero=notas.numero matriculas.idcurso
=
"
&
and
matriculas.idcurso=curso.idanio
ciclo.ItemData(ciclo.ListIndex)
&
"
and And
matriculas.lectivo = " & Val(lectivo.Text) & " GROUP BY matriculas.numero, datos.Nombre,
notas.lectivo,
curso.nombre,
matriculas.fecha,
datos.fecha,
matriculas.representante order by datos.nombre" FRMEstudiantes2.Show Exit Sub Trata: MsgBox "No hay datos que mostrar.", vbExclamation Case 1 Unload Me End Select End Sub
Private Sub ciclo_Click() If lectivo.ListIndex <> -1 Then boton(0).Enabled = True End Sub
Private Sub Form_Load() LlenarCiclo LlenarLectivo boton(0).Enabled = False End Sub
Private Sub LlenarCiclo() Set Tabla = Base.Execute("Select * from curso") ciclo.Clear While Not Tabla.EOF ciclo.AddItem Tabla!nombre ciclo.ItemData(ciclo.NewIndex) = Tabla!IdAnio Tabla.MoveNext Wend
160
Tabla.Close Set Tabla = Nothing End Sub
Private Sub LlenarLectivo() Set Tabla = Base.Execute("Select DISTINCT lectivo from matriculas order by lectivo") lectivo.Clear While Not Tabla.EOF lectivo.AddItem Tabla!lectivo Tabla.MoveNext Wend Tabla.Close Set Tabla = Nothing End Sub
Private Sub lectivo_Click() If ciclo.ListIndex <> -1 Then boton(0).Enabled = True End Sub
1.21. FORMULARIO NOTAS DEL AÑO BÁSICO POR MATERIA
Dim Tabla As New ADODB.Recordset
Private Sub LlenarCiclos() On Error GoTo salir ciclos.Clear Tabla.Open "Select * from curso order by nombre", Base.ConnectionString, adOpenDynamic While Not Tabla.EOF ciclos.AddItem Tabla!nombre ciclos.ItemData(ciclos.NewIndex) = Tabla!IdAnio
161
Tabla.MoveNext Wend Tabla.Close Set Tabla = Nothing lectivo.Clear Set Tabla = Base.Execute("Select DISTINCT lectivo from matriculas order by lectivo") While Not Tabla.EOF lectivo.AddItem Tabla!lectivo Tabla.MoveNext Wend Tabla.Close Set Tabla = Nothing Exit Sub salir: If MsgBox(Err.Description, vbQuestion + vbRetryCancel) = vbRetry Then LlenarCiclos End Sub
Private Sub boton_Click(Index As Integer) On Error GoTo salir Select Case Index Case 0 If materias.ListIndex <> -1 And ciclos.ListIndex <> -1 And lectivo.ListIndex <> 1 And parcial.ListIndex <> -1 Then sql$ = "SELECT matriculas.numero, Datos.Nombre, Notas.Tareas, Notas.Varios, Notas.Aporte, Notas.Examen, Notas.Promedio" sql$ = sql$ & " FROM (Datos INNER JOIN Matriculas ON Datos.AlumnoId = Matriculas.AlumnoId)
INNER
JOIN
Notas
ON
(Matriculas.Lectivo
=
Notas.Lectivo) AND (Matriculas.Numero = Notas.Numero)" sql$
=
sql$
&
"
WHERE
Notas.MateriaId
=
"
&
materias.ItemData(materias.ListIndex) & " AND Matriculas.Idcurso = " &
162
ciclos.ItemData(ciclos.ListIndex) & " AND Matriculas.Lectivo = " & lectivo.Text & " and notas.trimestre = " & Val(parcial.Text) & " order by datos.nombre, matriculas.numero;" Set Tabla = Base.Execute(sql$) If Not Tabla.EOF Then Set notacurso.DataSource = Tabla notacurso.Sections("enc").Controls("anio").Caption = ciclos.Text notacurso.Sections("enc").Controls("materia").Caption = materias.Text notacurso.Sections("enc").Controls("periodo").Caption = lectivo.Text & "-" & Val(lectivo.Text + 1) notacurso.Sections("enc").Controls("profesor").Caption = profe.Text notacurso.Sections("deta").Controls("numero").DataField = "numero" notacurso.Sections("deta").Controls("nombre").DataField = "nombre" notacurso.Sections("deta").Controls("tareas").DataField = "tareas" notacurso.Sections("deta").Controls("varios").DataField = "varios" notacurso.Sections("deta").Controls("aporte").DataField = "aporte" notacurso.Sections("deta").Controls("examen").DataField = "examen" notacurso.Sections("deta").Controls("promedio").DataField = "promedio" notasmaterias.Hide notacurso.Refresh notacurso.Show Else MsgBox "No existen notas para lo seleccionado", vbInformation ciclos.SetFocus Exit Sub End If Else MsgBox "Seleccione toda la informaci贸n necesaria para poder mostrar el reporte", vbExclamation End If Case 1 Unload Me
163
End Select Exit Sub salir: If MsgBox(Err.Description, vbQuestion + vbRetryCancel) = vbRetry Then boton_Click (Index) End Sub
Private Sub LlenarMaterias() On Error GoTo salir materias.Clear Set
Tabla
=
Base.Execute("Select
profesores.profesorid, profesores,aux
materias.nombre,
where
profesores.profesorid
=
profesores.nombre materias.materiaid
materias.materiaid aux.profesorid
and
=
as
profesor,
from
materias,
aux.materiaid aux.anioid
=
and "
&
ciclos.ItemData(ciclos.ListIndex)) While Not Tabla.EOF materias.AddItem Tabla!nombre materias.ItemData(materias.NewIndex) = Tabla!MateriaId profe.AddItem Tabla!profesor profe.ItemData(profe.NewIndex) = Tabla!profesorid Tabla.MoveNext Wend Tabla.Close Set Tabla = Nothing Exit Sub salir: If MsgBox(Err.Description, vbQuestion + vbRetryCancel) = vbRetry Then LlenarMaterias End Sub
Private Sub ciclos_Click() LlenarMaterias
164
End Sub
Private Sub Form_Load() If Tabla.State = 1 Then Tabla.Close Set Tabla = Nothing End If LlenarCiclos For i% = 1 To MaxParciales parcial.AddItem i% Next End Sub
Private Sub materias_Click() profe.ListIndex = materias.ListIndex End Sub
1.22. FORMULARIO NOTAS DEL ESTUDIANTE POR TRIMESTRE
Dim TablaNotas As New ADODB.Recordset Dim Tabla As New ADODB.Recordset
Private Sub anio_Click() If ciclo.ListIndex = -1 Then Exit Sub LlenarAlumnos End Sub
Private Sub boton_Click(Index As Integer) Select Case Index Case 0 If Tabla.State = 1 Then Tabla.Close
165
Set Tabla = Nothing End If If alumnos.ListIndex = -1 And ciclo.ListIndex = -1 Then Exit Sub Set
TablaNotas
=
Base.Execute("Select
Materias.nombre,
notas.tareas,notas.varios,notas.aporte,notas.examen,notas.promedio from materias inner join notas on materias.materiaid = notas.materiaid where notas.numero = " & alumnos.ItemData(alumnos.ListIndex) & " and notas.lectivo = " & Val(anio.Text) & " and notas.trimestre = " & Val(parcial.Text) & " order by materias.nombre") Set NotaAlumno.DataSource = TablaNotas NotaAlumno.Sections("Enc").Controls("nombre").Caption = alumnos.Text NotaAlumno.Sections("Enc").Controls("Ciclo").Caption = ciclo.Text NotaAlumno.Sections("Enc").Controls("lectivo").Caption = anio.Text & "-" & Val(anio.Text) + 1 NotaAlumno.Sections("Deta").Controls("Materia").DataField = "nombre" NotaAlumno.Sections("Deta").Controls("Tareas").DataField = "tareas" NotaAlumno.Sections("Deta").Controls("Varios").DataField = "varios" NotaAlumno.Sections("Deta").Controls("Aporte").DataField = "Aporte" NotaAlumno.Sections("Deta").Controls("Examen").DataField = "examen" NotaAlumno.Sections("Deta").Controls("Promedio").DataField = "Promedio" ReportNotas.Hide NotaAlumno.Refresh Load NotaAlumno NotaAlumno.Show Case 1 ReportNotas.Hide End Select End Sub
Private Sub LlenarCiclo() On Error GoTo salir ciclo.Clear
166
If Tabla.State = 1 Then Tabla.Close Set Tabla = Nothing End If Set Tabla = Base.Execute("Select * from curso order by nombre") While Not Tabla.EOF ciclo.AddItem Tabla!nombre ciclo.ItemData(ciclo.NewIndex) = Tabla!IdAnio Tabla.MoveNext Wend Tabla.Close: Set Tabla = Nothing Set Tabla = Base.Execute("Select DISTINCT lectivo from matriculas order by lectivo") While Not Tabla.EOF anio.AddItem Tabla!lectivo Tabla.MoveNext Wend Tabla.Close: Set Tabla = Nothing Exit Sub salir: If MsgBox(Err.Description, vbExclamation + vbRetryCancel) = vbRetry Then LlenarCiclo Else Unload Me End Sub
Private Sub ciclo_Click() If ciclo.ListIndex = -1 Then Exit Sub LlenarAlumnos End Sub
Private Sub Form_Load() LlenarCiclo UpDown1.Max = MaxParciales
167
anio.ListIndex = ListCount - 1 End Sub
Private Sub LlenarAlumnos() If Tabla.State = 1 Then Tabla.Close : Set Tabla = Nothing End If alumnos.Clear Set Tabla = Base.Execute("Select datos.nombre, matriculas.numero from datos inner join matriculas on datos.alumnoid matriculas.Idcurso
=
"
&
= matriculas.alumnoid where
ciclo.ItemData(ciclo.ListIndex)
&
"
and
matriculas.lectivo = " & Val(anio.Text)) While Not Tabla.EOF alumnos.AddItem Tabla!nombre alumnos.ItemData(alumnos.NewIndex) = Tabla!numero Tabla.MoveNext Wend Tabla.Close: Set Tabla = Nothing End Sub
1.23. FORMULARIO NOTAS GENERAL DEL ESTUDIANTE
Dim TablaNotas As New ADODB.Recordset Dim Tabla As New ADODB.Recordset
Private Sub anio_Click() If ciclo.ListIndex = -1 Then Exit Sub LlenarAlumnos End Sub
Sub botonimprimir() LibretasEstudent.ssQLL1 = "SELECT *, " & _
168
"(select avg(notas.conducta) as C1 from datos,matriculas,notas,materias,aux,curso where datos.alumnoid=matriculas.alumnoid and matriculas.idcurso=curso.idanio and
curso.idanio=aux.anioid
and
aux.materiaid=materias.materiaid
and
materias.materiaid=notas.materiaid and notas.numero=matriculas.numero and datos.nombre='" & alumnos.Text & "' and notas.trimestre=1 and curso.nombre='" & ciclo.Text & "' and notas.lectivo=" & Val(anio.Text) & ") as ProCon1, " & _ "(select avg(notas.conducta) as C2 from datos,matriculas,notas,materias,aux,curso where datos.alumnoid=matriculas.alumnoid and matriculas.idcurso=curso.idanio and
curso.idanio=aux.anioid
and
aux.materiaid=materias.materiaid
and
materias.materiaid=notas.materiaid and notas.numero=matriculas.numero and datos.nombre='" & alumnos.Text & "' and notas.trimestre=2 and curso.nombre='" & ciclo.Text & "' and notas.lectivo=" & Val(anio.Text) & ") AS ProCon2, " & _ "(select avg(notas.conducta) as C3 from datos,matriculas,notas,materias,aux,curso where datos.alumnoid=matriculas.alumnoid and matriculas.idcurso=curso.idanio and
curso.idanio=aux.anioid
and
aux.materiaid=materias.materiaid
and
materias.materiaid=notas.materiaid and notas.numero=matriculas.numero and datos.nombre='" & alumnos.Text & "' and notas.trimestre=3 and curso.nombre='" & ciclo.Text & "' and notas.lectivo=" & Val(anio.Text) & ") AS ProCon3, " & _ "((select
avg(notas.conducta)
as
Cc1
datos,matriculas,notas,materias,aux,curso
from where
datos.alumnoid=matriculas.alumnoid and matriculas.idcurso=curso.idanio and curso.idanio=aux.anioid
and
aux.materiaid=materias.materiaid
and
materias.materiaid=notas.materiaid and notas.numero=matriculas.numero and datos.nombre='" & alumnos.Text & "' and notas.trimestre=1 and curso.nombre='" & ciclo.Text & "' and notas.lectivo=" & Val(anio.Text) & ") + " & _ "(select
avg(notas.conducta)
as
Cc2
datos,matriculas,notas,materias,aux,curso
from where
datos.alumnoid=matriculas.alumnoid and matriculas.idcurso=curso.idanio and curso.idanio=aux.anioid
and
aux.materiaid=materias.materiaid
and
materias.materiaid=notas.materiaid and notas.numero=matriculas.numero and datos.nombre='" & alumnos.Text & "' and notas.trimestre=2 and curso.nombre='" & ciclo.Text & "' and notas.lectivo=" & Val(anio.Text) & ") + " & _
169
"(select
avg(notas.conducta)
as
Cc3
datos,matriculas,notas,materias,aux,curso
from where
datos.alumnoid=matriculas.alumnoid and matriculas.idcurso=curso.idanio and curso.idanio=aux.anioid
and
aux.materiaid=materias.materiaid
and
materias.materiaid=notas.materiaid and notas.numero=matriculas.numero and datos.nombre='" & alumnos.Text & "' and notas.trimestre=3 and curso.nombre='" & ciclo.Text & "' and notas.lectivo=" & Val(anio.Text) & "))/3 as ProConGene, " &_ "(select
avg(notas.promedio)
as
Ccc1
datos,matriculas,notas,materias,aux,curso
from where
datos.alumnoid=matriculas.alumnoid and matriculas.idcurso=curso.idanio and curso.idanio=aux.anioid
and
aux.materiaid=materias.materiaid
and
materias.materiaid=notas.materiaid and notas.numero=matriculas.numero and datos.nombre='" & alumnos.Text & "' and notas.trimestre=1 and curso.nombre='" & ciclo.Text & "' and notas.lectivo=" & Val(anio.Text) & ") as ProAprov1, " & _ "(select
avg(notas.promedio)
as
Ccc2
datos,matriculas,notas,materias,aux,curso
from where
datos.alumnoid=matriculas.alumnoid and matriculas.idcurso=curso.idanio and curso.idanio=aux.anioid
and
aux.materiaid=materias.materiaid
and
materias.materiaid=notas.materiaid and notas.numero=matriculas.numero and datos.nombre='" & alumnos.Text & "' and notas.trimestre=2 and curso.nombre='" & ciclo.Text & "' and notas.lectivo=" & Val(anio.Text) & ") AS ProAprov2, " & _ "(select
avg(notas.promedio)
as
Ccc3
datos,matriculas,notas,materias,aux,curso
from where
datos.alumnoid=matriculas.alumnoid and matriculas.idcurso=curso.idanio and curso.idanio=aux.anioid
and
aux.materiaid=materias.materiaid
and
materias.materiaid=notas.materiaid and notas.numero=matriculas.numero and datos.nombre='" & alumnos.Text & "' and notas.trimestre=3 and curso.nombre='" & ciclo.Text & "' and notas.lectivo=" & Val(anio.Text) & ") AS ProAprov3, " & _ "((select
avg(notas.promedio)
datos,matriculas,notas,materias,aux,curso
as
Cccc1
from where
datos.alumnoid=matriculas.alumnoid and matriculas.idcurso=curso.idanio and
170
curso.idanio=aux.anioid
and
aux.materiaid=materias.materiaid
and
materias.materiaid=notas.materiaid and notas.numero=matriculas.numero and datos.nombre='" & alumnos.Text & "' and notas.trimestre=1 and curso.nombre='" & ciclo.Text & "' and notas.lectivo=" & Val(anio.Text) & ") + " & _ "(select
avg(notas.promedio)
as
Cccc2
from
datos,matriculas,notas,materias,aux,curso
where
datos.alumnoid=matriculas.alumnoid and matriculas.idcurso=curso.idanio and curso.idanio=aux.anioid
and
aux.materiaid=materias.materiaid
and
materias.materiaid=notas.materiaid and notas.numero=matriculas.numero and datos.nombre='" & alumnos.Text & "' and notas.trimestre=2 and curso.nombre='" & ciclo.Text & "' and notas.lectivo=" & Val(anio.Text) & ")+ " & _ "(select
avg(notas.promedio)
as
Cccc3
from
datos,matriculas,notas,materias,aux,curso
where
datos.alumnoid=matriculas.alumnoid and matriculas.idcurso=curso.idanio and curso.idanio=aux.anioid
and
aux.materiaid=materias.materiaid
and
materias.materiaid=notas.materiaid and notas.numero=matriculas.numero and datos.nombre='" & alumnos.Text & "' and notas.trimestre=3 and curso.nombre='" & ciclo.Text & "' and notas.lectivo=" & Val(anio.Text) & "))/3 as ProAprovGene "&_ "FROM
[select
distinct
materias.materiaid,materias.nombre,datos.nombre,notas.lectivo,notas.promedio as prom1,notas.conducta " & _ "From datos, matriculas, notas, materias, Aux, curso " & _ "where datos.alumnoid=matriculas.alumnoid and matriculas.idcurso=curso.idanio and
curso.idanio=aux.anioid
and
aux.materiaid=materias.materiaid
and
materias.materiaid=notas.materiaid and notas.numero=matriculas.numero and datos.nombre='" & alumnos.Text & "' and notas.trimestre=1 and curso.nombre='" & ciclo.Text & "' and notas.lectivo=" & Val(anio.Text) & " " & _ "group
by
materias.materiaid,materias.nombre,datos.nombre,notas.lectivo,notas.promedio,no tas.conducta]. AS Trim1, [select distinct materias.materiaid,notas.lectivo, notas.promedio as prom2, notas.conducta " & _
171
"From datos, matriculas, notas, materias, Aux, curso " & _ "where datos.alumnoid=matriculas.alumnoid and matriculas.idcurso=curso.idanio and
curso.idanio=aux.anioid
and
aux.materiaid=materias.materiaid
and
materias.materiaid=notas.materiaid and notas.numero=matriculas.numero and datos.nombre='" & alumnos.Text & "' and notas.trimestre=2 and curso.nombre='" & ciclo.Text & "' and notas.lectivo=" & Val(anio.Text) & " " & _ "group by materias.materiaid,notas.lectivo, notas.promedio, notas.conducta]. AS Trim2, [select distinct materias.materiaid,notas.lectivo, notas.promedio as prom3, notas.conducta " & _ "From datos, matriculas, notas, materias, Aux, curso " & _ "where datos.alumnoid=matriculas.alumnoid and matriculas.idcurso=curso.idanio and
curso.idanio=aux.anioid
and
aux.materiaid=materias.materiaid
and
materias.materiaid=notas.materiaid and notas.numero=matriculas.numero and datos.nombre='" & alumnos.Text & "' and notas.trimestre=3 and curso.nombre='" & ciclo.Text & "' and notas.lectivo=" & Val(anio.Text) & " " & _ "group by materias.materiaid,notas.lectivo,notas.promedio,notas.conducta]. AS Trim3 " & _ "WHERE trim1.materiaid=trim2.materiaid and trim2.materiaid=trim3.materiaid and trim1.materiaid=trim3.materiaid"
LibretasEstudent.Show End Sub
Sub BotonImprime() Dim i As Long On Error GoTo salir If Tabla.State = 1 Then Tabla.Close Set Tabla = Nothing End If If alumnos.ListIndex = -1 Or ciclo.ListIndex = -1 Or anio.ListIndex = -1 Then Exit Sub 'Or Descripcion.ListIndex = -1
172
Set Tabla = Base.Execute("Select *, matriculas.numero, datos.nombre as AlumnoS1,curso.nombre
as
curso1,matriculas.lectivo
from
datos,matriculas,curso,notas where datos.alumnoid=matriculas.alumnoid and matriculas.idcurso=curso.idanio
and
matriculas.numero=notas.numero
and
notas.numero = " & alumnos.ItemData(alumnos.ListIndex) & " and notas.lectivo = " & Val(anio.Text) & " order by datos.nombre") Set CertPromedioGener.DataSource = Tabla CertPromedioGener.Sections("Pagina").Controls("AnoLectivo").Caption
=
anio.Text & " - " & Val(anio.Text) + 1 If Sexo = "1" Or Sexo = 1 Then 'CertfConducta.Sections("Pagina").Controls("Sexo").Caption = "la" 'CertfConducta.Sections("Pagina").Controls("Sexo1").Caption = "a" 'CertfConducta.Sections("Pagina").Controls("Sexo2").Caption = "a" Else 'CertfConducta.Sections("Pagina").Controls("Sexo").Caption = "el" 'CertfConducta.Sections("Pagina").Controls("Sexo1").Caption = "o" 'CertfConducta.Sections("Pagina").Controls("Sexo2").Caption = "o" End If CertPromedioGener.Sections("Pagina").Controls("Estudiante").Caption
=
Tabla!alumnos1 i = MSF.Rows - 1 If i = 1 Then CertPromedioGener.Sections("pagina").Controls("materias1").Caption
=
MSF.TextMatrix(1, 1) CertPromedioGener.Sections("pagina").Controls("NOTAS1").Caption MSF.TextMatrix(1, 2) & "
" & MSF2.TextMatrix(1, 2) & "
= "&
MSF3.TextMatrix(1, 2) ElseIf i = 2 Then CertPromedioGener.Sections("pagina").Controls("materias1").Caption
=
MSF.TextMatrix(1, 1) CertPromedioGener.Sections("pagina").Controls("materias2").Caption
=
MSF.TextMatrix(2, 1)
173
CertPromedioGener.Sections("pagina").Controls("NOTAS1").Caption MSF.TextMatrix(1, 2) & "
" & MSF2.TextMatrix(1, 2) & "
= "&
MSF3.TextMatrix(1, 2) CertPromedioGener.Sections("pagina").Controls("NOTAS2").Caption MSF.TextMatrix(2, 2) & "
" & MSF2.TextMatrix(2, 2) & "
= "&
MSF3.TextMatrix(2, 2) ElseIf i = 3 Then CertPromedioGener.Sections("pagina").Controls("materias1").Caption
=
MSF.TextMatrix(1, 1) CertPromedioGener.Sections("pagina").Controls("materias2").Caption
=
MSF.TextMatrix(2, 1) CertPromedioGener.Sections("pagina").Controls("materias3").Caption
=
MSF.TextMatrix(3, 1) CertPromedioGener.Sections("pagina").Controls("NOTAS1").Caption MSF.TextMatrix(1, 2) & "
" & MSF2.TextMatrix(1, 2) & "
= "&
MSF3.TextMatrix(1, 2) CertPromedioGener.Sections("pagina").Controls("NOTAS2").Caption MSF.TextMatrix(2, 2) & "
" & MSF2.TextMatrix(2, 2) & "
= "&
MSF3.TextMatrix(2, 2) CertPromedioGener.Sections("pagina").Controls("NOTAS3").Caption MSF.TextMatrix(3, 2) & "
" & MSF2.TextMatrix(3, 2) & "
= "&
MSF3.TextMatrix(3, 2) ElseIf i = 4 Then CertPromedioGener.Sections("pagina").Controls("materias1").Caption
=
MSF.TextMatrix(1, 1) CertPromedioGener.Sections("pagina").Controls("materias2").Caption
=
MSF.TextMatrix(2, 1) CertPromedioGener.Sections("pagina").Controls("materias3").Caption
=
MSF.TextMatrix(3, 1) CertPromedioGener.Sections("pagina").Controls("materias4").Caption
=
MSF.TextMatrix(4, 1)
174
CertPromedioGener.Sections("pagina").Controls("NOTAS1").Caption MSF.TextMatrix(1, 2) & "
" & MSF2.TextMatrix(1, 2) & "
= "&
MSF3.TextMatrix(1, 2) CertPromedioGener.Sections("pagina").Controls("NOTAS2").Caption MSF.TextMatrix(2, 2) & "
" & MSF2.TextMatrix(2, 2) & "
= "&
MSF3.TextMatrix(2, 2) CertPromedioGener.Sections("pagina").Controls("NOTAS3").Caption MSF.TextMatrix(3, 2) & "
" & MSF2.TextMatrix(3, 2) & "
= "&
MSF3.TextMatrix(3, 2) CertPromedioGener.Sections("pagina").Controls("NOTAS4").Caption MSF.TextMatrix(4, 2) & "
" & MSF2.TextMatrix(4, 2) & "
= "&
MSF3.TextMatrix(4, 2) ElseIf i = 5 Then CertPromedioGener.Sections("pagina").Controls("materias1").Caption
=
MSF.TextMatrix(1, 1) CertPromedioGener.Sections("pagina").Controls("materias2").Caption
=
MSF.TextMatrix(2, 1) CertPromedioGener.Sections("pagina").Controls("materias3").Caption
=
MSF.TextMatrix(3, 1) CertPromedioGener.Sections("pagina").Controls("materias4").Caption
=
MSF.TextMatrix(4, 1) CertPromedioGener.Sections("pagina").Controls("materias5").Caption
=
MSF.TextMatrix(5, 1) CertPromedioGener.Sections("pagina").Controls("NOTAS1").Caption MSF.TextMatrix(1, 2) & "
" & MSF2.TextMatrix(1, 2) & "
= "&
MSF3.TextMatrix(1, 2) CertPromedioGener.Sections("pagina").Controls("NOTAS2").Caption MSF.TextMatrix(2, 2) & "
" & MSF2.TextMatrix(2, 2) & "
= "&
MSF3.TextMatrix(2, 2) CertPromedioGener.Sections("pagina").Controls("NOTAS3").Caption MSF.TextMatrix(3, 2) & "
" & MSF2.TextMatrix(3, 2) & "
= "&
MSF3.TextMatrix(3, 2)
175
CertPromedioGener.Sections("pagina").Controls("NOTAS4").Caption MSF.TextMatrix(4, 2) & "
" & MSF2.TextMatrix(4, 2) & "
= "&
MSF3.TextMatrix(4, 2) CertPromedioGener.Sections("pagina").Controls("NOTAS5").Caption MSF.TextMatrix(5, 2) & "
" & MSF2.TextMatrix(5, 2) & "
= "&
MSF3.TextMatrix(5, 2) ElseIf i = 6 Then CertPromedioGener.Sections("pagina").Controls("materias1").Caption
=
MSF.TextMatrix(1, 1) CertPromedioGener.Sections("pagina").Controls("materias2").Caption
=
MSF.TextMatrix(2, 1) CertPromedioGener.Sections("pagina").Controls("materias3").Caption
=
MSF.TextMatrix(3, 1) CertPromedioGener.Sections("pagina").Controls("materias4").Caption
=
MSF.TextMatrix(4, 1) CertPromedioGener.Sections("pagina").Controls("materias5").Caption
=
MSF.TextMatrix(5, 1) CertPromedioGener.Sections("pagina").Controls("materias6").Caption
=
MSF.TextMatrix(6, 1) CertPromedioGener.Sections("pagina").Controls("NOTAS1").Caption MSF.TextMatrix(1, 2) & "
" & MSF2.TextMatrix(1, 2) & "
= "&
MSF3.TextMatrix(1, 2) CertPromedioGener.Sections("pagina").Controls("NOTAS2").Caption MSF.TextMatrix(2, 2) & "
" & MSF2.TextMatrix(2, 2) & "
= "&
MSF3.TextMatrix(2, 2) CertPromedioGener.Sections("pagina").Controls("NOTAS3").Caption MSF.TextMatrix(3, 2) & "
" & MSF2.TextMatrix(3, 2) & "
= "&
MSF3.TextMatrix(3, 2) CertPromedioGener.Sections("pagina").Controls("NOTAS4").Caption MSF.TextMatrix(4, 2) & "
" & MSF2.TextMatrix(4, 2) & "
= "&
MSF3.TextMatrix(4, 2)
176
CertPromedioGener.Sections("pagina").Controls("NOTAS5").Caption MSF.TextMatrix(5, 2) & "
" & MSF2.TextMatrix(5, 2) & "
= "&
MSF3.TextMatrix(5, 2) CertPromedioGener.Sections("pagina").Controls("NOTAS6").Caption MSF.TextMatrix(6, 2) & "
" & MSF2.TextMatrix(6, 2) & "
= "&
MSF3.TextMatrix(6, 2) ElseIf i = 7 Then CertPromedioGener.Sections("pagina").Controls("materias1").Caption
=
MSF.TextMatrix(1, 1) CertPromedioGener.Sections("pagina").Controls("materias2").Caption
=
MSF.TextMatrix(2, 1) CertPromedioGener.Sections("pagina").Controls("materias3").Caption
=
MSF.TextMatrix(3, 1) CertPromedioGener.Sections("pagina").Controls("materias4").Caption
=
MSF.TextMatrix(4, 1) CertPromedioGener.Sections("pagina").Controls("materias5").Caption
=
MSF.TextMatrix(5, 1) CertPromedioGener.Sections("pagina").Controls("materias6").Caption
=
MSF.TextMatrix(6, 1) CertPromedioGener.Sections("pagina").Controls("materias7").Caption
=
MSF.TextMatrix(7, 1) CertPromedioGener.Sections("pagina").Controls("NOTAS1").Caption MSF.TextMatrix(1, 2) & "
" & MSF2.TextMatrix(1, 2) & "
= "&
MSF3.TextMatrix(1, 2) CertPromedioGener.Sections("pagina").Controls("NOTAS2").Caption MSF.TextMatrix(2, 2) & "
" & MSF2.TextMatrix(2, 2) & "
= "&
MSF3.TextMatrix(2, 2) CertPromedioGener.Sections("pagina").Controls("NOTAS3").Caption MSF.TextMatrix(3, 2) & "
" & MSF2.TextMatrix(3, 2) & "
= "&
MSF3.TextMatrix(3, 2)
177
CertPromedioGener.Sections("pagina").Controls("NOTAS4").Caption MSF.TextMatrix(4, 2) & "
" & MSF2.TextMatrix(4, 2) & "
= "&
MSF3.TextMatrix(4, 2) CertPromedioGener.Sections("pagina").Controls("NOTAS5").Caption MSF.TextMatrix(5, 2) & "
" & MSF2.TextMatrix(5, 2) & "
= "&
MSF3.TextMatrix(5, 2) CertPromedioGener.Sections("pagina").Controls("NOTAS6").Caption MSF.TextMatrix(6, 2) & "
" & MSF2.TextMatrix(6, 2) & "
= "&
MSF3.TextMatrix(6, 2) CertPromedioGener.Sections("pagina").Controls("NOTAS7").Caption MSF.TextMatrix(7, 2) & "
" & MSF2.TextMatrix(7, 2) & "
= "&
MSF3.TextMatrix(7, 2) ElseIf i = 8 Then CertPromedioGener.Sections("pagina").Controls("materias1").Caption
=
MSF.TextMatrix(1, 1) CertPromedioGener.Sections("pagina").Controls("materias2").Caption
=
MSF.TextMatrix(2, 1) CertPromedioGener.Sections("pagina").Controls("materias3").Caption
=
MSF.TextMatrix(3, 1) CertPromedioGener.Sections("pagina").Controls("materias4").Caption
=
MSF.TextMatrix(4, 1) CertPromedioGener.Sections("pagina").Controls("materias5").Caption
=
MSF.TextMatrix(5, 1) CertPromedioGener.Sections("pagina").Controls("materias6").Caption
=
MSF.TextMatrix(6, 1) CertPromedioGener.Sections("pagina").Controls("materias7").Caption
=
MSF.TextMatrix(7, 1) CertPromedioGener.Sections("pagina").Controls("materias8").Caption
=
MSF.TextMatrix(8, 1) CertPromedioGener.Sections("pagina").Controls("NOTAS1").Caption MSF.TextMatrix(1, 2) & "
" & MSF2.TextMatrix(1, 2) & "
= "&
MSF3.TextMatrix(1, 2)
178
CertPromedioGener.Sections("pagina").Controls("NOTAS2").Caption MSF.TextMatrix(2, 2) & "
" & MSF2.TextMatrix(2, 2) & "
= "&
MSF3.TextMatrix(2, 2) CertPromedioGener.Sections("pagina").Controls("NOTAS3").Caption MSF.TextMatrix(3, 2) & "
" & MSF2.TextMatrix(3, 2) & "
= "&
MSF3.TextMatrix(3, 2) CertPromedioGener.Sections("pagina").Controls("NOTAS4").Caption MSF.TextMatrix(4, 2) & "
" & MSF2.TextMatrix(4, 2) & "
= "&
MSF3.TextMatrix(4, 2) CertPromedioGener.Sections("pagina").Controls("NOTAS5").Caption MSF.TextMatrix(5, 2) & "
" & MSF2.TextMatrix(5, 2) & "
= "&
MSF3.TextMatrix(5, 2) CertPromedioGener.Sections("pagina").Controls("NOTAS6").Caption MSF.TextMatrix(6, 2) & "
" & MSF2.TextMatrix(6, 2) & "
= "&
MSF3.TextMatrix(6, 2) CertPromedioGener.Sections("pagina").Controls("NOTAS7").Caption MSF.TextMatrix(7, 2) & "
" & MSF2.TextMatrix(7, 2) & "
= "&
MSF3.TextMatrix(7, 2) CertPromedioGener.Sections("pagina").Controls("NOTAS8").Caption MSF.TextMatrix(8, 2) & "
" & MSF2.TextMatrix(8, 2) & "
= "&
MSF3.TextMatrix(8, 2) ElseIf i = 9 Then CertPromedioGener.Sections("pagina").Controls("materias1").Caption
=
MSF.TextMatrix(1, 1) CertPromedioGener.Sections("pagina").Controls("materias2").Caption
=
MSF.TextMatrix(2, 1) CertPromedioGener.Sections("pagina").Controls("materias3").Caption
=
MSF.TextMatrix(3, 1) CertPromedioGener.Sections("pagina").Controls("materias4").Caption
=
MSF.TextMatrix(4, 1) CertPromedioGener.Sections("pagina").Controls("materias5").Caption
=
MSF.TextMatrix(5, 1)
179
CertPromedioGener.Sections("pagina").Controls("materias6").Caption
=
MSF.TextMatrix(6, 1) CertPromedioGener.Sections("pagina").Controls("materias7").Caption
=
MSF.TextMatrix(7, 1) CertPromedioGener.Sections("pagina").Controls("materias8").Caption
=
MSF.TextMatrix(8, 1) CertPromedioGener.Sections("pagina").Controls("materias9").Caption
=
MSF.TextMatrix(9, 1) CertPromedioGener.Sections("pagina").Controls("NOTAS1").Caption MSF.TextMatrix(1, 2) & "
" & MSF2.TextMatrix(1, 2) & "
= "&
MSF3.TextMatrix(1, 2) CertPromedioGener.Sections("pagina").Controls("NOTAS2").Caption MSF.TextMatrix(2, 2) & "
" & MSF2.TextMatrix(2, 2) & "
= "&
MSF3.TextMatrix(2, 2) CertPromedioGener.Sections("pagina").Controls("NOTAS3").Caption MSF.TextMatrix(3, 2) & "
" & MSF2.TextMatrix(3, 2) & "
= "&
MSF3.TextMatrix(3, 2) CertPromedioGener.Sections("pagina").Controls("NOTAS4").Caption MSF.TextMatrix(4, 2) & "
" & MSF2.TextMatrix(4, 2) & "
= "&
MSF3.TextMatrix(4, 2) CertPromedioGener.Sections("pagina").Controls("NOTAS5").Caption MSF.TextMatrix(5, 2) & "
" & MSF2.TextMatrix(5, 2) & "
= "&
MSF3.TextMatrix(5, 2) CertPromedioGener.Sections("pagina").Controls("NOTAS6").Caption MSF.TextMatrix(6, 2) & "
" & MSF2.TextMatrix(6, 2) & "
= "&
MSF3.TextMatrix(6, 2) CertPromedioGener.Sections("pagina").Controls("NOTAS7").Caption MSF.TextMatrix(7, 2) & "
" & MSF2.TextMatrix(7, 2) & "
= "&
MSF3.TextMatrix(7, 2) CertPromedioGener.Sections("pagina").Controls("NOTAS8").Caption MSF.TextMatrix(8, 2) & "
" & MSF2.TextMatrix(8, 2) & "
= "&
MSF3.TextMatrix(8, 2)
180
CertPromedioGener.Sections("pagina").Controls("NOTAS9").Caption MSF.TextMatrix(9, 2) & "
" & MSF2.TextMatrix(9, 2) & "
= "&
MSF3.TextMatrix(9, 2) ElseIf i = 10 Then CertPromedioGener.Sections("pagina").Controls("materias1").Caption
=
MSF.TextMatrix(1, 1) CertPromedioGener.Sections("pagina").Controls("materias2").Caption
=
MSF.TextMatrix(2, 1) CertPromedioGener.Sections("pagina").Controls("materias3").Caption
=
MSF.TextMatrix(3, 1) CertPromedioGener.Sections("pagina").Controls("materias4").Caption
=
MSF.TextMatrix(4, 1) CertPromedioGener.Sections("pagina").Controls("materias5").Caption
=
MSF.TextMatrix(5, 1) CertPromedioGener.Sections("pagina").Controls("materias6").Caption
=
MSF.TextMatrix(6, 1) CertPromedioGener.Sections("pagina").Controls("materias7").Caption
=
MSF.TextMatrix(7, 1) CertPromedioGener.Sections("pagina").Controls("materias8").Caption
=
MSF.TextMatrix(8, 1) CertPromedioGener.Sections("pagina").Controls("materias9").Caption
=
MSF.TextMatrix(9, 1) CertPromedioGener.Sections("pagina").Controls("materias10").Caption
=
MSF.TextMatrix(10, 1) CertPromedioGener.Sections("pagina").Controls("NOTAS1").Caption MSF.TextMatrix(1, 2) & "
" & MSF2.TextMatrix(1, 2) & "
= "&
MSF3.TextMatrix(1, 2) CertPromedioGener.Sections("pagina").Controls("NOTAS2").Caption MSF.TextMatrix(2, 2) & "
" & MSF2.TextMatrix(2, 2) & "
= "&
MSF3.TextMatrix(2, 2)
181
CertPromedioGener.Sections("pagina").Controls("NOTAS3").Caption MSF.TextMatrix(3, 2) & "
" & MSF2.TextMatrix(3, 2) & "
= "&
MSF3.TextMatrix(3, 2) CertPromedioGener.Sections("pagina").Controls("NOTAS4").Caption MSF.TextMatrix(4, 2) & "
" & MSF2.TextMatrix(4, 2) & "
= "&
MSF3.TextMatrix(4, 2) CertPromedioGener.Sections("pagina").Controls("NOTAS5").Caption MSF.TextMatrix(5, 2) & "
" & MSF2.TextMatrix(5, 2) & "
= "&
MSF3.TextMatrix(5, 2) CertPromedioGener.Sections("pagina").Controls("NOTAS6").Caption MSF.TextMatrix(6, 2) & "
" & MSF2.TextMatrix(6, 2) & "
= "&
MSF3.TextMatrix(6, 2) CertPromedioGener.Sections("pagina").Controls("NOTAS7").Caption MSF.TextMatrix(7, 2) & "
" & MSF2.TextMatrix(7, 2) & "
= "&
MSF3.TextMatrix(7, 2) CertPromedioGener.Sections("pagina").Controls("NOTAS8").Caption MSF.TextMatrix(8, 2) & "
" & MSF2.TextMatrix(8, 2) & "
= "&
MSF3.TextMatrix(8, 2) CertPromedioGener.Sections("pagina").Controls("NOTAS9").Caption MSF.TextMatrix(9, 2) & "
" & MSF2.TextMatrix(9, 2) & "
= "&
MSF3.TextMatrix(9, 2) CertPromedioGener.Sections("pagina").Controls("NOTAS10").Caption MSF.TextMatrix(10, 2) & "
=
" & MSF2.TextMatrix(10, 2) & "
"&
CertPromedioGener.Sections("pagina").Controls("materias1").Caption
=
MSF3.TextMatrix(10, 2) ElseIf i = 11 Then
MSF.TextMatrix(1, 1) CertPromedioGener.Sections("pagina").Controls("materias2").Caption
=
MSF.TextMatrix(2, 1) CertPromedioGener.Sections("pagina").Controls("materias3").Caption
=
MSF.TextMatrix(3, 1)
182
CertPromedioGener.Sections("pagina").Controls("materias4").Caption
=
MSF.TextMatrix(4, 1) CertPromedioGener.Sections("pagina").Controls("materias5").Caption
=
MSF.TextMatrix(5, 1) CertPromedioGener.Sections("pagina").Controls("materias6").Caption
=
MSF.TextMatrix(6, 1) CertPromedioGener.Sections("pagina").Controls("materias7").Caption
=
MSF.TextMatrix(7, 1) CertPromedioGener.Sections("pagina").Controls("materias8").Caption
=
MSF.TextMatrix(8, 1) CertPromedioGener.Sections("pagina").Controls("materias9").Caption
=
MSF.TextMatrix(9, 1) CertPromedioGener.Sections("pagina").Controls("materias10").Caption
=
MSF.TextMatrix(10, 1) CertPromedioGener.Sections("pagina").Controls("materias11").Caption
=
MSF.TextMatrix(11, 1) CertPromedioGener.Sections("pagina").Controls("NOTAS1").Caption MSF.TextMatrix(1, 2) & "
" & MSF2.TextMatrix(1, 2) & "
= "&
MSF3.TextMatrix(1, 2) CertPromedioGener.Sections("pagina").Controls("NOTAS2").Caption MSF.TextMatrix(2, 2) & "
" & MSF2.TextMatrix(2, 2) & "
= "&
MSF3.TextMatrix(2, 2) CertPromedioGener.Sections("pagina").Controls("NOTAS3").Caption MSF.TextMatrix(3, 2) & "
" & MSF2.TextMatrix(3, 2) & "
= "&
MSF3.TextMatrix(3, 2) CertPromedioGener.Sections("pagina").Controls("NOTAS4").Caption MSF.TextMatrix(4, 2) & "
" & MSF2.TextMatrix(4, 2) & "
= "&
MSF3.TextMatrix(4, 2) CertPromedioGener.Sections("pagina").Controls("NOTAS5").Caption MSF.TextMatrix(5, 2) & "
" & MSF2.TextMatrix(5, 2) & "
= "&
MSF3.TextMatrix(5, 2)
183
CertPromedioGener.Sections("pagina").Controls("NOTAS6").Caption MSF.TextMatrix(6, 2) & "
" & MSF2.TextMatrix(6, 2) & "
= "&
MSF3.TextMatrix(6, 2) CertPromedioGener.Sections("pagina").Controls("NOTAS7").Caption MSF.TextMatrix(7, 2) & "
" & MSF2.TextMatrix(7, 2) & "
= "&
MSF3.TextMatrix(7, 2) CertPromedioGener.Sections("pagina").Controls("NOTAS8").Caption MSF.TextMatrix(8, 2) & "
" & MSF2.TextMatrix(8, 2) & "
= "&
MSF3.TextMatrix(8, 2) CertPromedioGener.Sections("pagina").Controls("NOTAS9").Caption MSF.TextMatrix(9, 2) & "
" & MSF2.TextMatrix(9, 2) & "
= "&
MSF3.TextMatrix(9, 2) CertPromedioGener.Sections("pagina").Controls("NOTAS10").Caption MSF.TextMatrix(10, 2) & "
" & MSF2.TextMatrix(10, 2) & "
= "&
MSF3.TextMatrix(10, 2) CertPromedioGener.Sections("pagina").Controls("NOTAS11").Caption MSF.TextMatrix(11, 2) & "
=
" & MSF2.TextMatrix(11, 2) & "
"&
CertPromedioGener.Sections("pagina").Controls("materias1").Caption
=
MSF3.TextMatrix(11, 2) ElseIf i = 12 Then
MSF.TextMatrix(1, 1) CertPromedioGener.Sections("pagina").Controls("materias2").Caption
=
MSF.TextMatrix(2, 1) CertPromedioGener.Sections("pagina").Controls("materias3").Caption
=
MSF.TextMatrix(3, 1) CertPromedioGener.Sections("pagina").Controls("materias4").Caption
=
MSF.TextMatrix(4, 1) CertPromedioGener.Sections("pagina").Controls("materias5").Caption
=
MSF.TextMatrix(5, 1) CertPromedioGener.Sections("pagina").Controls("materias6").Caption
=
MSF.TextMatrix(6, 1)
184
CertPromedioGener.Sections("pagina").Controls("materias7").Caption
=
MSF.TextMatrix(7, 1) CertPromedioGener.Sections("pagina").Controls("materias8").Caption
=
MSF.TextMatrix(8, 1) CertPromedioGener.Sections("pagina").Controls("materias9").Caption
=
MSF.TextMatrix(9, 1) CertPromedioGener.Sections("pagina").Controls("materias10").Caption
=
MSF.TextMatrix(10, 1) CertPromedioGener.Sections("pagina").Controls("materias11").Caption
=
MSF.TextMatrix(11, 1) CertPromedioGener.Sections("pagina").Controls("materias12").Caption
=
MSF.TextMatrix(12, 1) CertPromedioGener.Sections("pagina").Controls("NOTAS1").Caption MSF.TextMatrix(1, 2) & "
" & MSF2.TextMatrix(1, 2) & "
= "&
MSF3.TextMatrix(1, 2) CertPromedioGener.Sections("pagina").Controls("NOTAS2").Caption MSF.TextMatrix(2, 2) & "
" & MSF2.TextMatrix(2, 2) & "
= "&
MSF3.TextMatrix(2, 2) CertPromedioGener.Sections("pagina").Controls("NOTAS3").Caption MSF.TextMatrix(3, 2) & "
" & MSF2.TextMatrix(3, 2) & "
= "&
MSF3.TextMatrix(3, 2) CertPromedioGener.Sections("pagina").Controls("NOTAS4").Caption MSF.TextMatrix(4, 2) & "
" & MSF2.TextMatrix(4, 2) & "
= "&
MSF3.TextMatrix(4, 2) CertPromedioGener.Sections("pagina").Controls("NOTAS5").Caption MSF.TextMatrix(5, 2) & "
" & MSF2.TextMatrix(5, 2) & "
= "&
MSF3.TextMatrix(5, 2) CertPromedioGener.Sections("pagina").Controls("NOTAS6").Caption MSF.TextMatrix(6, 2) & "
" & MSF2.TextMatrix(6, 2) & "
= "&
MSF3.TextMatrix(6, 2)
185
CertPromedioGener.Sections("pagina").Controls("NOTAS7").Caption MSF.TextMatrix(7, 2) & "
" & MSF2.TextMatrix(7, 2) & "
= "&
MSF3.TextMatrix(7, 2) CertPromedioGener.Sections("pagina").Controls("NOTAS8").Caption MSF.TextMatrix(8, 2) & "
" & MSF2.TextMatrix(8, 2) & "
= "&
MSF3.TextMatrix(8, 2) CertPromedioGener.Sections("pagina").Controls("NOTAS9").Caption MSF.TextMatrix(9, 2) & "
" & MSF2.TextMatrix(9, 2) & "
= "&
MSF3.TextMatrix(9, 2) CertPromedioGener.Sections("pagina").Controls("NOTAS10").Caption MSF.TextMatrix(10, 2) & "
" & MSF2.TextMatrix(10, 2) & "
= "&
MSF3.TextMatrix(10, 2) CertPromedioGener.Sections("pagina").Controls("NOTAS11").Caption MSF.TextMatrix(11, 2) & "
" & MSF2.TextMatrix(11, 2) & "
= "&
MSF3.TextMatrix(11, 2) CertPromedioGener.Sections("pagina").Controls("NOTAS12").Caption MSF.TextMatrix(12, 2) & "
=
" & MSF2.TextMatrix(12, 2) & "
"&
CertPromedioGener.Sections("pagina").Controls("materias1").Caption
=
MSF3.TextMatrix(12, 2) ElseIf i = 13 Then
MSF.TextMatrix(1, 1) CertPromedioGener.Sections("pagina").Controls("materias2").Caption
=
MSF.TextMatrix(2, 1) CertPromedioGener.Sections("pagina").Controls("materias3").Caption
=
MSF.TextMatrix(3, 1) CertPromedioGener.Sections("pagina").Controls("materias4").Caption
=
MSF.TextMatrix(4, 1) CertPromedioGener.Sections("pagina").Controls("materias5").Caption
=
MSF.TextMatrix(5, 1) CertPromedioGener.Sections("pagina").Controls("materias6").Caption
=
MSF.TextMatrix(6, 1)
186
CertPromedioGener.Sections("pagina").Controls("materias7").Caption
=
MSF.TextMatrix(7, 1) CertPromedioGener.Sections("pagina").Controls("materias8").Caption
=
MSF.TextMatrix(8, 1) CertPromedioGener.Sections("pagina").Controls("materias9").Caption
=
MSF.TextMatrix(9, 1) CertPromedioGener.Sections("pagina").Controls("materias10").Caption
=
MSF.TextMatrix(10, 1) CertPromedioGener.Sections("pagina").Controls("materias11").Caption
=
MSF.TextMatrix(11, 1) CertPromedioGener.Sections("pagina").Controls("materias12").Caption
=
MSF.TextMatrix(12, 1) CertPromedioGener.Sections("pagina").Controls("materias13").Caption
=
MSF.TextMatrix(13, 1) CertPromedioGener.Sections("pagina").Controls("NOTAS1").Caption MSF.TextMatrix(1, 2) & "
" & MSF2.TextMatrix(1, 2) & "
= "&
MSF3.TextMatrix(1, 2) CertPromedioGener.Sections("pagina").Controls("NOTAS2").Caption MSF.TextMatrix(2, 2) & "
" & MSF2.TextMatrix(2, 2) & "
= "&
MSF3.TextMatrix(2, 2) CertPromedioGener.Sections("pagina").Controls("NOTAS3").Caption MSF.TextMatrix(3, 2) & "
" & MSF2.TextMatrix(3, 2) & "
= "&
MSF3.TextMatrix(3, 2) CertPromedioGener.Sections("pagina").Controls("NOTAS4").Caption MSF.TextMatrix(4, 2) & "
" & MSF2.TextMatrix(4, 2) & "
= "&
MSF3.TextMatrix(4, 2) CertPromedioGener.Sections("pagina").Controls("NOTAS5").Caption MSF.TextMatrix(5, 2) & "
" & MSF2.TextMatrix(5, 2) & "
= "&
MSF3.TextMatrix(5, 2) CertPromedioGener.Sections("pagina").Controls("NOTAS6").Caption MSF.TextMatrix(6, 2) & "
" & MSF2.TextMatrix(6, 2) & "
= "&
MSF3.TextMatrix(6, 2)
187
CertPromedioGener.Sections("pagina").Controls("NOTAS7").Caption MSF.TextMatrix(7, 2) & "
" & MSF2.TextMatrix(7, 2) & "
= "&
MSF3.TextMatrix(7, 2) CertPromedioGener.Sections("pagina").Controls("NOTAS8").Caption MSF.TextMatrix(8, 2) & "
" & MSF2.TextMatrix(8, 2) & "
= "&
MSF3.TextMatrix(8, 2) CertPromedioGener.Sections("pagina").Controls("NOTAS9").Caption MSF.TextMatrix(9, 2) & "
" & MSF2.TextMatrix(9, 2) & "
= "&
MSF3.TextMatrix(9, 2) CertPromedioGener.Sections("pagina").Controls("NOTAS10").Caption MSF.TextMatrix(10, 2) & "
" & MSF2.TextMatrix(10, 2) & "
= "&
MSF3.TextMatrix(10, 2) CertPromedioGener.Sections("pagina").Controls("NOTAS11").Caption MSF.TextMatrix(11, 2) & "
" & MSF2.TextMatrix(11, 2) & "
= "&
MSF3.TextMatrix(11, 2) CertPromedioGener.Sections("pagina").Controls("NOTAS12").Caption MSF.TextMatrix(12, 2) & "
" & MSF2.TextMatrix(12, 2) & "
= "&
MSF3.TextMatrix(12, 2) CertPromedioGener.Sections("pagina").Controls("NOTAS13").Caption MSF.TextMatrix(13, 2) & "
=
" & MSF2.TextMatrix(13, 2) & "
"&
CertPromedioGener.Sections("pagina").Controls("materias1").Caption
=
MSF3.TextMatrix(13, 2) ElseIf i = 14 Then
MSF.TextMatrix(1, 1) CertPromedioGener.Sections("pagina").Controls("materias2").Caption
=
MSF.TextMatrix(2, 1) CertPromedioGener.Sections("pagina").Controls("materias3").Caption
=
MSF.TextMatrix(3, 1) CertPromedioGener.Sections("pagina").Controls("materias4").Caption
=
MSF.TextMatrix(4, 1) CertPromedioGener.Sections("pagina").Controls("materias5").Caption
=
MSF.TextMatrix(5, 1)
188
CertPromedioGener.Sections("pagina").Controls("materias6").Caption
=
MSF.TextMatrix(6, 1) CertPromedioGener.Sections("pagina").Controls("materias7").Caption
=
MSF.TextMatrix(7, 1) CertPromedioGener.Sections("pagina").Controls("materias8").Caption
=
MSF.TextMatrix(8, 1) CertPromedioGener.Sections("pagina").Controls("materias9").Caption
=
MSF.TextMatrix(9, 1) CertPromedioGener.Sections("pagina").Controls("materias10").Caption
=
MSF.TextMatrix(10, 1) CertPromedioGener.Sections("pagina").Controls("materias11").Caption
=
MSF.TextMatrix(11, 1) CertPromedioGener.Sections("pagina").Controls("materias12").Caption
=
MSF.TextMatrix(12, 1) CertPromedioGener.Sections("pagina").Controls("materias13").Caption
=
MSF.TextMatrix(13, 1) CertPromedioGener.Sections("pagina").Controls("materias14").Caption
=
MSF.TextMatrix(14, 1) CertPromedioGener.Sections("pagina").Controls("NOTAS1").Caption MSF.TextMatrix(1, 2) & "
" & MSF2.TextMatrix(1, 2) & "
= "&
MSF3.TextMatrix(1, 2) CertPromedioGener.Sections("pagina").Controls("NOTAS2").Caption MSF.TextMatrix(2, 2) & "
" & MSF2.TextMatrix(2, 2) & "
= "&
MSF3.TextMatrix(2, 2) CertPromedioGener.Sections("pagina").Controls("NOTAS3").Caption MSF.TextMatrix(3, 2) & "
" & MSF2.TextMatrix(3, 2) & "
= "&
MSF3.TextMatrix(3, 2) CertPromedioGener.Sections("pagina").Controls("NOTAS4").Caption MSF.TextMatrix(4, 2) & "
" & MSF2.TextMatrix(4, 2) & "
= "&
MSF3.TextMatrix(4, 2)
189
CertPromedioGener.Sections("pagina").Controls("NOTAS5").Caption MSF.TextMatrix(5, 2) & "
" & MSF2.TextMatrix(5, 2) & "
= "&
MSF3.TextMatrix(5, 2) CertPromedioGener.Sections("pagina").Controls("NOTAS6").Caption MSF.TextMatrix(6, 2) & "
" & MSF2.TextMatrix(6, 2) & "
= "&
MSF3.TextMatrix(6, 2) CertPromedioGener.Sections("pagina").Controls("NOTAS7").Caption MSF.TextMatrix(7, 2) & "
" & MSF2.TextMatrix(7, 2) & "
= "&
MSF3.TextMatrix(7, 2) CertPromedioGener.Sections("pagina").Controls("NOTAS8").Caption MSF.TextMatrix(8, 2) & "
" & MSF2.TextMatrix(8, 2) & "
= "&
MSF3.TextMatrix(8, 2) CertPromedioGener.Sections("pagina").Controls("NOTAS9").Caption MSF.TextMatrix(9, 2) & "
" & MSF2.TextMatrix(9, 2) & "
= "&
MSF3.TextMatrix(9, 2) CertPromedioGener.Sections("pagina").Controls("NOTAS10").Caption MSF.TextMatrix(10, 2) & "
" & MSF2.TextMatrix(10, 2) & "
= "&
MSF3.TextMatrix(10, 2) CertPromedioGener.Sections("pagina").Controls("NOTAS11").Caption MSF.TextMatrix(11, 2) & "
" & MSF2.TextMatrix(11, 2) & "
= "&
MSF3.TextMatrix(11, 2) CertPromedioGener.Sections("pagina").Controls("NOTAS12").Caption MSF.TextMatrix(12, 2) & "
" & MSF2.TextMatrix(12, 2) & "
= "&
MSF3.TextMatrix(12, 2) CertPromedioGener.Sections("pagina").Controls("NOTAS13").Caption MSF.TextMatrix(13, 2) & "
" & MSF2.TextMatrix(13, 2) & "
= "&
MSF3.TextMatrix(13, 2) CertPromedioGener.Sections("pagina").Controls("NOTAS14").Caption MSF.TextMatrix(14, 2) & "
" & MSF2.TextMatrix(14, 2) & "
= "&
MSF3.TextMatrix(14, 2) ElseIf i = 15 Then
190
CertPromedioGener.Sections("pagina").Controls("materias1").Caption
=
MSF.TextMatrix(1, 1) CertPromedioGener.Sections("pagina").Controls("materias2").Caption
=
MSF.TextMatrix(2, 1) CertPromedioGener.Sections("pagina").Controls("materias3").Caption
=
MSF.TextMatrix(3, 1) CertPromedioGener.Sections("pagina").Controls("materias4").Caption
=
MSF.TextMatrix(4, 1) CertPromedioGener.Sections("pagina").Controls("materias5").Caption
=
MSF.TextMatrix(5, 1) CertPromedioGener.Sections("pagina").Controls("materias6").Caption
=
MSF.TextMatrix(6, 1) CertPromedioGener.Sections("pagina").Controls("materias7").Caption
=
MSF.TextMatrix(7, 1) CertPromedioGener.Sections("pagina").Controls("materias8").Caption
=
MSF.TextMatrix(8, 1) CertPromedioGener.Sections("pagina").Controls("materias9").Caption
=
MSF.TextMatrix(9, 1) CertPromedioGener.Sections("pagina").Controls("materias10").Caption
=
MSF.TextMatrix(10, 1) CertPromedioGener.Sections("pagina").Controls("materias11").Caption
=
MSF.TextMatrix(11, 1) CertPromedioGener.Sections("pagina").Controls("materias12").Caption
=
MSF.TextMatrix(12, 1) CertPromedioGener.Sections("pagina").Controls("materias13").Caption
=
MSF.TextMatrix(13, 1) CertPromedioGener.Sections("pagina").Controls("materias14").Caption
=
MSF.TextMatrix(14, 1) CertPromedioGener.Sections("pagina").Controls("materias15").Caption
=
MSF.TextMatrix(15, 1)
191
CertPromedioGener.Sections("pagina").Controls("NOTAS1").Caption MSF.TextMatrix(1, 2) & "
" & MSF2.TextMatrix(1, 2) & "
= "&
MSF3.TextMatrix(1, 2) CertPromedioGener.Sections("pagina").Controls("NOTAS2").Caption MSF.TextMatrix(2, 2) & "
" & MSF2.TextMatrix(2, 2) & "
= "&
MSF3.TextMatrix(2, 2) CertPromedioGener.Sections("pagina").Controls("NOTAS3").Caption MSF.TextMatrix(3, 2) & "
" & MSF2.TextMatrix(3, 2) & "
= "&
MSF3.TextMatrix(3, 2) CertPromedioGener.Sections("pagina").Controls("NOTAS4").Caption MSF.TextMatrix(4, 2) & "
" & MSF2.TextMatrix(4, 2) & "
= "&
MSF3.TextMatrix(4, 2) CertPromedioGener.Sections("pagina").Controls("NOTAS5").Caption MSF.TextMatrix(5, 2) & "
" & MSF2.TextMatrix(5, 2) & "
= "&
MSF3.TextMatrix(5, 2) CertPromedioGener.Sections("pagina").Controls("NOTAS6").Caption MSF.TextMatrix(6, 2) & "
" & MSF2.TextMatrix(6, 2) & "
= "&
MSF3.TextMatrix(6, 2) CertPromedioGener.Sections("pagina").Controls("NOTAS7").Caption MSF.TextMatrix(7, 2) & "
" & MSF2.TextMatrix(7, 2) & "
= "&
MSF3.TextMatrix(7, 2) CertPromedioGener.Sections("pagina").Controls("NOTAS8").Caption MSF.TextMatrix(8, 2) & "
" & MSF2.TextMatrix(8, 2) & "
= "&
MSF3.TextMatrix(8, 2) CertPromedioGener.Sections("pagina").Controls("NOTAS9").Caption MSF.TextMatrix(9, 2) & "
" & MSF2.TextMatrix(9, 2) & "
= "&
MSF3.TextMatrix(9, 2) CertPromedioGener.Sections("pagina").Controls("NOTAS10").Caption MSF.TextMatrix(10, 2) & "
" & MSF2.TextMatrix(10, 2) & "
= "&
MSF3.TextMatrix(10, 2)
192
CertPromedioGener.Sections("pagina").Controls("NOTAS11").Caption MSF.TextMatrix(11, 2) & "
" & MSF2.TextMatrix(11, 2) & "
= "&
MSF3.TextMatrix(11, 2) CertPromedioGener.Sections("pagina").Controls("NOTAS12").Caption MSF.TextMatrix(12, 2) & "
" & MSF2.TextMatrix(12, 2) & "
= "&
MSF3.TextMatrix(12, 2) CertPromedioGener.Sections("pagina").Controls("NOTAS13").Caption MSF.TextMatrix(13, 2) & "
" & MSF2.TextMatrix(13, 2) & "
= "&
MSF3.TextMatrix(13, 2) CertPromedioGener.Sections("pagina").Controls("NOTAS14").Caption MSF.TextMatrix(14, 2) & "
" & MSF2.TextMatrix(14, 2) & "
= "&
MSF3.TextMatrix(14, 2) CertPromedioGener.Sections("pagina").Controls("NOTAS15").Caption MSF.TextMatrix(15, 2) & "
" & MSF2.TextMatrix(15, 2) & "
= "&
MSF3.TextMatrix(15, 2) End If CertPromedioGener.Sections("pagina").Controls("TOTALES").Caption SumProm1 & "
" & SumProm2 & "
=
" & SumProm3
CertPromedioGener.Sections("pagina").Controls("TOTAL").Caption
=
TotalProm.Text CertPromedioGener.Sections("Pagina").Controls("Grado").Caption
=
Tabla!curso1 ReportLibreta.Hide CertPromedioGener.Refresh Load CertPromedioGener CertPromedioGener.Show Exit Sub salir: MsgBox "Error, este estudiante no tiene notas de los 3 Trimestre.", vbCritical End Sub
Private Sub boton_Click(Index As Integer)
193
Select Case Index Case 0 Dim f As Long Dim Sum, Sum2 As Double On Error Resume Next 'TRIMESTRE #1 f = 1: Sum = 0: Sum2 = 0 MSF.Rows = 1 Set Tabla = Base.Execute("select NOTAS.TRIMESTRE,MATERIAS.NOMBRE AS
MATERIA,NOTAS.PROMEDIO,NOTAS.CONDUCTA
datos,matriculas,notas,materias,aux,curso
from where
datos.alumnoid=matriculas.alumnoid and matriculas.idcurso=curso.idanio and curso.idanio=aux.anioid
and
aux.materiaid=materias.materiaid
and
materias.materiaid=notas.materiaid and notas.numero=matriculas.numero and datos.nombre='" & alumnos.Text & "' and notas.trimestre=1 and curso.nombre='" & ciclo.Text & "' and notas.lectivo=" & Val(anio.Text) & " ORDER BY MATERIAS.NOMBRE") Do Until Tabla.EOF MSF.Rows = MSF.Rows + 1 MSF.TextMatrix(f, 0) = Tabla!TRIMESTRE MSF.TextMatrix(f, 1) = Tabla!materia MSF.TextMatrix(f, 2) = Tabla!promedio MSF.TextMatrix(f, 3) = Tabla!CONDUCTA Tabla.MoveNext f=f+1 Loop Tabla.Close Set Tabla = Nothing For i = 1 To f - 1 Sum = Sum + Val(MSF.TextMatrix(i, 2)) Sum2 = Sum2 + Val(MSF.TextMatrix(i, 3)) Next i
194
SumProm1 = Round(Sum / (i - 1)) SumCond1 = Round(Sum2 / (i - 1)) 'TRIMESTRE #2 f = 1: Sum = 0: Sum2 = 0 MSF2.Rows = 1 Set Tabla = Base.Execute("select NOTAS.TRIMESTRE,MATERIAS.NOMBRE AS
MATERIA,NOTAS.PROMEDIO,NOTAS.CONDUCTA
datos,matriculas,notas,materias,aux,curso
from where
datos.alumnoid=matriculas.alumnoid and matriculas.idcurso=curso.idanio and curso.idanio=aux.anioid
and
aux.materiaid=materias.materiaid
and
materias.materiaid=notas.materiaid and notas.numero=matriculas.numero and datos.nombre='" & alumnos.Text & "' and notas.trimestre=2 and curso.nombre='" & ciclo.Text & "' and notas.lectivo=" & Val(anio.Text) & " ORDER BY MATERIAS.NOMBRE") Do Until Tabla.EOF MSF2.Rows = MSF2.Rows + 1 MSF2.TextMatrix(f, 0) = Tabla!TRIMESTRE MSF2.TextMatrix(f, 1) = Tabla!materia MSF2.TextMatrix(f, 2) = Tabla!promedio MSF2.TextMatrix(f, 3) = Tabla!CONDUCTA Tabla.MoveNext f=f+1 Loop Tabla.Close Set Tabla = Nothing For i = 1 To f - 1 Sum = Sum + Val(MSF2.TextMatrix(i, 2)) Sum2 = Sum2 + Val(MSF2.TextMatrix(i, 3)) Next i SumProm2 = Round(Sum / (i - 1)) SumCond2 = Round(Sum2 / (i - 1)) 'TRIMESTRE #3
195
f = 1: Sum = 0: Sum2 = 0 MSF3.Rows = 1 Set Tabla = Base.Execute("select NOTAS.TRIMESTRE,MATERIAS.NOMBRE AS
MATERIA,NOTAS.PROMEDIO,NOTAS.CONDUCTA
datos,matriculas,notas,materias,aux,curso
from where
datos.alumnoid=matriculas.alumnoid and matriculas.idcurso=curso.idanio and curso.idanio=aux.anioid
and
aux.materiaid=materias.materiaid
and
materias.materiaid=notas.materiaid and notas.numero=matriculas.numero and datos.nombre='" & alumnos.Text & "' and notas.trimestre=3 and curso.nombre='" & ciclo.Text & "' and notas.lectivo=" & Val(anio.Text) & " ORDER BY MATERIAS.NOMBRE") Do Until Tabla.EOF MSF3.Rows = MSF3.Rows + 1 MSF3.TextMatrix(f, 0) = Tabla!TRIMESTRE MSF3.TextMatrix(f, 1) = Tabla!materia MSF3.TextMatrix(f, 2) = Tabla!promedio MSF3.TextMatrix(f, 3) = Tabla!CONDUCTA Tabla.MoveNext f=f+1 Loop Tabla.Close Set Tabla = Nothing For i = 1 To f - 1 Sum = Sum + Val(MSF3.TextMatrix(i, 2)) Sum2 = Sum2 + Val(MSF3.TextMatrix(i, 3)) Next i SumProm3 = Round(Sum / (i - 1)) SumCond3 = Round(Sum2 / (i - 1)) 'promedios generales TotalProm = Round((Val(SumProm1) + Val(SumProm2) + Val(SumProm3)) / 3) TotalCond = Round((Val(SumCond1) + Val(SumCond2) + Val(SumCond3)) / 3) 'IMPRIME
196
BotonImprime anio.ListIndex = -1 ciclo.ListIndex = -1 alumnos.ListIndex = -1 Case 1 anio.ListIndex = -1 ciclo.ListIndex = -1 alumnos.ListIndex = -1 ReportLibreta.Hide End Select End Sub
Private Sub LlenarCiclo() On Error GoTo salir ciclo.Clear If Tabla.State = 1 Then Tabla.Close Set Tabla = Nothing End If Set Tabla = Base.Execute("Select * from curso order by nombre") While Not Tabla.EOF ciclo.AddItem Tabla!nombre ciclo.ItemData(ciclo.NewIndex) = Tabla!IdAnio Tabla.MoveNext Wend Tabla.Close Set Tabla = Nothing anio.Clear Set Tabla = Base.Execute("Select DISTINCT lectivo from matriculas order by lectivo") While Not Tabla.EOF anio.AddItem Tabla!lectivo
197
Tabla.MoveNext Wend Tabla.Close Set Tabla = Nothing Exit Sub salir: If MsgBox(Err.Description, vbExclamation + vbRetryCancel) = vbRetry Then LlenarCiclo Else Unload Me End Sub
Private Sub ciclo_Click() If ciclo.ListIndex = -1 Then Exit Sub LlenarAlumnos End Sub
Private Sub Form_Load() LlenarCiclo anio.ListIndex = ListCount - 1 End Sub
Private Sub LlenarAlumnos() If Tabla.State = 1 Then Tabla.Close Set Tabla = Nothing End If alumnos.Clear Set Tabla = Base.Execute("Select datos.nombre, matriculas.numero from datos inner join matriculas on datos.alumnoid matriculas.Idcurso
=
"
&
= matriculas.alumnoid where
ciclo.ItemData(ciclo.ListIndex)
&
"
and
matriculas.lectivo = " & Val(anio.Text)) While Not Tabla.EOF alumnos.AddItem Tabla!nombre
198
alumnos.ItemData(alumnos.NewIndex) = Tabla!numero Tabla.MoveNext Wend Tabla.Close Set Tabla = Nothing End Sub
1.24. FORMULARIO CARNET DEL ESTUDIANTE
Dim Tabla As New ADODB.Recordset Dim tablaEd As New ADODB.Recordset
Private Sub anio_Click() If ciclo.ListIndex = -1 Then Exit Sub LlenarAlumnos End Sub
Sub boton() On Error GoTo salir If Tabla.State = 1 Then Tabla.Close Set Tabla = Nothing End If If alumnos.ListIndex = -1 Or ciclo.ListIndex = -1 Or anio.ListIndex = -1 Then Exit Sub Set
Tabla
=
Base.Execute("Select
Alumno,curso.nombre
as
matriculas.numero,
datos.nombre
curso1,matriculas.folio
as
from
datos,matriculas,curso,notas where datos.alumnoid=matriculas.alumnoid
and
matriculas.idcurso=curso.idanio
and
and
matriculas.numero=notas.numero
notas.numero = " & alumnos.ItemData(alumnos.ListIndex) & " and notas.lectivo = " & Val(anio.Text) & " order by datos.nombre") Set CertificadoMatricula.DataSource = Tabla
199
CertificadoMatricula.Sections("Eduardo").Controls("Estudiante").Caption
=
Tabla!alumno CertificadoMatricula.Sections("Eduardo").Controls("Curso").Caption
=
Tabla!curso1 CertificadoMatricula.Sections("Eduardo").Controls("a単o").Caption = anio.Text & " - " & Val(anio.Text) + 1 CertificadoMatricula.Sections("Eduardo").Controls("Folio").Caption
=
Tabla!Folio CertificadoMatricula.Sections("Eduardo").Controls("Matricula").Caption = "0" & Tabla!numero CertificadoMatricula.Sections("Eduardo").Controls("Fecha").Caption
=
Format(Date, " dd \de mmmm \del yyyy") RptCertificadoMatricula.Hide CertificadoMatricula.Refresh Load CertificadoMatricula Exit Sub salir: MsgBox "error, consulte al distribuidor del programa.", vbCritical End Sub
Private Sub LlenarCiclo() On Error GoTo salir ciclo.Clear If Tabla.State = 1 Then Tabla.Close Set Tabla = Nothing End If Set Tabla = Base.Execute("Select * from curso") While Not Tabla.EOF ciclo.AddItem Tabla!nombre ciclo.ItemData(ciclo.NewIndex) = Tabla!IdAnio Tabla.MoveNext
200
Wend Tabla.Close Set Tabla = Nothing Set Tabla = Base.Execute("Select DISTINCT lectivo from matriculas order by lectivo") While Not Tabla.EOF anio.AddItem Tabla!lectivo Tabla.MoveNext Wend Tabla.Close Set Tabla = Nothing Exit Sub salir: If MsgBox(Err.Description, vbExclamation + vbRetryCancel) = vbRetry Then LlenarCiclo Else Unload Me End Sub
Private Sub ciclo_Click() If ciclo.ListIndex = -1 Then Exit Sub LlenarAlumnos End Sub
Private Sub Form_Load() LlenarCiclo anio.ListIndex = ListCount - 1 End Sub
Private Sub LlenarAlumnos() If Tabla.State = 1 Then Tabla.Close Set Tabla = Nothing End If
201
alumnos.Clear Set Tabla = Base.Execute("Select datos.nombre, matriculas.numero from datos inner join matriculas on datos.alumnoid matriculas.Idcurso
=
"
&
= matriculas.alumnoid where
ciclo.ItemData(ciclo.ListIndex)
&
"
and
matriculas.lectivo = " & Val(anio.Text)) While Not Tabla.EOF alumnos.AddItem Tabla!nombre alumnos.ItemData(alumnos.NewIndex) = Tabla!numero Tabla.MoveNext Wend Tabla.Close: Set Tabla = Nothing End Sub
Private Sub Cancelar_Click() Unload Me End Sub
Private Sub Mostar_Click() On Error GoTo Trata ReporteCarnet.ssQLL = "Select matriculas.numero AS Matricula, datos.nombre AS Alumno, curso.nombre AS Curso, cdate(format(now,'dd/mm/yyyy')) AS Fecha, datos.Padre, datos.Madre, matriculas.representante AS Representante, datos.direapoderado AS Direccion " & _ "FROM Datos, Matriculas,Curso " & _ "WHERE
datos.alumnoid=matriculas.alumnoid
and
matriculas.idcurso=curso.idanio and matriculas.Lectivo=" & Val(anio.Text) & " and matriculas.IdCurso=" & ciclo.ItemData(ciclo.ListIndex) & "" ReporteCarnet.Show Exit Sub Trata: MsgBox "No hay datos que mostrar.", vbExclamation End Sub
202
1.25. FORMULARIO ACTA DE MATRICULAS
Dim TablaEdu As New ADODB.Recordset
Private Sub LlenarLectivo() If TablaEdu.State = 1 Then TablaEdu.Close Set TablaEdu = Base.Execute("Select DISTINCT lectivo from matriculas order by lectivo") lectivo.Clear While Not TablaEdu.EOF lectivo.AddItem TablaEdu!lectivo TablaEdu.MoveNext Wend TablaEdu.Close End Sub
Private Sub boton_Click(Index As Integer) Select Case Index Case 0: If lectivo.ListIndex = -1 Then MsgBox "Debe seleccionar el a帽o lectivo del cual desee mostrar la informaci贸n requerida", vbExclamation: Exit Sub If TablaEdu.State = 1 Then TablaEdu.Close On Error GoTo salir Set
TablaEdu
=
Base.Execute("select
datos.sexo,matriculas.numero
as
Matricula,curso.nombre as paralelo,datos.nombre as estudiante,datos.lnacimiento &
',
'
&
datos.fecha
LugFechNac,datos.padre,datos.madre,datos.vivecon,matriculas.representante
as as
Nomapoderado,datos.direapoderado,matriculas.observacion,format(matriculas.fec ha,'dd')
as
dia,format(matriculas.fecha,'mmmm')
as
mes,format(matriculas.fecha,'yyyy') as ano from datos, matriculas,curso where datos.alumnoid=matriculas.alumnoid and curso.idanio=matriculas.idcurso and matriculas.lectivo=" & Val(lectivo.Text) & " ")
203
Set RptMatricula.DataSource = TablaEdu If Val(TablaEdu!Sexo) = 1 Then RptMatricula.Sections("sección1").Controls("etiqueta7").Caption = "Apellidos y Nombres de la Alumna" RptMatricula.Sections("sección1").Controls("etiqueta12").Caption = "Vive con" Else RptMatricula.Sections("sección1").Controls("etiqueta7").Caption = "Apellidos y Nombres del Alumno" RptMatricula.Sections("sección1").Controls("etiqueta12").Caption = "Vive con" End If RptMatricula.Sections("sección1").Controls("texto2").DataField = "Matricula" RptMatricula.Sections("sección1").Controls("texto3").DataField = "paralelo" RptMatricula.Sections("sección1").Controls("texto4").DataField = "Estudiante" RptMatricula.Sections("sección1").Controls("texto5").DataField = "LugFechNac" RptMatricula.Sections("sección1").Controls("texto6").DataField = "padre" RptMatricula.Sections("sección1").Controls("texto7").DataField = "madre" RptMatricula.Sections("sección1").Controls("texto8").DataField = "vivecon" RptMatricula.Sections("sección1").Controls("texto9").DataField
=
"nomapoderado" RptMatricula.Sections("sección1").Controls("texto10").DataField
=
"direapoderado" RptMatricula.Sections("sección1").Controls("texto12").DataField = "observacion" RptMatricula.Sections("sección1").Controls("texto13").DataField = "Dia" RptMatricula.Sections("sección1").Controls("texto14").DataField = "mes" RptMatricula.Sections("sección1").Controls("texto15").DataField = "ano" RptMatricula.Refresh Unload Me Load RptMatricula RptMatricula.Show Exit Sub salir: MsgBox "Hay un problema, consulte al distribuidor del sistema.", vbCritical
204
Case 1: Unload Me End Select End Sub
Private Sub Form_Load() LlenarLectivo End Sub
1.26. FORMULARIO CERTIFICADO DE MATRICULA
Dim Tabla As New ADODB.Recordset Dim tablaEd As New ADODB.Recordset Dim Sexo As String Dim S As String
Private Sub anio_Click() If ciclo.ListIndex = -1 Then Exit Sub LlenarAlumnos End Sub
Sub boton() On Error GoTo salir If Tabla.State = 1 Then Tabla.Close: Set Tabla = Nothing End If If alumnos.ListIndex = -1 Or ciclo.ListIndex = -1 Or anio.ListIndex = -1 Then Exit Sub 'Or Descripcion.ListIndex = -1 Set
Tabla
=
Base.Execute("Select
Alumno,curso.nombre
as
curso1
matriculas.numero, from
datos.nombre
datos,matriculas,curso
as
where
datos.alumnoid=matriculas.alumnoid and matriculas.idcurso=curso.idanio and matriculas.numero = " & alumnos.ItemData(alumnos.ListIndex) & " and matriculas.lectivo = " & Val(anio.Text) & " order by datos.nombre")
205
Set CertificadoMatricula.DataSource = Tabla If Sexo = "1" Then CertificadoMatricula.Sections("Eduardo").Controls("Sexo").Caption = "la" CertificadoMatricula.Sections("Eduardo").Controls("Sexo1").Caption = "a" CertificadoMatricula.Sections("Eduardo").Controls("Sexo2").Caption = "a" Else CertificadoMatricula.Sections("Eduardo").Controls("Sexo").Caption = "el" CertificadoMatricula.Sections("Eduardo").Controls("Sexo1").Caption = "o" CertificadoMatricula.Sections("Eduardo").Controls("Sexo2").Caption = "o" End If CertificadoMatricula.Sections("Eduardo").Controls("Estudiante").Caption
=
Tabla!alumno CertificadoMatricula.Sections("Eduardo").Controls("Curso").Caption
=
Tabla!curso1 CertificadoMatricula.Sections("Eduardo").Controls("año").Caption = anio.Text & " - " & Val(anio.Text) + 1 CertificadoMatricula.Sections("Eduardo").Controls("Matricula").Caption = "0" & Tabla!numero CertificadoMatricula.Sections("Eduardo").Controls("Fecha").Caption
=
Format(Date, " dd \de mmmm \del yyyy") CertificadoMatricula.Sections("Sección4").Controls("Especie").Caption = "Nº.
"
&S RptCertMatricula.Hide CertificadoMatricula.Refresh Load CertificadoMatricula CertificadoMatricula.Show Exit Sub salir: Unload CertificadoMatricula MsgBox "Error, este estudiante no esta matriculado.", vbCritical End Sub
Private Sub LlenarCiclo()
206
On Error GoTo salir ciclo.Clear If Tabla.State = 1 Then Tabla.Close Set Tabla = Nothing End If Set Tabla = Base.Execute("Select * from curso") While Not Tabla.EOF ciclo.AddItem Tabla!nombre ciclo.ItemData(ciclo.NewIndex) = Tabla!IdAnio Tabla.MoveNext Wend Tabla.Close Set Tabla = Nothing anio.Clear Set Tabla = Base.Execute("Select DISTINCT lectivo from matriculas order by lectivo") While Not Tabla.EOF anio.AddItem Tabla!lectivo Tabla.MoveNext Wend Tabla.Close Set Tabla = Nothing Exit Sub salir: If MsgBox(Err.Description, vbExclamation + vbRetryCancel) = vbRetry Then LlenarCiclo Else Unload Me End Sub
Private Sub ciclo_Click() If ciclo.ListIndex = -1 Then Exit Sub LlenarAlumnos
207
End Sub
Private Sub Descripcion_KeyPress(Tecla As Integer) Select Case Tecla Case Else Tecla = 0 End Select End Sub
Private Sub Form_Load() LlenarCiclo anio.ListIndex = ListCount - 1 Sexo = "" End Sub
Private Sub LlenarAlumnos() If Tabla.State = 1 Then Tabla.Close Set Tabla = Nothing End If alumnos.Clear Set Tabla = Base.Execute("Select datos.nombre, matriculas.numero from datos inner join matriculas on datos.alumnoid matriculas.Idcurso
=
"
&
= matriculas.alumnoid where
ciclo.ItemData(ciclo.ListIndex)
&
"
and
matriculas.lectivo = " & Val(anio.Text)) While Not Tabla.EOF alumnos.AddItem Tabla!nombre alumnos.ItemData(alumnos.NewIndex) = Tabla!numero Tabla.MoveNext Wend Tabla.Close Set Tabla = Nothing
208
End Sub
Private Sub Cancelar_Click() Unload Me End Sub
Sub Especie() Dim ValorEsp As String Dim i As Integer On Error Resume Next ValorEsp = "1" S = "" Set Tabla = Base.Execute("select max(nespecie) as Especi from Especie where anio='" & anio.Text & "'") ValorEsp = Val(Tabla!especi) + 1 Tabla.Close Set Tabla = Nothing For i = 1 To 5 - Len(ValorEsp) S = S & "0" Next i S = S & ValorEsp Base.Execute "Insert into Especie(Nespecie,anio)values('" & S & "','" & anio.Text & "')" Base.Execute "delete * from especie where anio<='" & Val(anio.Text) - 5 & "'" End Sub
Private Sub Mostar_Click() On Error Resume Next Set Tabla = Base.Execute("Select datos.sexo from datos inner join matriculas on datos.alumnoid
=
Trim(alumnos.Text)
matriculas.alumnoid &
"'
and
where
datos.nombre='"
matriculas.Idcurso
=
"
& &
ciclo.ItemData(ciclo.ListIndex) & " and matriculas.lectivo = " & Val(anio.Text))
209
Sexo = Tabla!Sexo Tabla.Close Set Tabla = Nothing boton End Sub
1.27. FORMULARIO CERTIFICADO DE CONDUCTA
Dim Tabla As New ADODB.Recordset Dim tablaEd As New ADODB.Recordset Dim Sexo, Puntage As String Dim S As String
Private Sub anio_Click() If ciclo.ListIndex = -1 Then Exit Sub LlenarAlumnos End Sub
Sub boton() On Error GoTo salir If Tabla.State = 1 Then Tabla.Close Set Tabla = Nothing End If If alumnos.ListIndex = -1 Or ciclo.ListIndex = -1 Or anio.ListIndex = -1 Then Exit Sub 'Or Descripcion.ListIndex = -1 Set Tabla = Base.Execute("Select *, matriculas.numero, datos.nombre as AlumnoS1,curso.nombre
as
curso1,matriculas.lectivo
from
datos,matriculas,curso,notas where datos.alumnoid=matriculas.alumnoid and matriculas.idcurso=curso.idanio
and
matriculas.numero=notas.numero
and
notas.numero = " & alumnos.ItemData(alumnos.ListIndex) & " and notas.lectivo = " & Val(anio.Text) & " order by datos.nombre")
210
Set CertfConducta.DataSource = Tabla CertfConducta.Sections("Pagina").Controls("AnoLectivo").Caption = anio.Text & " - " & Val(anio.Text) + 1 If Sexo = "1" Or Sexo = 1 Then CertfConducta.Sections("Pagina").Controls("Sexo").Caption = "la" CertfConducta.Sections("Pagina").Controls("Sexo1").Caption = "a" Else CertfConducta.Sections("Pagina").Controls("Sexo").Caption = "el" CertfConducta.Sections("Pagina").Controls("Sexo1").Caption = "o" End If CertfConducta.Sections("Pagina").Controls("Estudiante").Caption
=
Tabla!alumnos1 CertfConducta.Sections("Pagina").Controls("Curso").Caption = Tabla!curso1 CertfConducta.Sections("Pagina").Controls("estudiante2").Caption
=
Tabla!alumnos1 CertfConducta.Sections("Pagina").Controls("a単o").Caption = anio.Text & " - " & Val(anio.Text) + 1 CertfConducta.Sections("Pagina").Controls("Curso1").Caption = Tabla!curso1 CertfConducta.Sections("Pagina").Controls("Calificacion").Caption
=
TotalCond.Text CertfConducta.Sections("Pagina").Controls("Equivalente").Caption = Puntage CertfConducta.Sections("Pagina").Controls("Fecha").Caption = "Portoviejo, al " & Format(Date, " dd \de mmmm \del yyyy") RptCertificadoConducta.Hide CertfConducta.Refresh Load CertfConducta CertfConducta.Show Exit Sub salir: Unload CertificadoConducta MsgBox "Error, este estudiante no tiene nota de conducta.", vbCritical End Sub
211
Private Sub LlenarCiclo() On Error GoTo salir ciclo.Clear If Tabla.State = 1 Then Tabla.Close Set Tabla = Nothing End If Set Tabla = Base.Execute("Select * from curso") While Not Tabla.EOF ciclo.AddItem Tabla!nombre ciclo.ItemData(ciclo.NewIndex) = Tabla!IdAnio Tabla.MoveNext Wend Tabla.Close Set Tabla = Nothing anio.Clear Set Tabla = Base.Execute("Select DISTINCT lectivo from matriculas order by lectivo") While Not Tabla.EOF anio.AddItem Tabla!lectivo Tabla.MoveNext Wend Tabla.Close Set Tabla = Nothing Exit Sub salir: If MsgBox(Err.Description, vbExclamation + vbRetryCancel) = vbRetry Then LlenarCiclo Else Unload Me End Sub
Private Sub ciclo_Click() If ciclo.ListIndex = -1 Then Exit Sub
212
LlenarAlumnos End Sub
Private Sub Descripcion_KeyPress(Tecla As Integer) Select Case Tecla Case Else Tecla = 0 End Select End Sub
Private Sub Form_Load() LlenarCiclo anio.ListIndex = ListCount - 1 Sexo = "" End Sub
Private Sub LlenarAlumnos() If Tabla.State = 1 Then Tabla.Close Set Tabla = Nothing End If alumnos.Clear Set Tabla = Base.Execute("Select datos.nombre, matriculas.numero from datos inner join matriculas on datos.alumnoid matriculas.Idcurso
=
"
&
= matriculas.alumnoid where
ciclo.ItemData(ciclo.ListIndex)
&
"
and
matriculas.lectivo = " & Val(anio.Text)) While Not Tabla.EOF alumnos.AddItem Tabla!nombre alumnos.ItemData(alumnos.NewIndex) = Tabla!numero Tabla.MoveNext Wend Tabla.Close
213
Set Tabla = Nothing End Sub
Private Sub Cancelar_Click() Unload Me End Sub
Sub Especie() Dim ValorEsp As String Dim i As Integer On Error Resume Next ValorEsp = "1" S = "" Set Tabla = Base.Execute("select max(nespecie) as Especi from Especie where anio='" & anio.Text & "'") ValorEsp = Val(Tabla!especi) + 1 Tabla.Close Set Tabla = Nothing For i = 1 To 5 - Len(ValorEsp) S = S & "0" Next i S = S & ValorEsp Base.Execute "Insert into Especie(Nespecie,anio)values('" & S & "','" & anio.Text & "')" Base.Execute "delete * from especie where anio<='" & Val(anio.Text) - 5 & "'" End Sub
Sub LlenarConductas() Dim f As Long Dim Sum, Sum2 As Double On Error Resume Next 'TRIMESTRE #1
214
f = 1: Sum = 0: Sum2 = 0 MSF.Rows = 1 Set Tabla = Base.Execute("select NOTAS.TRIMESTRE,MATERIAS.NOMBRE AS
MATERIA,NOTAS.PROMEDIO,NOTAS.CONDUCTA
datos,matriculas,notas,materias,aux,curso
from where
datos.alumnoid=matriculas.alumnoid and matriculas.idcurso=curso.idanio and curso.idanio=aux.anioid
and
aux.materiaid=materias.materiaid
and
materias.materiaid=notas.materiaid and notas.numero=matriculas.numero and datos.nombre='" & alumnos.Text & "' and notas.trimestre=1 and curso.nombre='" & ciclo.Text & "' and notas.lectivo=" & Val(anio.Text) & " ORDER BY MATERIAS.NOMBRE") Do Until Tabla.EOF MSF.Rows = MSF.Rows + 1 MSF.TextMatrix(f, 0) = Tabla!TRIMESTRE MSF.TextMatrix(f, 1) = Tabla!materia MSF.TextMatrix(f, 2) = Tabla!promedio MSF.TextMatrix(f, 3) = Tabla!CONDUCTA Tabla.MoveNext f=f+1 Loop Tabla.Close Set Tabla = Nothing For i = 1 To f - 1 Sum = Sum + Val(MSF.TextMatrix(i, 2)) Sum2 = Sum2 + Val(MSF.TextMatrix(i, 3)) Next i SumProm1 = Round(Sum / (i - 1)) SumCond1 = Round(Sum2 / (i - 1)) 'TRIMESTRE #2 f = 1: Sum = 0: Sum2 = 0 MSF2.Rows = 1
215
Set Tabla = Base.Execute("select NOTAS.TRIMESTRE,MATERIAS.NOMBRE AS
MATERIA,NOTAS.PROMEDIO,NOTAS.CONDUCTA
datos,matriculas,notas,materias,aux,curso
from where
datos.alumnoid=matriculas.alumnoid and matriculas.idcurso=curso.idanio and curso.idanio=aux.anioid
and
aux.materiaid=materias.materiaid
and
materias.materiaid=notas.materiaid and notas.numero=matriculas.numero and datos.nombre='" & alumnos.Text & "' and notas.trimestre=2 and curso.nombre='" & ciclo.Text & "' and notas.lectivo=" & Val(anio.Text) & " ORDER BY MATERIAS.NOMBRE") Do Until Tabla.EOF MSF2.Rows = MSF2.Rows + 1 MSF2.TextMatrix(f, 0) = Tabla!TRIMESTRE MSF2.TextMatrix(f, 1) = Tabla!materia MSF2.TextMatrix(f, 2) = Tabla!promedio MSF2.TextMatrix(f, 3) = Tabla!CONDUCTA Tabla.MoveNext f=f+1 Loop Tabla.Close Set Tabla = Nothing For i = 1 To f - 1 Sum = Sum + Val(MSF2.TextMatrix(i, 2)) Sum2 = Sum2 + Val(MSF2.TextMatrix(i, 3)) Next i SumProm2 = Round(Sum / (i - 1)) SumCond2 = Round(Sum2 / (i - 1)) 'TRIMESTRE #3 f = 1: Sum = 0: Sum2 = 0 MSF3.Rows = 1 Set Tabla = Base.Execute("select NOTAS.TRIMESTRE,MATERIAS.NOMBRE AS
MATERIA,NOTAS.PROMEDIO,NOTAS.CONDUCTA
datos,matriculas,notas,materias,aux,curso
from where
216
datos.alumnoid=matriculas.alumnoid and matriculas.idcurso=curso.idanio and curso.idanio=aux.anioid
and
aux.materiaid=materias.materiaid
and
materias.materiaid=notas.materiaid and notas.numero=matriculas.numero and datos.nombre='" & alumnos.Text & "' and notas.trimestre=3 and curso.nombre='" & ciclo.Text & "' and notas.lectivo=" & Val(anio.Text) & " ORDER BY MATERIAS.NOMBRE") Do Until Tabla.EOF MSF3.Rows = MSF3.Rows + 1 MSF3.TextMatrix(f, 0) = Tabla!TRIMESTRE MSF3.TextMatrix(f, 1) = Tabla!materia MSF3.TextMatrix(f, 2) = Tabla!promedio MSF3.TextMatrix(f, 3) = Tabla!CONDUCTA Tabla.MoveNext f=f+1 Loop Tabla.Close Set Tabla = Nothing For i = 1 To f - 1 Sum = Sum + Val(MSF3.TextMatrix(i, 2)) Sum2 = Sum2 + Val(MSF3.TextMatrix(i, 3)) Next i SumProm3 = Round(Sum / (i - 1)) SumCond3 = Round(Sum2 / (i - 1)) TotalProm = Round((Val(SumProm1) + Val(SumProm2) + Val(SumProm3)) / 3) TotalCond = Round((Val(SumCond1) + Val(SumCond2) + Val(SumCond3)) / 3) End Sub
Private Sub Mostar_Click() Dim suma, Valor As String On Error Resume Next suma = 0: Valor = 0 LlenarConductas 'llena las conductas para ser calculadas
217
Puntage = "" Set Tabla = Base.Execute("Select datos.sexo from datos inner join matriculas on datos.alumnoid = matriculas.alumnoid where matriculas.Idcurso = " & ciclo.ItemData(ciclo.ListIndex) & " and matriculas.lectivo = " & Val(anio.Text)) Sexo = Tabla!Sexo Tabla.Close Set Tabla = Nothing If Val(TotalCond) = 0 Or TotalCond = "" Then MsgBox "El estudiante seleccionedo no tiene calificacion general de conducta Trimestral.", vbInformation Exit Sub End If If Val(TotalCond) >= 19 And Val(TotalCond) <= 20 Then Puntage = "Sobresaliente" ElseIf Val(TotalCond) >= 16 And Val(TotalCond) <= 18 Then Puntage = "Muy Bueno" ElseIf Val(TotalCond) >= 13 And Val(TotalCond) <= 15 Then Puntage = "Bueno" ElseIf Val(TotalCond) >= 10 And Val(TotalCond) <= 12 Then Puntage = "Regular" ElseIf Val(TotalCond) >= 0 And Val(TotalCond) <= 9 Then Puntage = "Insuficiente" End If boton End Sub
1.28. FORMULARIO DATOS DEL PROFESOR
Dim Tabla As New ADODB.Recordset Dim TablaEdu As New ADODB.Recordset
Private Sub Cancelar_Click()
218
Unload Me End Sub
Private Sub LlenarProfesores() On Error GoTo salir nombre.Clear Set Tabla = Base.Execute("Select * from Profesores order by nombre") While Not Tabla.EOF nombre.AddItem Tabla!nombre nombre.ItemData(nombre.NewIndex) = Tabla!profesorid Tabla.MoveNext Wend Tabla.Close Set Tabla = Nothing Exit Sub salir: If MsgBox(Err.Description, vbExclamation + vbRetryCancel) = vbRetry Then LlenarProfesores Else Unload Me End Sub
Private Sub Form_Load() LlenarProfesores LlenarLectivo End Sub
Private Sub LlenarLectivo() If TablaEdu.State = 1 Then TablaEdu.Close Set TablaEdu = Base.Execute("Select DISTINCT lectivo from matriculas order by lectivo") lectivo.Clear While Not TablaEdu.EOF lectivo.AddItem TablaEdu!lectivo
219
TablaEdu.MoveNext Wend TablaEdu.Close Set TablaEdu = Nothing End Sub
Private Sub Mostar_Click() If nombre.ListIndex = -1 Then MsgBox "Debe seleccionar el nombre del profesor.", vbExclamation: Exit Sub If lectivo.ListIndex = -1 Then MsgBox "Debe seleccionar el a帽o lectivo.", vbExclamation: Exit Sub If TablaEdu.State = 1 Then TablaEdu.Close On Error GoTo salir Set
TablaEdu
=
Base.Execute("select
profesores.nombre
as
Profe,Profesores.direccion,profesores.telefono,Profesores.especialidad,curso.nom bre
as
anobasica,notas.lectivo,materias.nombre
as
materias
matriculas,notas,materias,aux,curso,profesores matriculas.idcurso=curso.idanio
and
from where
curso.idanio=aux.anioid
and
aux.materiaid=materias.materiaid and materias.materiaid=notas.materiaid and notas.numero=matriculas.numero and profesores.profesorid=aux.profesorid and profesores.nombre='" Val(lectivo.Text)
&
nombre.Text &
& "
"'
and
notas.lectivo=" group
& by
profesores.nombre,Profesores.direccion,profesores.telefono,Profesores.especialida d,curso.nombre,notas.lectivo,materias.nombre") Set DatosProfesor.DataSource = TablaEdu DatosProfesor.Sections("secci贸n2").Controls("Nombre").Caption
=
TablaEdu!profe DatosProfesor.Sections("secci贸n2").Controls("Direccion").Caption
=
TablaEdu!Direccion DatosProfesor.Sections("secci贸n2").Controls("Telefono").Caption
=
TablaEdu!Telefono
220
DatosProfesor.Sections("sección2").Controls("Especialidad").Caption
=
TablaEdu!Especialidad DatosProfesor.Sections("sección1").Controls("AnoBasica").DataField
=
"anobasica" DatosProfesor.Sections("sección2").Controls("Lectivo").Caption
=
TablaEdu!lectivo DatosProfesor.Sections("sección1").Controls("Materias").DataField = "materias" DatosProfesor.Refresh Unload RptProfesor Load DatosProfesor DatosProfesor.Show Exit Sub salir: MsgBox "El profesor no tiene año de basica en este lectivo.", vbCritical End Sub
221
222
1. EL PROGRAMA PORTETE TARQUI
1.1. DESCRIPCIÓN DEL PROGRAMA
El sistema Portete Tarqui es un programa de control de información ya que tiene como principal característica llevar un control de matrícula y notas de los estudiantes que se encuentran en la escuela Fiscal Mixta “Portete de Tarqui”.
Esté sistema genera las siguientes actividades dentro de está entidad:
Formulario inicio de sesión
Formulario de bienvenida al sistema
Formulario Principal (MDI)
Formularios de Ingreso y modificación del estudiante
Formularios de ingreso y modificación del matriculas
Formularios de ingreso y modificación de las materias
Formularios de ingreso y modificación clave del sistema
Formularios de ingreso y modificación de datos de la institución
Formularios de ingreso y modificación de calificaciones
Formularios de ingreso y modificación del profesor
Formularios de reportes
223
1.2. REQUERIMIENTOS
Marca Mainboard:
Intel
Tipo de procesador:
Dual Core de 2.0 GHz o Superior
Tamaño de disco duro:
160 Gb de espacio inicial o Superior
Memoria RAM:
1 GB o Superior
Monitor:
VGA o SVGA
Unidad de CD:
DVD-Rom
Impresora:
Opcional
1.3.INSTALACIÓN
1. Inserte el CD etiquetado con el nombre de Escuela 2. Seleccione el icono Mi PC, luego abrir la unidad de CD q es D: 3. Abrir la carpeta llamada Instalador Portete Tarqui 4. Hacer doble clic en el icono Setup.exe
1.4.EJECUCIÓN DEL SISTEMA
1. Escoger el botón Inicio 2. Seleccionar Programas 3. Elegir la opción Matrícula Escuela 4. Por ultimo clic en Portete de Tarqui
224
2. FUNCIONEMIENTO PORTETE TARQUI
2.1.INTERFAZ DEL SISTEMA
En esté momento se pondrá en detalle cada una de las interfaces que tiene la aplicación para su ejecución.
2.2.INGRESO A LA APLICACIÓN
Cuando el usuario inicia la aplicación se muestra la siguiente pantalla la cual da la bienvenida a sistema.
225
2.3.PANTALLA DE INICIO DE SECCIÓN
Verifica al usuario que tiene acceso al sistema con su respectivo nombre después que el usuario escriba su contraseña correcta, cumpliendo estas condiciones el usuario tendrá que hacer clic en el botón Aceptar para acceder al sistema, el botón Salir sirve para cerrar la aplicación.
Después de aceptar la aplicación anterior aparecerá la siguiente interfaz:
226
2.4.PANTALLA PRINCIPAL
Está interfaz es la que posee todas las opciones que el sistema ofrece, entre ellas observamos a los editores de menú.
El primer editor se refiere a Datos y está dividido en 7 menús.
El primer menú se refiere a Materias y tiene como submenú a:
Registrar materia
Actualización de materias
227
El segundo menú se refiere a Profesores y tiene como submenú a:
Registrar Profesor
Actualización de Profesores
El tercer menú se refiere a Año de Educación Básica y tiene como submenú a:
Registrar Año
Actualización de Años
El cuarto menú se refiere a Estudiantes y tiene como submenú a:
Registrar Estudiante
Actualización de Estudiantes
El quinto menú se refiere a Matrículas y tiene como submenú a:
Registrar Matrícula
Actualización de Matriculas
El sexto menú se refiere a Ingreso de Notas.
El segundo editor se refiere a Ver y tiene como submenú a:
228
Barra de herramientas
Barra de estado
El tercer editor se refiere a Herramientas y está dividido en 2 menús.
El primer menú se refiere a Claves y tiene como submenú a:
Crear nueva clave
Modificar clave
Eliminar clave
El segundo menú se refiere a Configuración.
El cuarto editor es Reporte y está dividido en 10 menús
Mejores estudiantes del periodo
Lista de estudiantes por año básica
Notas del año básica por materia
Notas del estudiante por trimestre
Notas general del estudiante
Carnet del estudiante
Acta de matrículas
Certificado de matrícula
Certificado de conducta
229
Datos del profesor.
El cuarto editor tenemos Ayuda que tiene como menú acerca de…., muestra los datos del sistema operativo en el que se encuentra el sistema instalado.
2.5.INTERFAZ REGISTRAR MATERIA
Está interfaz sirve para ingresar el nombre de la materia asignada a la institución.
230
Primeramente damos un clic en el botón Nuevo y automáticamente se desbloquean los textos listos para ser llenados por el usuario, luego precedemos a dar clic en el botón Guardar para registrarlo al sistema, si el usuario no desea guardar dicha información puede hacer uso del botón Salir y cerrará automáticamente la interfaz.
2.6.INTERFAZ ACTUALIZACIÓN DE MATERIAS
Está interfaz sirve para mostrar los datos de las materias que han sido guardados al sistema.
Primeramente precedemos hacer clic en el combo de donde proviene el nombre de la Materia y seleccionamos lo deseado, una vez seleccionado podemos hacer uso del botón Modificar, se desbloqueará el texto de donde proviene el nombre de la materia y cambiar por lo deseado dando clic en Guardar, sino quiere puede hacer uso del botón Eliminar sino desea el dato en el sistema. El botón Salir permite cerrar la interfaz.
231
2.7.REGISTRAR PROFESOR
Está interfaz sirve para ingresar un nuevo profesor al sistema.
Primeramente precedemos hacer clic en el botón Nuevo y automáticamente se desbloquearan los textos listos para ser ingresado uno a uno los datos del empleado al sistema. Una vez digitado podemos hacer uso del botón Guardar y automáticamente se registrará en el sistema.
El botón Salir sirve para cerrar la interfaz actual.
232
2.8. INTERFAZ ACTUALIZACIÓN DE PROFESORES
Está interfaz sirve para actualizar datos del docente que esté actualmente registrado en el sistema.
Para modificar un dato existente o eliminarlo debemos hacer lo siguientes pasos de los cuales tenemos que primeramente seleccionar el nombre del empleado que está en el combo y automáticamente lo activa listo para ser modificado o eliminado por el usuario del sistema, si desea modificarlo cambia el dato dando clic en el botón Modificar y después presioné Guardar o por caso contrario presione Salir para cerrar la interfaz actual.
2.9.INTERFAZ REGISTRAR AÑO
Está interfaz sirve para ingresar el año junto con los profesores y las materias asignadas al sistema. 233
Primeramente presione el botón Nuevo, luego se desbloquearán los textos y digite el curso, luego haga uso de clic en las materias junto al profesor que va a dar la clase, presione el botón que señala hacia abajo y repita esto hasta que termine de asignar todas las materias que se va a registrar al grado actual y luego presione el botón Guardar o si no desea presione el botón Salir y saldrá de la interfaz actual.
2.10. INTERFAZ ACTUALIZACIÓN DE AÑO
Está interfaz sirve para buscar datos para ser modificado o eliminados del sistema, tanto como para el año y las materias asignadas junto al profesor de la clase.
234
Primeramente seleccionamos o buscamos el dato por año, luego de ver seleccionado se mostrarán los datos del profesor junto a la materia asignada, luego podemos hacer uso de el botón Modificar y automáticamente se desbloquearán los textos y están listo a ser modificado por el usuario, luego de haber modificado el año puede cambiar al profesor con las materias dando doble clic en el dato o en la materia y saldrá un cuadro de dialogo mostrando un mensaje que si desea eliminar el dato y automáticamente se eliminará del sistema o si desea cancelar ponga no.
Una vez realizado lo anterior, si desea eliminar el contenido del año, deberá seleccionar el año y hacer uso del botón Eliminar y automáticamente se eliminará los datos del año junto con los del profesor y materias asignadas de ese lectivo.
235
2.11. INTERFAZ REGISTRAR ESTUDIANTE
Está interfaz sirve para registrar datos nuevos diariamente durante los meses de matrícula del estudiante.
Para registrar un dato primero damos clic en el botón Nuevo, automáticamente se desbloquean los textos y están listos para llenar con los datos del estudiante a matricular, una vez lleno los textos procedemos a guardar la información y se bloquearán los textos listos para seguir ingresando más información realizando los pasos anteriormente.
Al momento de llenar los datos del estudiante y no quiere registrarlo al sistema de clic en el botón Salir para cerrar la interfaz actual.
236
2.12. INTERFAZ ACTUALIZACIÓN DE ESTUDIANTES
Está interfaz sirve para registrar los datos del estudiante que ya a sido registrado anteriormente por el usuario, de aquí procedemos a modificar dicho dato.
Primero de un clic en el botón Buscar seleccionando al estudiante que desea modificar o eliminar.
Una vez que seleccionó al estudiante si desea modificar el dato puede preceder a ser clic en el botón Modificar y automáticamente se desbloquean los textos y listo para cambiar lo deseado por el usuario del sistema, luego precedemos a ser clic en Guardar para registrarlo al sistema.
Si desea eliminar al estudiante, debe seleccionarlo y luego precedemos a dar clic en el botón Eliminar.
Nota: si el estudiante está actualmente matriculado y con notas no podrá eliminarlo del sistema pues tendrá que eliminar la matricula y de hay podemos eliminar los datos del estudiante.
237
2.13. INTERFAZ REGISTRAR MATRÍCULA
Está interfaz sirve para registrar datos del estudiante a matricularse.
Primeramente damos clic en el botón Nuevo y automáticamente se desbloquean los textos listos para llenar, una vez lleno los datos procedemos a dar clic en el botón Guardar, en caso contrario presione Salir y saldrá de la interfaz actual.
238
2.14. INTERFAZ ACTUALIZACIÓN DE MATRÍCULAS
Está interfaz sirve para modificar y eliminar datos de los estudiante que han sido matriculados en el sistema.
Primero procedemos a ser clic en el combo del los nombres de los estudiantes y automáticamente se muestran los datos del alumno seleccionado y listó a ser modificado o eliminado del sistema.
239
En el momento que los datos estรกn en pantalla y se desea eliminar alguna materia se deberรก dar doble clic en la fila en donde se encuentra el dato y saldrรก un mensaje diciendo que si desea eliminar pues el usuario del sistema deberรก seleccionar si o no en el caso de no querer borrar. El botรณn Salir permite cerrar la interfaz actual.
240
2.15. INTERFAZ INGRESO DE NOTAS
Está interfaz sirve para registrar las notas del estudiante.
Si queremos ingresar o modificar notas lo primero que debemos hacer es dar clic en el botón Nuevo, luego seleccionamos el año básico, el año lectivo, el nombre del estudiante, el parcial al que va el estudiante y precedemos hacer clic en el botón que tiene la flecha hacia abajo, se mostrarán celdas en blanco o con datos listo para ingresar las notas y si el estudiante ya tiene notas del parcial anterior se mostrarán todas las que tenga y damos clic en el botón guardar, en caso de no querer registrar las notas presione el botón Salir y automáticamente se cerrará la interfaz actual cancelando los datos actuales.
Nota: para cambiar una celda con notas debemos dar clic y presionar el botón del teclado (Suprimir) para borrar y cambiar la nota por otro.
241
2.16. INTERFAZ CREAR NUEVA CLAVE
Está interfaz sirve para crear la clave de entrada al sistema.
Primeramente se hace usó del botón Nuevo y automáticamente de desbloquean los textos listos a ser digitado por el usuario del sistema, una vez realizado lo anterior deberá ser usó del botón Guardar y automáticamente se registrará en el sistema y cuando cierre el sistema al iniciar de nuevo le pedirá digitar la clave junto al nombre del usuario encargado del sistema. Si no desea registrar la clave al sistema haga usó del botón Salir y se cerrará la interfaz actual.
242
2.17. INTERFAZ MODIFICAR CLAVE
Está interfaz sirve para modificar la clave del sistema la cual deberá estar registrado el usuario del sistema.
Primeramente debemos seleccionar el nombre del usuario, luego deberá hacer usó del botón Modificar y automáticamente se desbloquearán los textos listo a ser remplazado por otra clave, una vez realizado los cambios deberá seleccionar el botón Guardar para registrarlo como una clave al sistema o si no desea modificar dicho dato haga usó del botón Salir y se cerrará la interfaz actual.
243
2.18. INTERFAZ ELIMINAR CLAVE
Está interfaz sirve para eliminar el nombre del usuario y la contraseña del sistema actual.
Primeramente seleccionamos el nombre del usuario suscrito actualmente en el sistema y digite la clave, luego deberá hacer uso del botón Eliminar y automáticamente se eliminarán los datos del usuario junto con la clave del sistema, o sino desea eliminar dicho dato haga uso del botón Salir y se cerrará la interfaz actual del sistema.
244
2.19. FORMULARIO MEJORES ESTUDIANTES EN EL PERIODO
Está interfaz sirve para seleccionar a los mejores estudiantes del periodo junto con las notas.
Primeramente deberá seleccionar el año lectivo y hacer usó del botón Mostrar para dar con el reporte de los estudiantes en el periodo señalado o sino desea puede hacer usó del botón Salir para cerrar el formulario actual.
2.20. INTERFAZ LISTA DE ESTUDIANTES POR AÑO BÁSICA
Está interfaz sirve para mostrar el listado general de estudiantes, únicamente del año de básica y año lectivo.
Primeramente seleccionamos el año básico y el año lectivo, luego procedemos a seleccionar el botón Mostrar aparecerá el reporte listo para imprimir el contenido y sino desea mostrar los datos deberá hacer uso del botón Salir y se cerrará la interfaz actual.
245
2.21. INTERFAZ NOTAS DEL AÑO BASICO POR MATERIA
Está interfaz sirve para mostrar los nombres de los estudiantes, las notas del año básico por trimestre, materia, año lectivo.
Primeramente seleccionamos los datos anteriormente especificado y procedemos a dar clic en el botón Mostrar luego aparecerá el reporte con lo especificado listo a ser impreso por el usuario a cargo, y sino desea mostrar el reporte presione el botón Salir y se cerrará la interfaz actual.
246
2.22. INTERFAZ NOTAS DEL ESTUDIANTE POR TRIMESTRE
Está interfaz sirve para mostrar el año básico, año lectivo, nombre del estudiante y las materias del trimestre.
Primeramente seleccionamos los datos anteriormente especificados, luego procedemos hacer clic en el botón Mostrar y automáticamente se mostrarán los datos ya especificados anteriormente, y sino desea mostrar los datos del reporte seleccione el botón Salir para cerrar la interfaz actual.
2.23. INTERFAZ NOTAS GENERAL DEL ESTUDIANTE
Está interfaz sirve para mostrar los datos de notas del estudiante de los tres trimestres con sus respectivas materias y sus promedios generales.
Primeramente seleccionamos el año de básica, año lectivo, el estudiante para luego dar clic en el botón Mostrar y de está manera se mostrará la hoja de
247
reporte, en el caso de no querer mostrar los datos deberá dar clic en el botón Salir, para cerrar la interfaz actual.
2.24. INTERFAZ CARNET DEL ESTUDIANTE
Está interfaz sirve para mostrar el carnet de los estudiantes por año de básica y año lectivo.
Primeramente seleccionamos el año de básica y año lectivo para luego dar clic en el botón Mostrar y de está manera se mostrará la hoja de reporte, en el caso de no querer mostrar los datos deberá dar clic en el botón Salir, para cerrar la interfaz actual.
248
2.25. INTERFAZ ACTA DE MATRÍCULAS
Está interfaz sirve para mostrar el reporte de los estudiantes matriculados.
Primeramente seleccionamos el año lectivo para luego dar clic en el botón Mostrar y de está manera se mostrará la hoja de reporte, en el caso de no querer mostrar los datos deberá dar clic en el botón Salir, para cerrar la interfaz actual.
2.26. INTERFAZ CERTIFICADO DE MATRÍCULA
Está interfaz sirve para mostrar el reporte de los datos del certificado de matrícula del estudiante.
Primeramente seleccionamos el año básico, año lectivo y el nombre del estudiante para luego dar clic en el botón Mostrar y de está manera se mostrará la hoja de reporte, en el caso de no querer mostrar los datos deberá dar clic en el botón Salir, para cerrar la interfaz actual.
249
2.27. INTERFAZ CERTIFICADO DE CONDUCTA
Está interfaz sirve para mostrar el reporte de los datos del certificado de conducta del estudiante.
Primeramente seleccionamos el año básico, año lectivo y el nombre del estudiante para luego dar clic en el botón Mostrar y de está manera se mostrará la hoja de reporte, en el caso de no querer mostrar los datos deberá dar clic en el botón Salir, para cerrar la interfaz actual.
250
2.28. INTERFAZ CERTIFICADO DE CONDUCTA
Está interfaz sirve para mostrar el reporte de los datos del profesor y sus materias.
Primeramente seleccionamos el nombre del profesor y año lectivo para luego dar clic en el botón Mostrar y de está manera se mostrará la hoja de reporte, en el caso de no querer mostrar los datos deberá dar clic en el botón Cancelar, para cerrar la interfaz actual.
2.29. ACERCA DE…..
Este modulo sirve para mostrar los datos del computador, de aquí podemos ver el hardware del computador y otros datos del software apropiados.
251
252