computerized elementary enrollment system

71
Computerized Elementary Enrollment System Submitted To: Mr. Jojo A. Lacanlale THEODBS Instructor Submitted By: Earl Jomel Vitor Joshua Fontabla Ghescel Ungriano

Upload: sheryl-florendo

Post on 30-Nov-2014

4.188 views

Category:

Documents


12 download

TRANSCRIPT

Page 1: Computerized Elementary Enrollment System

Computerized Elementary Enrollment System

Submitted To:

Mr. Jojo A. Lacanlale

THEODBS Instructor

Submitted By:

Earl Jomel Vitor

Joshua Fontabla

Ghescel Ungriano

Jeffrey Olivo

Page 2: Computerized Elementary Enrollment System

Table of Contents

ACKNOWLEDGEMENT

EXCLUSIVE SUMMARY

Phase 1: Database Model

1.1 Database Name

1.2 Entity-Relationship Diagram

Phase 2: Database Design

2.1 Database Normalization Process

2.2 Database Schema

2.3 MySQL Code

Phase 3: Database Population

3.1 Database Structure

3.1.1 Navicat

3.1.2 MS Access

3.2 Populated Tables

3.3 Queries & Resulting Tables

Phase 4: Final Project

4.1 Project Modules & Functionalities

4.2 Screen Design/Snapshot

4.3 Source Code

APPENDIXES

REFERENCES

Page 3: Computerized Elementary Enrollment System

ACKNOWLEDGEMENT

I want to thank to myself first because of hard-work and because of my computer is destroyed by a virus, I decide first to set my schedule for computer laboratory but unfortunately, the computer laboratory is closed because of pre-final examination, so I decide to rent the computer shop to my handsome friend and I install MySQL

temporary in that same computer shop, but I have only one problem in that time, I don’t have Navicat in my USB Flash Drive so I decide to finish the Phase 1, Phase 2,

and some Phase 3 first and after that, I will go to computer laboratory in 303 to finish all before the submission, and for now on, I have Phase 1 to Phase 3 at the time that I passed it my instructor but my only problem is the financial because I

have many expenses not only in this baby-thesis also that time I don’t have money but thanks to my new 3 cooperative members. They are Joshua Fontabla, Ghescel Ungriano and Jeffrey Olivo for helping me for financial aid and I whispered “EJ Vitor

can’t stand alone but can’t never alone anymore, I have new 3 member so that they can help me not only in financial aid but also they can help me to give me some tips and ideas about documentation and were do they best to finish all before the final

defense.”.

During the time of Typhoon Ondoy, I don’t have a time to do this, because of brownout, my family is under cleaning operation and me too and actually my

computer is still under repairing. Then after the Typhoon Pepeng is leaving from the country, I concentrate on encoding of Microsoft Visual Basic 6.0 to finish all and

before Sportsfest, I finished all of encoding including connecting to database in MY-SQL thanks to one of my classmate in BS301A that some of my classmates codes

are I really interested that I see of his codes and I put it to my system and thanks to my little brother whom he finished repairing the computer and Yes, my computer is

already repaired and I want to use again “Yehey!” .

During the time of Sportsfest, I can’t see my friends during that time, I decide to not go on Sportsfest anymore instead I call my 3 cooperative to finished and helping me

to finish at the rest of documentation.

Also, I want to thank also to my friend in my renting shop, my mom that she give a allowance to rent a shop, my future brother-in-law fellow programmer that he teach me how to connect the database in ADODB in other way and also my instructor, sir JAL who I learn about database, connect into database and programming language

especially in MySQL and Navicat.

Page 4: Computerized Elementary Enrollment System

EXCLUSIVE SUMMARY

Page 5: Computerized Elementary Enrollment System

Phase 1: Database Mode

1.1 Database Name (Enrollment System)

What is Enrollment System?

–noun

1.The act or process of enrolling.

2.The state of being enrolled.

3. The number of persons enrolled, as for a course or in a school.

What is the purpose of Enrollment System?

Answer: The Enrollment System is a system that you can enroll the student not once, not twice, 3 or more times that you can enroll the student to the school but it depend how student can affordable.

What is the used of Computerized Enrollment System and could you give me a short summary about Computerized Enrollment System?

Answer: Computerized enrollment system is now used by the universities, colleges and other establishments. Therefore, computerized enrollment system is very useful to both the firm and students because it rather give an effective and efficient approach for both the students and schools.

Page 6: Computerized Elementary Enrollment System

1.2 Entity-Relationship Diagram

Page 7: Computerized Elementary Enrollment System

Phase 2: Database Design

2.1 Database Normalization Process

2.1.1 1st Normal Form

StudentID(PK)

StudentNumber

Name

Gender

Age

Birthdate

Address

ParentGuardian

ContactNum

SchoolYear

ElementaryLevel

PaymentType

TuitionFee

DepartmentFee

MiscellaneousFee

Page 8: Computerized Elementary Enrollment System

2.1.2 2nd Normal Form

tblAssessment

AstCashID(PK)

TuitionFee

DepartmentFee

MiscellaneousFee

tblElementaryLevel

ElemLevelID(PK)

ElementaryLevel

tblSchoolYear

SYID(PK)

SchoolYear

tblStudent

