Computerized Elementary Enrollment System
Submitted To: Mr. Jojo A. Lacanlale THEODBS Instructor
Submitted By: Earl Jomel Vitor Joshua Fontabla Ghescel Ungriano
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
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
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.
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
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
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
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
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),
-> );
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),
-> 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)
3.1 Database Structure 3.1.1 Navicat *tblAssessmentCash *tblAssessmentInstallment *tblElementaryLevel *tblSchoolYear *tblStudent
*tblAssessmentCash
*tblAssessmentInstallment
*tblElementaryLevel
*tblSchoolYear
* tblAssessmentCash
* tblAssessmentInstallment
* tblElementaryLevel
* tblSchoolYear
* 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?
* 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?
* 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?
* How many students are enrolled in the school year 2009-2010? mysql> SELECT * FROM tblStudent WHERE SchoolYear = '2009-2010';
4.1 Project Modules & Functionalities
* frmLogin
* frmMain
4.3 Source Code Module1.bas
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
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
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
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
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
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 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
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
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 & "','" &
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")
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"
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 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
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
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
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
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
.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")
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 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
.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
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 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
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
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
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()
Label25.Caption = "Date: " & Date End Sub