• No results found

Computerized Elementary Enrollment System

N/A
N/A
Protected

Academic year: 2021

Share "Computerized Elementary Enrollment System"

Copied!
62
0
0

Loading.... (view fulltext now)

Full text

(1)

Computerized Elementary Enrollment System

Submitted To: Mr. Jojo A. Lacanlale THEODBS Instructor

Submitted By: Earl Jomel Vitor Joshua Fontabla Ghescel Ungriano

(2)

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

(3)

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

(4)
(5)

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.

(6)
(7)

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 2.1.2 2nd Normal Form

(8)

2.1.3 3rd Normal Form tblAssessment AstCashID(PK) TuitionFee DepartmentFee MiscellaneousFee tblElementaryLev el ElemLevelID(PK) ElementaryLevel tblSchoolYear SYID(PK) SchoolYear tblStudent StudentID(PK) StudentNumber LastName FirstName MI Age Gender Birthdate Address ParentGuardian ContactNum SchoolYear ElementaryLevel PaymentType tblStudent StudentID(PK) StudentNumber LastName FirstName MI Age Gender Birthdate Address ParentGuardian ContactNum SchoolYear ElementaryLevel PaymentType

(9)

2.2 Database Scheme tblAssessment AstCashID(PK) TuitionFee DepartmentFee MiscellaneousFee tblElementaryLev el ElemLevelID(PK) ElementaryLevel tblSchoolYear SYID(PK) SchoolYear tblAssessmentInstallme nt AstInstallmentID(PK) TuitionFee DepartmentFee MiscellaneousFee

(10)

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

(11)

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), -> miscFee VARCHAR(50),

(12)

-> );

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), -> contactNum VARCHAR(50), -> schoolYear VARCHAR(50),

(13)

-> 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)

(14)

3.1 Database Structure 3.1.1 Navicat *tblAssessmentCash *tblAssessmentInstallment *tblElementaryLevel *tblSchoolYear *tblStudent

(15)
(16)

*tblAssessmentCash

*tblAssessmentInstallment

*tblElementaryLevel

*tblSchoolYear

(17)
(18)

* tblAssessmentCash

* tblAssessmentInstallment

* tblElementaryLevel

* tblSchoolYear

(19)
(20)

* 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';

* How many students are enrolled in Grade III?

(21)

* How many students are enrolled in Grade IV?

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

* How many students are enrolled in Grade V?

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

* How many students are enrolled in Grade VI?

(22)

* How many students is their payment type is Cash?

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

* How many students is their payment type is Installment?

(23)

* How many students are enrolled in the school year 2009-2010? mysql> SELECT * FROM tblStudent WHERE SchoolYear = '2009-2010';

(24)
(25)

4.1 Project Modules & Functionalities

(26)

* frmLogin

* frmMain

(27)
(28)
(29)
(30)
(31)
(32)
(33)

4.3 Source CodeModule1.bas

(34)

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

(35)

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

(36)

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

(37)

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

(38)

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

(39)

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

(40)

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

(41)

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

(42)

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,parentg uardian,contactnum,paymentType,elementaryLevel,schoolYear) VALUES ('" & txtStudNum.Text & "','" & txtLastN.Text & "','" & txtFirstN.Text & "','" & txtMI.Text & "','" & cmbGender.Text & "','" & txtAge.Text & "','" &

(43)

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")

(44)

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"

(45)

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

(46)

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

(47)

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

(48)

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

(49)

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

(50)

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

(51)

.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")

(52)

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()

(53)

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

(54)

.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

(55)

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

(56)

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

(57)

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

(58)

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

(59)

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()

(60)

Label25.Caption = "Date: " & Date End Sub

(61)
(62)

References

Related documents

Zarathushtra asked Ahura Mazda: O righteous Ahura Mazda, most beneficent Spirit, Creator of the material world.. When does the Nasu Druj fly upon the

All agencies should consider using social media to help adoption recruitment, providing training for agency staff in appropriate and responsible social media use.. Take care to

Using strong defining hyperplanes, we characterized the stability region preserving returns to scale and efficiency classifications. Namely, after changing the DMU

(It should be noted that such approaches to teaching often arise when the course is being taught in relation to a particular con- cern, such as forestry or land management.) In

Production in Iowa - 2011 File A1-20 T he estimated costs of corn, corn silage, soybeans,.. alfalfa, and pasture maintenance in this report are based on data from

In the past three years, all types of real estate properties have been securitized —leased office build- ings, corporate headquarter buildings, department stores, shopping

Check Point, AlertAdvisor, Application Intelligence, Check Point 2200, Check Point 4000 Appliances, Check Point 4200, Check Point 4600, Check Point 4800, Check Point 12000