StudentID(PK)

StudentNumber

LastName

FirstName

MI

Age

Gender

Birthdate

Address

ParentGuardian

ContactNum

SchoolYear

ElementaryLevel

PaymentType

Page 9: Computerized Elementary Enrollment System

2.1.3 3rd Normal Form

tblStudent

StudentID(PK)

StudentNumber

LastName

FirstName

MI

Age

Gender

Birthdate

Address

ParentGuardian

ContactNum

SchoolYear

ElementaryLevel

PaymentType

tblAssessment

AstCashID(PK)

TuitionFee

DepartmentFee

MiscellaneousFee

tblElementaryLevel

ElemLevelID(PK)

ElementaryLevel

tblSchoolYear

SYID(PK)

SchoolYear

tblAssessmentInstallment

AstInstallmentID(PK)

TuitionFee

DepartmentFee

MiscellaneousFee

Page 10: Computerized Elementary Enrollment System

2.2 Database Scheme

tblElementaryLevel(elemLevelID, elementaryLevel)

tblSchoolYear(syID, SchoolYear)

tblAssessmentCash(astCashID, tuitionFee, departmentFee, miscellaneousFee)

tblAssessmentInstallment(astInstallmentID, tuitionFee, departmentFee

miscellaneousFee)

tblStudent(studentID, studentNumber, lastName, firstName, MI, age, gender,

birthdate, address, parentGuardian, contactNum, schoolYear, elementaryLevel,

paymentType, elemLevelID, syID, astCashID, astInstallmentID)

FOREIGN KEY elemLevelID REFERENCES tblElementaryLevel

ON UPDATE CASCADE

FOREIGN KEY syID REFERENCES tblSchoolYear

ON UPDATE CASCADE

FOREIGN KEY astCashID REFERENCES tblAssessmentCash

ON DELETE RESTRICT

ON UPDATE CASCADE

FOREIGN KEY astInstallmentID REFERENCES tblAssessmentInstallment

ON DELETE RESTRICT

ON UPDATE CASCADE

Page 11: Computerized Elementary Enrollment System

2.3 MySQL Code

mysql> CREATE DATABASE Enrollment;

Query OK, 1 row affected (0.01 sec)

mysql> USE Enrollment;

Database changed

mysql> CREATE TABLE tblElementaryLevel

-> (

-> elemLevelID SMALLINT NOT NULL,

-> elementaryLevel VARCHAR(50),

-> CONSTRAINT PKtblElementaryLevel PRIMARY KEY (elemLevelID)

-> );

Query OK, 0 rows affected (0.05 sec)

mysql> CREATE TABLE tblSchoolYear

-> (

-> syID SMALLINT NOT NULL,

-> schoolYear VARCHAR(50),

-> CONSTRAINT PKtblSchoolYear PRIMARY KEY (syID)

-> );

Query OK, 0 rows affected (0.03 sec)

mysql> CREATE TABLE tblAssessmentCash

-> (

-> astCashID SMALLINT NOT NULL,

-> tuitionFee VARCHAR(50),

-> departmentFee VARCHAR(50),

Page 12: Computerized Elementary Enrollment System

-> miscFee VARCHAR(50),

-> CONSTRAINT PKtblAssessmentCash PRIMARY KEY (astCashID)

-> );

Query OK, 0 rows affected (0.02 sec)

mysql> CREATE TABLE tblAssessmentInstallment

-> (

-> astInstallmentID SMALLINT NOT NULL,

-> tuitionFee VARCHAR(50),

-> departmentFee VARCHAR(50),

-> miscFee VARCHAR(50),

-> CONSTRAINT PKtblAssessmentInstallment PRIMARY KEY (astInstallmentID)

-> );

Query OK, 0 rows affected (0.01 sec)

mysql> CREATE TABLE tblStudent

-> (

-> studentID SMALLINT NOT NULL,

-> studentNumber VARCHAR(50),

-> lastName VARCHAR(50),

-> firstName VARCHAR(50),

-> MI VARCHAR(50),

-> gender VARCHAR(50),

-> age VARCHAR(50),

-> birthdate VARCHAR(50),

-> address VARCHAR(225),

-> parentGuardian VARCHAR(50),

Page 13: Computerized Elementary Enrollment System

-> contactNum VARCHAR(50),

-> schoolYear VARCHAR(50),

-> elementaryLevel VARCHAR(50),

-> paymentType VARCHAR(50),

-> syID SMALLINT,

-> astCashID SMALLINT,

-> astInstallmentID SMALLINT,

-> elemLevelID SMALLINT,

-> CONSTRAINT PKtblStudent PRIMARY KEY (studentID),

-> CONSTRAINT FKsyID FOREIGN KEY (syID)

-> REFERENCES tblSchoolYear

-> ON UPDATE CASCADE,

-> CONSTRAINT FKelemLevelID FOREIGN KEY (elemLevelID)

-> REFERENCES tblElementaryLevel

-> ON UPDATE CASCADE,

-> CONSTRAINT FKastCashID FOREIGN KEY (astCashID)

-> REFERENCES tblAssessmentCash

-> ON UPDATE CASCADE,

-> CONSTRAINT FKastInstallmentID FOREIGN KEY (astInstallmentID)

-> REFERENCES tblAssessmentInstallment

-> ON UPDATE CASCADE

-> );

Query OK, 0 rows affected (0.00 sec)

Page 14: Computerized Elementary Enrollment System

Phase 3: Database Population

3.1 Database Structure

3.1.1 Navicat

*tblAssessmentCash

*tblAssessmentInstallment

*tblElementaryLevel

*tblSchoolYear

Page 15: Computerized Elementary Enrollment System

*tblStudent

Page 16: Computerized Elementary Enrollment System

3.1.2 MS Access

*tblAssessmentCash

*tblAssessmentInstallment

*tblElementaryLevel

Page 17: Computerized Elementary Enrollment System

*tblSchoolYear

*tblStudent

Page 18: Computerized Elementary Enrollment System

3.2 Populated Tables

* tblAssessmentCash

* tblAssessmentInstallment

* tblElementaryLevel

Page 19: Computerized Elementary Enrollment System

* tblSchoolYear

* tblStudent

Page 20: Computerized Elementary Enrollment System

3.3 Queries & Resulting Tables

* How many students are enrolled in Grade I?

mysql> SELECT * FROM tblStudent WHERE elementaryLevel = 'I';

* How many students are enrolled in Grade II?

mysql> SELECT * FROM tblStudent WHERE elementaryLevel = 'II';

Page 21: Computerized Elementary Enrollment System

* How many students are enrolled in Grade III?

mysql> SELECT * FROM tblStudent WHERE elementaryLevel = 'III';

* How many students are enrolled in Grade IV?

mysql> SELECT * FROM tblStudent WHERE elementaryLevel = 'IV';

Page 22: Computerized Elementary Enrollment System

* How many students are enrolled in Grade V?

mysql> SELECT * FROM tblStudent WHERE elementaryLevel = 'V';

* How many students are enrolled in Grade VI?

mysql> SELECT * FROM tblStudent WHERE elementaryLevel = 'VI';

* How many students is their payment type is Cash?

mysql> SELECT * FROM tblStudent WHERE PaymentType = 'Cash';

Page 23: Computerized Elementary Enrollment System

* How many students is their payment type is Installment?

mysql> SELECT * FROM tblStudent WHERE PaymentType = 'Installment';

* How many students are enrolled in the school year 2009-2010?

Page 24: Computerized Elementary Enrollment System

mysql> SELECT * FROM tblStudent WHERE SchoolYear = '2009-2010';

Page 25: Computerized Elementary Enrollment System

Phase 4: Final Project

4.1 Project Modules & Functionalities

Page 26: Computerized Elementary Enrollment System

4.2 Screen Design/Snapshot

* frmLogin

* frmMain

Page 27: Computerized Elementary Enrollment System

* frmElemInfo

Page 28: Computerized Elementary Enrollment System
Page 29: Computerized Elementary Enrollment System
Page 30: Computerized Elementary Enrollment System

* frmSYSettings

Page 31: Computerized Elementary Enrollment System

* frmaymentSettings

Page 32: Computerized Elementary Enrollment System

* frmAssessment

Page 33: Computerized Elementary Enrollment System

* frmPrintLayout

Page 34: Computerized Elementary Enrollment System

4.3 Source Code

Module1.bas

Page 35: Computerized Elementary Enrollment System

Option Explicit

Public Sub connection(ByRef dConnection As ADODB.connection, ByVal dLocation As String)

dConnection.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & dLocation & ";Persist Security Info=False;"

End Sub

Public Sub recordset(ByRef sRecordset As ADODB.recordset, ByRef sConnection As ADODB.connection, ByVal sSQL As String)

With sRecordset

.CursorLocation = adUseClient

.Open sSQL, sConnection, adOpenKeyset, adLockOptimistic

End With

End Sub

Sub main()

frmLogin.txtUser.Text = ""

frmLogin.txtPW.Text = ""

frmLogin.Show vbModal

End Sub"

frmMain.frm

Private Sub Form_Load()

Call main

End Sub

Private Sub paymentsets_Click()

Page 36: Computerized Elementary Enrollment System

frmPaymentSettings.Show vbModal

End Sub

Private Sub sysets_Click()

frmSYSettings.Show vbModal

End Sub

Private Sub close_Click()

End

End Sub

Private Sub eleminfo_Click()

frmElemInfo.Show vbModal

End Sub

> frmLogin.frm

Private Sub cmdExit_Click()

End

End Sub

Private Sub cmdLogin_Click()

Dim uid, pw As String

uid = "admin"

pw = "password"

If txtUser.Text = uid And txtPW.Text = pw Then

MsgBox "Login Successfully Granted!", vbInformation

Unload Me

Page 37: Computerized Elementary Enrollment System

Else

MsgBox "Invalid username or password!", vbExclamation

txtUser.Text = ""

txtPW.Text = ""

txtUser.SetFocus

End If

End Sub

Private Sub Form_Load()

cmdExit.Cancel = True

cmdLogin.Default = True

txtPW.PasswordChar = "*"

End Sub

> frmElemInfo.frm

Private Sub cmdAssessment_Click()

If ListView1.ListItems.Count < 1 Then MsgBox "No record found.", vbExclamation, "List of Students": Exit Sub

With frmAssessment

.txtStudID.Text = ListView1.SelectedItem

.txtStudNum.Text = ListView1.SelectedItem.SubItems(1)

.txtLastN.Text = ListView1.SelectedItem.SubItems(2)

.txtFirstN.Text = ListView1.SelectedItem.SubItems(3)

.txtMI.Text = ListView1.SelectedItem.SubItems(4)

.txtGender.Text = ListView1.SelectedItem.SubItems(5)

.txtSY.Text = ListView1.SelectedItem.SubItems(11)

.txtElemLevel.Text = ListView1.SelectedItem.SubItems(12)

.Show vbModal

Page 38: Computerized Elementary Enrollment System

End With

End Sub

Private Sub cmdDelete_Click()

Dim cndelete As New ADODB.connection

Dim rsdelete As New ADODB.recordset

Dim condition As String

If ListView1.ListItems.Count < 1 Then MsgBox "No record found.", vbExclamation, "List of Students": Exit Sub

condition = MsgBox("Are you sure you want to delete: " & "'" & ListView1.SelectedItem.SubItems(2) & ", " & ListView1.SelectedItem.SubItems(3) & " " & ListView1.SelectedItem.SubItems(4) & "'" & "?", vbYesNo, "Confirm Delete")

If condition = vbNo Then

Exit Sub

Else

Call connection(cndelete, App.Path & "\Database.mdb")

Call recordset(rsdelete, cndelete, "SELECT * FROM tblStudent WHERE studentID = " & ListView1.SelectedItem & "")

With rsdelete

.Delete

End With

End If

MsgBox "The Selected Student is successful deleted from the list of students", vbExclamation

Call viewStudent

Set cndelete = Nothing

Set rsdelete = Nothing

End Sub

Page 39: Computerized Elementary Enrollment System

Private Sub cmdEdit_Click()

If ListView1.ListItems.Count < 1 Then MsgBox "No record found.", vbExclamation, "List of Students": Exit Sub

With frmEditStudent

.txtStudID.Text = ListView1.SelectedItem

.txtStudNum.Text = ListView1.SelectedItem.SubItems(1)

.txtLastN.Text = ListView1.SelectedItem.SubItems(2)

.txtFirstN.Text = ListView1.SelectedItem.SubItems(3)

.txtMI.Text = ListView1.SelectedItem.SubItems(4)

.cmbGender.Text = ListView1.SelectedItem.SubItems(5)

.txtAge.Text = ListView1.SelectedItem.SubItems(6)

.txtBdate.Text = ListView1.SelectedItem.SubItems(7)

.txtAddress.Text = ListView1.SelectedItem.SubItems(8)

.txtPG.Text = ListView1.SelectedItem.SubItems(9)

.txtContactNum.Text = ListView1.SelectedItem.SubItems(10)

.comboSY.Text = ListView1.SelectedItem.SubItems(11)

.comboElem.Text = ListView1.SelectedItem.SubItems(12)

.comboPT.Text = ListView1.SelectedItem.SubItems(13)

.Show vbModal

End With

End Sub

Private Sub cmdNew_Click()

frmNewStudent.Show vbModal

End Sub

Page 40: Computerized Elementary Enrollment System

Private Sub comboLevel_Click()

Call viewStudent

End Sub

Private Sub comboSY_Click()

comboLevel.Enabled = True

If ListView1.Visible = True Then

Call comboLevel_Click

End If

End Sub

Private Sub Form_Load()

Call viewSY

Call viewLevel

Call viewStudent

ListView1.Visible = False

comboLevel.Enabled = False

cmdAssessment.Enabled = False

cmdEdit.Enabled = False

cmdDelete.Enabled = False

ListView1.ColumnHeaders.Item(1).Width = "0"

End Sub

Public Sub viewLevel()

Dim cncmblevel As New ADODB.connection

Dim rscmblevel As New ADODB.recordset

Call connection(cncmblevel, App.Path & "\Database.mdb")

Page 41: Computerized Elementary Enrollment System

Call recordset(rscmblevel, cncmblevel, "SELECT * FROM tblElementaryLevel ORDER BY elementaryLevel ASC")

Do Until rscmblevel.EOF

comboLevel.AddItem rscmblevel!elementarylevel

rscmblevel.MoveNext

Loop

Set cncmblevel = Nothing

Set rscmblevel = Nothing

End Sub

Public Sub viewSY()

Dim cncmbsy As New ADODB.connection

Dim rscmbsy As New ADODB.recordset

Call connection(cncmbsy, App.Path & "\Database.mdb")

Call recordset(rscmbsy, cncmbsy, "SELECT * FROM tblSchoolYear ORDER BY schoolYear ASC")

Do Until rscmbsy.EOF

comboSY.AddItem rscmbsy!schoolYear

rscmbsy.MoveNext

Loop

Set cncmbsy = Nothing

Set rscmbsy = Nothing

End Sub

Public Sub viewStudent()

Dim cnStud As New ADODB.connection

Dim rsStud As New ADODB.recordset

Page 42: Computerized Elementary Enrollment System

ListView1.Visible = True

Call connection(cnStud, App.Path & "\Database.mdb")

Call recordset(rsStud, cnStud, "SELECT * FROM tblStudent WHERE schoolYear = '" & comboSY.Text & "' AND elementaryLevel = '" & comboLevel.Text & "' ORDER BY studentnumber ASC")

Dim X

ListView1.ListItems.Clear

With rsStud

While Not .EOF

Set X = ListView1.ListItems.Add(, , .Fields!studentid)

X.SubItems(1) = .Fields!studentnumber

X.SubItems(2) = .Fields!lastname

X.SubItems(3) = .Fields!firstname

X.SubItems(4) = .Fields!mi

X.SubItems(5) = .Fields!gender

X.SubItems(6) = .Fields!age

X.SubItems(7) = .Fields!birthdate

X.SubItems(8) = .Fields!address

X.SubItems(9) = .Fields!parentguardian

X.SubItems(10) = .Fields!contactnum

X.SubItems(11) = .Fields!schoolYear

X.SubItems(12) = .Fields!elementarylevel

X.SubItems(13) = .Fields!paymenttype

.MoveNext

Wend

End With

cmdAssessment.Enabled = True

Page 43: Computerized Elementary Enrollment System

cmdEdit.Enabled = True

cmdDelete.Enabled = True

'ListView1.ListItems.Item(1).Width = "0"

Set cnStud = Nothing

Set rsStud = Nothing

Dim cnCount As New ADODB.connection

Dim rsCount As New ADODB.recordset

Call connection(cnCount, App.Path & "\Database.mdb")

Call recordset(rsCount, cnCount, "SELECT COUNT(studentid) as sumstudent FROM tblStudent WHERE elementaryLevel = '" & comboLevel.Text & "'")

lblcountstud.Caption = rsCount!sumstudent

Set cnCount = Nothing

Set rsCount = Nothing

Exit Sub

End Sub

> frmNewStudent.frm

Private Sub cmdSave_Click()

Dim cnaddnew As New ADODB.connection

Dim rsaddnew As New ADODB.recordset

If txtStudNum.Text <> "" And txtLastN.Text <> "" And txtFirstN.Text <> "" And txtMI.Text <> "" And cmbGender.Text <> "" And txtAge.Text <> "" And txtBdate.Text <> "" And txtAddress.Text <> "" And txtPG.Text <> "" And txtContactNum.Text <> "" And comboPT.Text <> "" And comboElem.Text <> "" And comboPT.Text <> "" And comboSY.Text <> "" Then

Call connection(cnaddnew, App.Path & "\Database.mdb")

Call recordset(rsaddnew, cnaddnew, "INSERY INTO tblStudent (studentnumber,lastname,firstname,mi,gender,age,birthdate,address,parentguardian,contactnum,paymentType,elementaryLevel,schoolYear) VALUES ('" & txtStudNum.Text & "','" & txtLastN.Text & "','" & txtFirstN.Text & "','" & txtMI.Text & "','" & cmbGender.Text & "','" & txtAge.Text & "','" &

Page 44: Computerized Elementary Enrollment System

txtBdate.Text & "','" & txtAddress.Text & "','" & txtPG.Text & "','" & txtContactNum.Text & "','" & comboPT.Text & "','" & comboElem.Text & "','" & comboSY.Text & "');")

MsgBox txtLastN.Text & ", " & txtFirstN.Text & " " & txtMI.Text & " is successful added to your database!", vbInformation

Unload Me

Else

MsgBox "All fields are required!", vbExclamation

End If

Set cnaddnew = Nothing

Set rsaddnew = Nothing

End Sub

Private Sub Form_Load()

Call viewLevel

Call viewSY

Call cleared

Call setnum

Call tabindexes

End Sub

Public Sub setnum()

Dim cnsetnum As New ADODB.connection

Dim rssetnum As New ADODB.recordset

Dim idno As Integer

Call connection(cnsetnum, App.Path & "\Database.mdb")

Call recordset(rssetnum, cnsetnum, "SELECT * FROM tblStudent")

Page 45: Computerized Elementary Enrollment System

If rssetnum.RecordCount = 0 Then

idno = 1

Else

rssetnum.MoveLast

idno = rssetnum.Fields("studentid") + 1

End If

txtStudNum.Text = Format(Now(), "yyyy-") & Format(idno, "000")

End Sub

Public Sub cleared()

txtStudNum.Enabled = False

txtStudID.Enabled = False

txtStudID.Text = ""

txtStudNum.Text = ""

txtLastN.Text = ""

txtFirstN.Text = ""

txtMI.Text = ""

txtAge.Text = ""

txtBdate.Text = ""

txtAddress.Text = ""

txtPG.Text = ""

txtContactNum.Text = ""

comboPT.AddItem "Cash"

comboPT.AddItem "Installment"

cmbGender.AddItem "Male"

cmbGender.AddItem "Female"

Page 46: Computerized Elementary Enrollment System

End Sub

Public Sub viewLevel()

Dim cncmblevel As New ADODB.connection

Dim rscmblevel As New ADODB.recordset

Call connection(cncmblevel, App.Path & "\Database.mdb")

Call recordset(rscmblevel, cncmblevel, "SELECT * FROM tblElementaryLevel ORDER BY elementaryLevel ASC")

Do Until rscmblevel.EOF

comboElem.AddItem rscmblevel!elementarylevel

rscmblevel.MoveNext

Loop

Set cncmblevel = Nothing

Set rscmblevel = Nothing

End Sub

Public Sub viewSY()

Dim cncmbsy As New ADODB.connection

Dim rscmbsy As New ADODB.recordset

Call connection(cncmbsy, App.Path & "\Database.mdb")

Call recordset(rscmbsy, cncmbsy, "SELECT * FROM tblSchoolYear ORDER BY schoolYear ASC")

Do Until rscmbsy.EOF

comboSY.AddItem rscmbsy!schoolYear

rscmbsy.MoveNext

Loop

Set cncmbsy = Nothing

Page 47: Computerized Elementary Enrollment System

Set rscmbsy = Nothing

End Sub

Public Sub tabindexes()

txtLastN.TabIndex = 1

txtFirstN.TabIndex = 2

txtMI.TabIndex = 3

cmbGender.TabIndex = 4

txtAge.TabIndex = 5

txtBdate.TabIndex = 6

txtAddress.TabIndex = 7

txtPG.TabIndex = 8

txtContactNum.TabIndex = 9

comboSY.TabIndex = 10

comboElem.TabIndex = 11

comboPT.TabIndex = 12

cmdSave.TabIndex = 13

txtStudNum.TabStop = False

txtStudID.TabStop = False

End Sub

> frmEditStudent.frm

Private Sub cmdSave_Click()

Dim cnupdate As New ADODB.connection

Dim rsupdate As New ADODB.recordset

If txtStudNum.Text <> "" And txtLastN.Text <> "" And txtFirstN.Text <> "" And txtMI.Text <> "" And cmbGender.Text <> "" And txtAge.Text <> "" And txtBdate.Text <> "" And txtAddress.Text <> "" And txtPG.Text <> "" And

Page 48: Computerized Elementary Enrollment System

txtContactNum.Text <> "" And comboPT.Text <> "" And comboElem.Text <> "" And comboPT.Text <> "" And comboSY.Text <> "" Then

Call connection(cnupdate, App.Path & "\Database.mdb")

Call recordset(rsupdate, cnupdate, "UPDATE tblStudent SET studentnumber = '" & txtStudNum.Text & "', lastname = '" & txtLastN.Text & "', firstname = '" & txtFirstN.Text & "', mi = '" & txtMI.Text & "', gender = '" & cmbGender.Text & "', age = '" & txtAge.Text & "', birthdate = '" & txtBdate.Text & "', address = '" & txtAddress.Text & "', parentguardian = '" & txtPG.Text & "', contactnum = '" & txtContactNum.Text & "', schoolyear = '" & comboSY.Text & "', elementarylevel = '" & comboElem.Text & "', paymenttype = '" & comboPT.Text & "'" & _

"WHERE studentid = " & txtStudID.Text & "")

MsgBox txtLastN.Text & ", " & txtFirstN.Text & " " & txtMI.Text & " is successful modified from your database!", vbInformation

Unload Me

Else

MsgBox "All fields are required!", vbExclamation

End If

Set cnupdate = Nothing

Set rsupdate = Nothing

End Sub

Private Sub Form_Load()

Call viewLevel

Call viewSY

Call cleared

Call tabindexes

End Sub

Public Sub cleared()

Page 49: Computerized Elementary Enrollment System

txtStudID.Enabled = False

txtStudNum.Enabled = False

txtStudID.Text = ""

txtLastN.Text = ""

txtFirstN.Text = ""

txtMI.Text = ""

txtAge.Text = ""

txtBdate.Text = ""

txtAddress.Text = ""

txtPG.Text = ""

txtContactNum.Text = ""

comboPT.AddItem "Cash"

comboPT.AddItem "Installment"

cmbGender.AddItem "Male"

cmbGender.AddItem "Female"

End Sub

Public Sub viewLevel()

Dim cncmblevel As New ADODB.connection

Dim rscmblevel As New ADODB.recordset

Call connection(cncmblevel, App.Path & "\Database.mdb")

Call recordset(rscmblevel, cncmblevel, "SELECT * FROM tblElementaryLevel ORDER BY elementaryLevel ASC")

Do Until rscmblevel.EOF

comboElem.AddItem rscmblevel!elementarylevel

rscmblevel.MoveNext

Loop

Page 50: Computerized Elementary Enrollment System

Set cncmblevel = Nothing

Set rscmblevel = Nothing

End Sub

Public Sub viewSY()

Dim cncmbsy As New ADODB.connection

Dim rscmbsy As New ADODB.recordset

Call connection(cncmbsy, App.Path & "\Database.mdb")

Call recordset(rscmbsy, cncmbsy, "SELECT * FROM tblSchoolYear ORDER BY schoolYear ASC")

Do Until rscmbsy.EOF

comboSY.AddItem rscmbsy!schoolYear

rscmbsy.MoveNext

Loop

Set cncmbsy = Nothing

Set rscmbsy = Nothing

End Sub

Public Sub tabindexes()

txtLastN.TabIndex = 2

txtFirstN.TabIndex = 3

txtMI.TabIndex = 4

cmbGender.TabIndex = 5

txtAge.TabIndex = 6

txtBdate.TabIndex = 7

txtAddress.TabIndex = 8

txtPG.TabIndex = 9

Page 51: Computerized Elementary Enrollment System

txtContactNum.TabIndex = 10

comboSY.TabIndex = 11

comboElem.TabIndex = 12

comboPT.TabIndex = 13

cmdSave.TabIndex = 14

txtStudID.TabStop = False

txtStudNum.TabStop = False

End Sub

> frmAssessment.frm

Private Sub cmbPT_Click()

Call paymenttype

txtTotal.Text = Val(txtTFee.Text) + Val(txtDFee.Text) + Val(txtMFee.Text)

End Sub

Private Sub cmdCancel_Click()

Unload Me

End Sub

Private Sub cmdPrintShow_Click()

With frmPrintLayout

.Label3.Caption = txtLastN.Text

.Label5.Caption = txtFirstN.Text

.Label7.Caption = txtMI.Text

.Label9.Caption = txtStudNum.Text

.Label11.Caption = txtGender.Text

.Label13.Caption = txtSY.Text

Page 52: Computerized Elementary Enrollment System

.Label15.Caption = txtElemLevel.Text

.Label17.Caption = cmbPT.Text

.Label19.Caption = txtTFee.Text

.Label21.Caption = txtDFee.Text

.Label23.Caption = txtMFee.Text

.Label26.Caption = "Total: " & txtTotal.Text

.Show vbModal

End With

End Sub

Private Sub Form_Load()

Call cleared

cmbPT.AddItem "Cash"

cmbPT.AddItem "Installment"

Call paymenttype

txtTotal.Text = Val(txtTFee.Text) + Val(txtDFee.Text) + Val(txtMFee.Text)

End Sub

Public Sub paymenttype()

Dim cnCash As New ADODB.connection

Dim cnInst As New ADODB.connection

Dim rsCash As New ADODB.recordset

Dim rsInst As New ADODB.recordset

If cmbPT.Text = "Cash" Then

Call connection(cnCash, App.Path & "\Database.mdb")

Call recordset(rsCash, cnCash, "SELECT * FROM tblAssessmentCash")

Page 53: Computerized Elementary Enrollment System

txtCashID.Text = rsCash!astCashID

txtTFee.Text = rsCash!tuitionfee

txtDFee.Text = rsCash!departmentfee

txtMFee.Text = rsCash!miscfee

Set cnCash = Nothing

Set rsCash = Nothing

ElseIf cmbPT.Text = "Installment" Then

Call connection(cnInst, App.Path & "\Database.mdb")

Call recordset(rsInst, cnInst, "SELECT * FROM tblAssessmentInstallment")

txtInstID.Text = rsInst!astInstallmentID

txtTFee.Text = rsInst!tuitionfee

txtDFee.Text = rsInst!departmentfee

txtMFee.Text = rsInst!miscfee

Set cnInst = Nothing

Set rsInst = Nothing

End If

End Sub

Public Sub cleared()

txtTFee.Text = ""

txtDFee.Text = ""

txtMFee.Text = ""

End Sub

frmSYSettings

Private Sub cmdDelete_Click()

Dim cndelete As New ADODB.connection

Page 54: Computerized Elementary Enrollment System

Dim rsdelete As New ADODB.recordset

Dim condition As String

If ListView1.ListItems.Count < 1 Then MsgBox "No record found.", vbExclamation, "List of Students": Exit Sub

condition = MsgBox("Are you sure you want to delete: " & ListView1.SelectedItem.SubItems(1) & "?", vbYesNo, "Confirm Delete")

If condition = vbNo Then

Exit Sub

Else

Call connection(cndelete, App.Path & "\Database.mdb")

Call recordset(rsdelete, cndelete, "SELECT * FROM tblSchoolYear WHERE syID=" & ListView1.SelectedItem & "")

With rsdelete

.Delete

End With

End If

MsgBox "The Selected School Year is successful deleted from the your database!", vbExclamation

Call dataload

Set cndelete = Nothing

Set rsdelete = Nothing

End Sub

Private Sub cmdEdit_Click()

If ListView1.ListItems.Count < 1 Then MsgBox "No record found.", vbExclamation, "List of Students": Exit Sub

With frmEditSY

.txtSYID.Text = ListView1.SelectedItem

Page 55: Computerized Elementary Enrollment System

.txtSY.Text = ListView1.SelectedItem.SubItems(1)

.Show vbModal

End With

End Sub

Private Sub cmdNew_Click()

frmNewSY.Show vbModal

End Sub

Private Sub Form_Load()

Call dataload

End Sub

Public Sub dataload()

Dim cnSY As New ADODB.connection

Dim rsSY As New ADODB.recordset

Dim X

Call connection(cnSY, App.Path & "\Database.mdb")

Call recordset(rsSY, cnSY, "SELECT * FROM tblSchoolYear")

ListView1.ListItems.Clear

With rsSY

While Not .EOF

Set X = ListView1.ListItems.Add(, , .Fields!syID)

X.SubItems(1) = .Fields!schoolYear

.MoveNext

Wend

Page 56: Computerized Elementary Enrollment System

End With

Set rsSY = Nothing

End Sub

frmNewSY.frm

Private Sub cmdSave_Click()

Dim cnaddnew As New ADODB.connection

Dim rsaddnew As New ADODB.recordset

If txtSY.Text <> "" Then

Call connection(cnaddnew, App.Path & "\Database.mdb")

Call recordset(rsaddnew, cnaddnew, "INSERT INTO tblSchoolYear(schoolYear) VALUES ('" & txtSY.Text & "');")

MsgBox "This school year is successful created to your database!", vbInformation

Unload Me

Unload frmSYSettings

frmSYSettings.Show vbModal

Else

MsgBox "All fields required", vbExclamation

End If

End Sub

frmEditSY.frm

Private Sub cmdSave_Click()

Dim cnupdate As New ADODB.connection

Dim rsupdate As New ADODB.recordset

If txtSY.Text <> "" Then

Call connection(cnupdate, App.Path & "\Database.mdb")

Page 57: Computerized Elementary Enrollment System

Call recordset(rsupdate, cnupdate, "UPDATE tblSchoolYear SET schoolYear='" & txtSY.Text & "'" & _

"WHERE syid=" & txtSYID.Text & "")

Unload Me

frmSYSettings.dataload

MsgBox "The selected school year is successful modified!", vbInformation

Else

MsgBox "That field are required!", vbExclamation

End If

Set cnupdate = Nothing

Set rsupdate = Nothing

End Sub

frmPaymentSettings.frm

Private Sub cmdCashSave_Click()

Dim cnupdate As New ADODB.connection

Dim rsupdate As New ADODB.recordset

If txtCashTFee.Text <> "" And txtCashDFee.Text <> "" And txtCashMFee.Text <> "" Then

Call connection(cnupdate, App.Path & "\Database.mdb")

Call recordset(rsupdate, cnupdate, "UPDATE tblAssessmentCash SET tuitionfee = '" & txtCashTFee.Text & "', departmentfee = '" & txtCashDFee.Text & "', miscfee = '" & txtCashMFee.Text & "'" & _

"WHERE astCashID = " & txtCashID.Text & "")

MsgBox "Cash is successful modified from your database!", vbInformation

Unload Me

frmPaymentSettings.Show vbModal

Else

MsgBox "All fields are required!", vbExclamation

Page 58: Computerized Elementary Enrollment System

End If

Set cnupdate = Nothing

Set rsupdate = Nothing

End Sub

Private Sub cmdInstSave_Click()

Dim cnupdate As New ADODB.connection

Dim rsupdate As New ADODB.recordset

If txtInstTFee.Text <> "" And txtInstDFee.Text <> "" And txtInstMFee.Text <> "" Then

Call connection(cnupdate, App.Path & "\Database.mdb")

Call recordset(rsupdate, cnupdate, "UPDATE tblAssessmentInstallment SET tuitionFee = '" & txtInstTFee.Text & "', departmentFee = '" & txtInstDFee.Text & "', miscFee = '" & txtInstMFee.Text & "'" & _

"WHERE astInstallmentID = " & txtInstID.Text & "")

MsgBox "Installment is successful modified from your database!", vbInformation

Unload Me

frmPaymentSettings.Show vbModal

Else

MsgBox "All fields are required!", vbExclamation

End If

Set cnupdate = Nothing

Set rsupdate = Nothing

End Sub

Private Sub Form_Load()

Call cleared

Page 59: Computerized Elementary Enrollment System

Call cash

Call installment

End Sub

Public Function cleared()

txtCashTFee.Text = ""

txtCashDFee.Text = ""

txtCashMFee.Text = ""

txtInstTFee.Text = ""

txtInstDFee.Text = ""

txtInstMFee.Text = ""

End Function

Public Sub cash()

Dim cnCash As New ADODB.connection

Dim rsCash As New ADODB.recordset

Call connection(cnCash, App.Path & "\Database.mdb")

Call recordset(rsCash, cnCash, "SELECT * FROM tblAssessmentCash")

txtCashID.Text = rsCash!astCashID

txtCashTFee.Text = rsCash!tuitionfee

txtCashDFee.Text = rsCash!departmentfee

txtCashMFee.Text = rsCash!miscfee

Set cnCash = Nothing

Set rsCash = Nothing

End Sub

Page 60: Computerized Elementary Enrollment System

Public Sub installment()

Dim cnInst As New ADODB.connection

Dim rsInst As New ADODB.recordset

Call connection(cnInst, App.Path & "\Database.mdb")

Call recordset(rsInst, cnInst, "SELECT * FROM tblAssessmentInstallment")

txtInstID.Text = rsInst!astInstallmentID

txtInstTFee.Text = rsInst!tuitionfee

txtInstDFee.Text = rsInst!departmentfee

txtInstMFee.Text = rsInst!miscfee

Set cnInst = Nothing

Set rsInst = Nothing

End Sub

frmPrintLayut.frm

Private Sub Command1_Click()

Command1.Visible = False

Command2.Visible = False

frmPrintLayout.PrintForm

Unload Me

End Sub

Private Sub Command2_Click()

Unload Me

End Sub

Private Sub Form_Load()

Label24.Caption = "As of " & Time

Page 61: Computerized Elementary Enrollment System

Label25.Caption = "Date: " & Date

End Sub

APPENDIXES

Page 62: Computerized Elementary Enrollment System

REFERENCES

Page 63: Computerized Elementary Enrollment System