Top Banner
ISABELA STATE UNIVERSITY Cauayan Campus Cauayan City, Isabela COLLEGE OF COMPUTING AND INFORMATION TECHNOLOGY RELEVANT SOURCE CODE Bachelor of Science in Information TechnologyPage 1
96

Relevant Source Code

Dec 16, 2015

Download

Documents

Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript

ISABELA STATE UNIVERSITYCauayan CampusCauayan City, Isabela

COLLEGE OF COMPUTING AND INFORMATION TECHNOLOGY

RELEVANT SOURCE CODE

APPENDIX I

RELEVANT SOURCE CODERSC

Project Name:

A SMS-Based Student Account Monitoring System

System Code:TTSAuthors:Socrates C. AriolaPaulo I. GuillermoPaul John S. Solomon

Sub-System:Sub-Sytem Code:Date: September 2014Page1 of 74

Log in form

Private Sub cmdcancel_Click()Unload MeEnd Sub

Private Sub cmdok_Click()Connect

sql = "select * from tblusers where userid='" & LCase(txtuserid.Text) & "'"

Set rs = New ADODB.Recordsetrs.Open sql, con, adOpenDynamic, adLockOptimistic

If rs.RecordCount = 0 Then MsgBox "User ID not found!", vbInformation, "System" txtuserid.SetFocus txtuserid.Text = "" txtpassword.Text = ""ElseIf rs.RecordCount = 1 And rs.Fields!Password LCase(txtpassword.Text) Then MsgBox "Password Incorect!", vbInformation, "System" txtpassword.SetFocus txtpassword.Text = ""Else With mainform.StatusBar1 .Panels(1).Text = rs.Fields!longname End With Connect Set rs = Nothing rs.Open "select * from tblusers where userid='" & LCase(txtuserid.Text) & "'", con, adOpenDynamic, adLockOptimistic If rs.Fields!usertype = "Admin" Then mainform.mnusetupandconfiguration.Enabled = True Else mainform.mnusetupandconfiguration.Enabled = False End If Unload Me splashform.ShowEnd If

End Sub

Private Sub Timer1_Timer()loginform.Caption = "Log on @ " & "[" & Format(Now) & "]"End Sub

Private Sub txtpassword_GotFocus()txtpassword.BackColor = &H80FFFFEnd Sub

Private Sub txtpassword_KeyPress(KeyAscii As Integer)If KeyAscii = 13 Then Call cmdok_ClickEnd Sub

Private Sub txtpassword_LostFocus()txtpassword.BackColor = &H8000000FEnd Sub

Private Sub txtuserid_GotFocus()txtuserid.BackColor = &H80FFFFEnd Sub

Private Sub txtuserid_KeyPress(KeyAscii As Integer)If KeyAscii = 13 Then Call cmdok_ClickEnd Sub

Private Sub txtuserid_LostFocus()txtuserid.BackColor = &H8000000FEnd Sub

Main Form

Private Sub cmdadd_Click()studentinformationform.ShowEnd Sub

Private Sub cmdenroll_Click()enrollmentform.Show 1, mainformEnd Sub

Private Sub cmdpay_Click()paymentform.Show 1, mainformEnd Sub

Private Sub cmdremind_Click()remindersform.Show 1, mainformEnd Sub

Private Sub MDIForm_Load()Connect

sql = "select * from tblsystemnumber"

Set rs = New ADODB.Recordsetrs.Open sql, con, adOpenDynamic, adLockOptimistic

mainform.StatusBar1.Panels(2).Text = rs.Fields!systemnumberEnd Sub

Private Sub MDIForm_Unload(Cancel As Integer)If vbYes = MsgBox("Are you sure you want exit?", vbQuestion + vbYesNo, "System") Then Unload MeElse Cancel = TrueEnd IfEnd Sub

Private Sub mnuabout_Click()aboutform.ShowEnd Sub

Private Sub mnuenrollee_Click()enrolleemasterlistform.ShowEnd Sub

Private Sub mnuenrolleemasterlistreport_Click()enrolleemasterlistreportform.ShowEnd Sub

Private Sub mnuassestmentform_Click()assestmentform.ShowEnd Sub

Private Sub mnuenrollees_Click()enrolleemasterlistreportform.ShowEnd Sub

Private Sub mnuenrollment_Click()enrollmentform.Show 1, mainformEnd Sub

Private Sub mnuexaminationschedules_Click()examinationschedulesform.ShowEnd Sub

Private Sub mnuexit_Click()Unload MeEnd Sub

Private Sub mnulogoff_Click()Unload Meloginform.ShowEnd Sub

Private Sub mnumessages_Click()messagesform.ShowEnd Sub

Private Sub mnupayment_Click()paymentform.Show 1, mainformEnd Sub

Private Sub mnupaymentbreakdown_Click()paymentbreakdownform.ShowEnd Sub

Private Sub mnupaymentinformationreport_Click()paymentinformationreportform.ShowEnd Sub

Private Sub mnupaymentinformation_Click()paymentbreakdownform.ShowEnd Sub

Private Sub mnupayments_Click()paymentinformationreportform.ShowEnd Sub

Private Sub mnureminders_Click()remindersform.Show 1, mainformEnd Sub

Private Sub mnustudentifnformation_Click()studentinformationform.ShowEnd Sub

Private Sub mnusystemnumber_Click()systemnumberform.ShowEnd Sub

Private Sub mnuusermaintenance_Click()usermaintenanceform.ShowEnd Sub

Private Sub mnuusertype_Click()usertypeform.ShowEnd Sub

Private Sub mnuyearlevel_Click()yearlevelform.ShowEnd Sub

AddUpdateUserType

Public Sub addusertype()rs.Fields!usertypeid = idrs.Fields!usertype = txtusertype.TextEnd Sub

Private Sub cmdsave_Click()If txtusertype.Text = "" Then MsgBox "Please fill User Type!", , "System" txtusertype.SetFocusElseIf cmdsave.Caption = "&Save" Thenid = "1"Set rs = New ADODB.Recordsetsql = "select * from tblusertype"rs.Open sql, con, adOpenDynamic, adLockOptimistic

If Not rs.EOF Then With rs .MoveLast id = Val(!usertypeid) + Val(1) .Close End WithEnd If

Connect rs.Open "select * from tblusertype where usertype='" & txtusertype & "'", con, adOpenDynamic, adLockOptimistic

If rs.RecordCount = 1 Then MsgBox "Usertype already exist!", , "System" txtusertype.Text = "" txtusertype.SetFocus Else Connect sql = "select * from tblusertype" Set rs = Nothing rs.Open sql, con, adOpenDynamic, adLockOptimistic With rs .AddNew addusertype .Update End With MsgBox "Usertype successfully saved!", vbInformation, "System" Unload Me usertypeform.Show End IfElse con.Execute "update tblusertype set" & vbCrLf & _ "usertype='" & txtusertype.Text & "'" & vbCrLf & _ "where usertypeid='" & id & "'" MsgBox "Usertype successfully updated!", vbInformation, "System" Unload Me usertypeform.ShowEnd IfEnd IfEnd Sub

Private Sub Form_Unload(Cancel As Integer)usertypeform.ShowEnd Sub

Private Sub txtusertype_KeyPress(KeyAscii As Integer)Data = "qwertyuiopasdfghjklxcvbnmQWERTYUIOPASDFGHJKLXCVBNM"If KeyAscii < 26 Then KeyAscii = KeyAsciiElse If InStr(Data, Chr(KeyAscii)) = 0 Then KeyAscii = 0 Exit Sub End IfEnd IfEnd Sub

AddUpdateUserForm

Public Sub fillusertype()Set rs = New ADODB.Recordsetrs.Open "select * from tblusertype", con, adOpenDynamic, adLockOptimistic

Do While Not rs.EOFtxtusertype.AddItem rs.Fields!usertypers.MoveNextLooprs.CloseEnd Sub

Public Sub adduser()rs.Fields!id = idrs.Fields!userid = txtuserid.Textrs.Fields!lastname = txtlastname.Textrs.Fields!firstname = txtfirstname.Textrs.Fields!mi = txtmi.Textrs.Fields!extensionname = txtextensionname.Textrs.Fields!longname = txtlongname.Textrs.Fields!usertype = txtusertype.Textrs.Fields!Password = txtlogonpassword.Textrs.Fields!entryby = mainform.StatusBar1.Panels(1).Textrs.Fields!entrydate = NowEnd Sub

Private Sub Check1_Click()If Check1.Value = 1 Thentxtlogonpassword.PasswordChar = ""Elsetxtlogonpassword.PasswordChar = "*"End IfEnd Sub

Private Sub cmdsave_Click()If txtuserid.Text = "" Then MsgBox "Please fill User ID!", , "System" txtuserid.SetFocusElseIf txtfirstname.Text = "" Then MsgBox "Please fill First Name", , "System" txtfirstname.SetFocusElseIf txtlastname.Text = "" Then MsgBox "Please fill Last Name!", , "System" txtlastname.SetFocusElseIf txtmi.Text = "" Then MsgBox "Please fill Middle Initial!", , "System" txtmi.SetFocusElseIf txtusertype.Text = "" Then MsgBox "Please select User Type!", , "System" txtusertype.SetFocusElseIf txtlogonpassword.Text = "" Then MsgBox "Please fill Logon Password!", , "System" txtlogonpassword.SetFocusElse If cmdsave.Caption = "&Save" Then Connect rs.Open "select * from tblusers where userid='" & txtuserid.Text & "'", con, adOpenDynamic, adLockOptimistic

If rs.RecordCount = 1 Then MsgBox "User ID already exist!", , "System" txtuserid.Text = "" txtuserid.SetFocus Else id = "1" Set rs = New ADODB.Recordset sql = "select * from tblstudent" rs.Open sql, con, adOpenDynamic, adLockOptimistic

If Not rs.EOF Then With rs .MoveLast id = Val(!id) + Val(1) .Close End With End If

Connect sql = "select * from tblusers" Set rs = Nothing rs.Open sql, con, adOpenDynamic, adLockOptimistic With rs .AddNew adduser rs.Fields!entryby = mainform.StatusBar1.Panels(1).Text rs.Fields!entrydate = Now .Update End With MsgBox "User successfully saved!", vbInformation, "System" Unload Me usermaintenanceform.Show End If Else con.Execute "update tblusers set" & vbCrLf & _ "firstname='" & txtfirstname.Text & "'," & vbCrLf & _ "lastname='" & txtlastname.Text & "'," & vbCrLf & _ "mi='" & txtmi.Text & "'," & vbCrLf & _ "extensionname='" & txtextensionname.Text & "'," & vbCrLf & _ "usertype='" & txtusertype.Text & "'," & vbCrLf & _ "longname='" & txtlongname.Text & "'," & vbCrLf & _ "password='" & txtlogonpassword.Text & "'," & vbCrLf & _ "updatedby='" & mainform.StatusBar1.Panels(1).Text & "'," & vbCrLf & _ "lastupdate='" & Now & "'" & vbCrLf & _ "where userid='" & txtuserid.Text & "'" MsgBox "User successfully updated!", vbInformation, "System" Unload Me usermaintenanceform.Show End IfEnd IfEnd Sub

Private Sub Form_Activate()Call fillusertypeEnd Sub

Private Sub Form_Unload(Cancel As Integer)usermaintenanceform.ShowEnd Sub

Private Sub Frame1_DragDrop(Source As Control, X As Single, Y As Single)

End Sub

Private Sub txtextensionname_Change()txtlongname.Text = txtfirstname.Text & " " & txtmi.Text & " " & txtlastname.Text & " " & txtextensionname.TextEnd Sub

Private Sub txtextensionname_KeyPress(KeyAscii As Integer)Data = "JSrIV"If KeyAscii < 26 Then KeyAscii = KeyAsciiElse If InStr(Data, Chr(KeyAscii)) = 0 Then KeyAscii = 0 Exit Sub End IfEnd IfEnd Sub

Private Sub txtfirstname_Change()txtlongname.Text = txtfirstname.Text & " " & txtmi.Text & " " & txtlastname.Text & " " & txtextensionname.TextEnd Sub

Private Sub txtfirstname_KeyPress(KeyAscii As Integer)Data = "qwertyuiopasdfghjklxcvbnmQWERTYUIOPASDFGHJKLXCVBNM- "If KeyAscii < 26 Then KeyAscii = KeyAsciiElse If InStr(Data, Chr(KeyAscii)) = 0 Then KeyAscii = 0 Exit Sub End IfEnd IfEnd Sub

Private Sub txtlastname_Change()txtlongname.Text = txtfirstname.Text & " " & txtmi.Text & " " & txtlastname.Text & " " & txtextensionname.TextEnd Sub

Private Sub txtlastname_KeyPress(KeyAscii As Integer)Data = "qwertyuiopasdfghjklxcvbnmQWERTYUIOPASDFGHJKLXCVBNM- "If KeyAscii < 26 Then KeyAscii = KeyAsciiElse If InStr(Data, Chr(KeyAscii)) = 0 Then KeyAscii = 0 Exit Sub End IfEnd IfEnd Sub

Private Sub txtlogonpassword_KeyPress(KeyAscii As Integer)Data = "qwertyuiopasdfghjklxcvbnmQWERTYUIOPASDFGHJKLXCVBNM-_1234567890"If KeyAscii < 26 Then KeyAscii = KeyAsciiElse If InStr(Data, Chr(KeyAscii)) = 0 Then KeyAscii = 0 Exit Sub End IfEnd IfEnd Sub

Private Sub txtmi_Change()txtlongname.Text = txtfirstname.Text & " " & txtmi.Text & " " & txtlastname.Text & " " & txtextensionname.TextEnd Sub

Private Sub txtmi_KeyPress(KeyAscii As Integer)Data = "QWERTYUIOPASDFGHJKLXCVBNM"If KeyAscii < 26 Then KeyAscii = KeyAsciiElse If InStr(Data, Chr(KeyAscii)) = 0 Then KeyAscii = 0 Exit Sub End IfEnd IfEnd Sub

Private Sub txtuserid_KeyPress(KeyAscii As Integer)Data = "qwertyuiopasdfghjklxcvbnm1234567890-_"If KeyAscii < 26 Then KeyAscii = KeyAsciiElse If InStr(Data, Chr(KeyAscii)) = 0 Then KeyAscii = 0 Exit Sub End IfEnd IfEnd Sub

AddUpdateYearLevel

Public Sub addyearlevel()rs.Fields!yearlevelid = idrs.Fields!yearlevel = txtyearlevel.TextEnd Sub

Private Sub cmdsave_Click()If txtyearlevel.Text = "" Then MsgBox "Please fill Year Level!", , "System" txtyearlevel.SetFocusElseIf cmdsave.Caption = "&Save" Thenid = "1"Set rs = New ADODB.Recordsetsql = "select * from tblyearlevel"rs.Open sql, con, adOpenDynamic, adLockOptimistic

If Not rs.EOF Then With rs .MoveLast id = Val(!yearlevelid) + Val(1) .Close End WithEnd If

Connect rs.Open "select * from tblyearlevel where yearlevel='" & txtyearlevel.Text & "'", con, adOpenDynamic, adLockOptimistic

If rs.RecordCount = 1 Then MsgBox "Yearlevel already exist!", , "System" txtyearlevel.Text = "" txtyearlevel.SetFocus Else Connect sql = "select * from tblyearlevel" Set rs = Nothing rs.Open sql, con, adOpenDynamic, adLockOptimistic With rs .AddNew addyearlevel .Update End With MsgBox "Year Level successfully saved!", vbInformation, "System" Unload Me yearlevelform.Show End IfElse con.Execute "update tblyearlevel set" & vbCrLf & _ "yearlevel='" & txtyearlevel.Text & "'" & vbCrLf & _ "where yearlevelid='" & id & "'" MsgBox "Year Level successfully updated!", vbInformation, "System" Unload Me yearlevelform.ShowEnd IfEnd IfEnd Sub

Private Sub Form_Unload(Cancel As Integer)yearlevelform.ShowEnd Sub

Private Sub txtyearlevel_KeyPress(KeyAscii As Integer)Data = "1234567890thstndraeYG "If KeyAscii < 26 Then KeyAscii = KeyAsciiElse If InStr(Data, Chr(KeyAscii)) = 0 Then KeyAscii = 0 Exit Sub End IfEnd IfEnd Sub

AssesmentForm

Private Sub getenrollees()ListView1.ListItems.ClearConnectsql = "select * from tblstudent"Set rs = New ADODB.Recordsetrs.Open sql, con, adOpenDynamic, adLockOptimistic

Do Until rs.EOF With ListView1.ListItems.Add(, , rs!idnumber) .SubItems(1) = rs!completename .SubItems(2) = rs!yearlevel .SubItems(3) = rs!dateenrolled .SubItems(4) = rs!amountpaid .SubItems(5) = rs!balance End With rs.MoveNextLooprs.Close: Set rs = NothingEnd Sub

Private Sub searchid()ListView1.ListItems.ClearConnectsql = "select * from tblstudent where idnumber like '" & txtsearchid.Text & "%'"Set rs = New ADODB.Recordsetrs.Open sql, con, adOpenDynamic, adLockOptimistic

Do Until rs.EOF With ListView1.ListItems.Add(, , rs!idnumber) .SubItems(1) = rs!completename .SubItems(2) = rs!yearlevel .SubItems(3) = rs!dateenrolled .SubItems(4) = rs!amountpaid .SubItems(5) = rs!balance End With rs.MoveNextLooprs.Close: Set rs = NothingEnd Sub

Private Sub searchlastname()ListView1.ListItems.ClearConnectsql = "select * from tblstudent where lastname like '" & txtsearchlastname.Text & "%'"Set rs = New ADODB.Recordsetrs.Open sql, con, adOpenDynamic, adLockOptimistic

Do Until rs.EOF With ListView1.ListItems.Add(, , rs!idnumber) .SubItems(1) = rs!completename .SubItems(2) = rs!yearlevel .SubItems(3) = rs!dateenrolled .SubItems(4) = rs!amountpaid .SubItems(5) = rs!balance End With rs.MoveNextLooprs.Close: Set rs = NothingEnd Sub

Private Sub searchyearlevel()ListView1.ListItems.ClearConnectsql = "select * from tblstudent where yearlevel like '" & txtsearchyearlevel.Text & "%'"Set rs = New ADODB.Recordsetrs.Open sql, con, adOpenDynamic, adLockOptimistic

Do Until rs.EOF With ListView1.ListItems.Add(, , rs!idnumber) .SubItems(1) = rs!completename .SubItems(2) = rs!yearlevel .SubItems(3) = rs!dateenrolled .SubItems(4) = rs!amountpaid .SubItems(5) = rs!balance End With rs.MoveNextLooprs.Close: Set rs = NothingEnd Sub

Private Sub Form_Load()Call getenrolleesEnd Sub

Private Sub ListView1_DblClick()Call cmdview_ClickEnd Sub

Private Sub txtsearchid_Change()Call searchidEnd Sub

Private Sub txtsearchlastname_Change()Call searchlastnameEnd Sub

Private Sub txtsearchyearlevel_Change()Call searchyearlevelEnd Sub

EnrolleeMasterListForm

Private Sub getenrollees()ListView1.ListItems.ClearConnectsql = "select * from tblstudent"Set rs = New ADODB.Recordsetrs.Open sql, con, adOpenDynamic, adLockOptimistic

Do Until rs.EOF With ListView1.ListItems.Add(, , rs!idnumber) .SubItems(1) = rs!completename .SubItems(2) = rs!yearlevel .SubItems(3) = rs!dateenrolled .SubItems(4) = rs!amountpaid .SubItems(5) = rs!balance End With rs.MoveNextLooprs.Close: Set rs = NothingEnd Sub

Private Sub searchid()ListView1.ListItems.ClearConnectsql = "select * from tblstudent where idnumber like '" & txtsearchid.Text & "%'"Set rs = New ADODB.Recordsetrs.Open sql, con, adOpenDynamic, adLockOptimistic

Do Until rs.EOF With ListView1.ListItems.Add(, , rs!idnumber) .SubItems(1) = rs!completename .SubItems(2) = rs!yearlevel .SubItems(3) = rs!dateenrolled .SubItems(4) = rs!amountpaid .SubItems(5) = rs!balance End With rs.MoveNextLooprs.Close: Set rs = NothingEnd Sub

Private Sub searchlastname()ListView1.ListItems.ClearConnectsql = "select * from tblstudent where lastname like '" & txtsearchlastname.Text & "%'"Set rs = New ADODB.Recordsetrs.Open sql, con, adOpenDynamic, adLockOptimistic

Do Until rs.EOF With ListView1.ListItems.Add(, , rs!idnumber) .SubItems(1) = rs!completename .SubItems(2) = rs!yearlevel .SubItems(3) = rs!dateenrolled .SubItems(4) = rs!amountpaid .SubItems(5) = rs!balance End With rs.MoveNextLooprs.Close: Set rs = NothingEnd Sub

Private Sub searchyearlevel()ListView1.ListItems.ClearConnectsql = "select * from tblstudent where yearlevel like '" & txtsearchyearlevel.Text & "%'"Set rs = New ADODB.Recordsetrs.Open sql, con, adOpenDynamic, adLockOptimistic

Do Until rs.EOF With ListView1.ListItems.Add(, , rs!idnumber) .SubItems(1) = rs!completename .SubItems(2) = rs!yearlevel .SubItems(3) = rs!dateenrolled .SubItems(4) = rs!amountpaid .SubItems(5) = rs!balance End With rs.MoveNextLooprs.Close: Set rs = NothingEnd Sub

Private Sub editenrollee()On Error Resume Next

ConnectSet rs = New ADODB.Recordsetrs.Open "select * from tblstudent where idnumber='" & ListView1.SelectedItem.Text & "'", con, adOpenDynamic, adLockOptimisticWith updateenrolleeform .Caption = "Edit Enrollee - " & rs.Fields!idnumber .txtidnumber.Text = rs.Fields!idnumber .txtamountpaid.Text = rs.Fields!amountpaid .txtbalance.Text = rs.Fields!balance .txtbarangay.Text = rs.Fields!barangay .txtdateofbirth.Value = rs.Fields!dateofbirth .txtemailaddress.Text = rs.Fields!emailaddress .txtextensionname.Text = rs.Fields!extensionname .txtfirstname.Text = rs.Fields!firstname .txtgender.Text = rs.Fields!gender .txtguardiansname.Text = rs.Fields!guardiansname .txtguardiansnumber.Text = rs.Fields!guardiansnumber .txthousenumber.Text = rs.Fields!housenumber .txtidnumber.Text = rs.Fields!idnumber .txtlastname.Text = rs.Fields!lastname .txtmiddlename.Text = rs.Fields!middlename .txtmobilenumber.Text = rs.Fields!mobilenumber .txtprovince.Text = rs.Fields!province .txtrelationship.Text = rs.Fields!relationship .txtstreet.Text = rs.Fields!street .txttotalfees.Text = rs.Fields!totalfees .txttowncity.Text = rs.Fields!towncity .txtyearlevel.Text = rs.Fields!yearlevelEnd Withrs.Close

End Sub

Private Sub cmdadd_Click()updateenrolleeform.ShowUnload MeEnd Sub

Private Sub cmddelete_Click()If vbYes = MsgBox("Are you sure you want to delete " & ListView1.SelectedItem.SubItems(1) & "?", vbQuestion + vbYesNo, "System") Then con.Execute "delete from tblstudent where idnumber='" & ListView1.SelectedItem.Text & "'" MsgBox "" & ListView1.SelectedItem.SubItems(1) & " successfully deleted!", vbInformation, "System" ListView1.ListItems.Clear Call getenrolleesElse ListView1.ListItems.Clear Call getenrolleesEnd IfEnd Sub

Private Sub cmdedit_Click()Call editenrolleeUnload MeEnd Sub

Private Sub Form_Load()Call getenrolleesEnd Sub

Private Sub ListView1_DblClick()Call editenrolleeUnload MeEnd Sub

Private Sub txtsearchid_Change()Call searchidEnd Sub

Private Sub txtsearchlastname_Change()Call searchlastnameEnd Sub

Private Sub txtsearchyearlevel_Change()Call searchyearlevelEnd Sub

EnrolleeMasterListReportForm

Public Sub getall()ConnectSet rs = Nothingrs.Open "select * from tblstudent", con, adOpenDynamic, adLockOptimisticSet allenrolleemasterlist.DataSource = rsallenrolleemasterlist.ShowEnd Sub

Public Sub getyearlevel()ConnectSet rs = Nothingrs.Open "select * from tblstudent where yearlevel='" & txtlist.Text & "'", con, adOpenDynamic, adLockOptimisticSet yearlevelenrolleemasterlist.DataSource = rsyearlevelenrolleemasterlist.ShowEnd Sub

Public Sub fillyearlevel()txtlist.ClearSet rs = Nothingrs.Open "select * from tblyearlevel", con, adOpenDynamic, adLockOptimistic

Do While Not rs.EOFtxtlist.AddItem rs.Fields!yearlevelrs.MoveNextLooprs.CloseEnd Sub

Private Sub cmdview_Click()If Option1.Value = True Then getallIf Option2.Value = True Then getyearlevelEnd Sub

Private Sub Form_Load()

End Sub

Private Sub Option1_Click()txtlist.Cleartxtlist.Enabled = FalseEnd Sub

Private Sub Option2_Click()txtlist.Enabled = TrueCall fillyearlevelEnd Sub

EnrollmentForm

Option ExplicitPrivate Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)Private Sub Send_SMS(Cell_no As String, SMS_msg As String)' Send an 'AT' command to the phone

message1.Text = "Sending SMS..." DoEvents MSComm1.Output = "AT" & vbCrLf Sleep 10 MSComm1.Output = "AT+CMGS=1" & vbCrLf 'This line can be removed if your modem will always be in Text Mode... Sleep10 MSComm1.Output = "AT+CMGS=" &Chr(17) & txtguardiansnumber.Text & Chr(17) & vbCrLf 'store cell no. to modem....." Sleep 10

MSComm1.Output = SMS_msg & Chr(13) 'messages

message1.Text = "Message Sent" DoEvents

Sleep 200 'wait for 200 milliseconds... message1.Text = " Ready to recieve SMS..." DoEvents

End Sub

Private Sub mesagesent()message = From: La Salette of Cabatuan, + completename + is now enrolled, he/she gave an initial payment of + txtamountpaid.Text + pesos and the remaining balance is + txtbalance.Text + pesos, Thank You.' Send an 'AT' command to the phoneMSComm1.Output = "AT" & vbCrLfSleep 10MSComm1.Output = "AT+CMGS=1" & vbCrLf 'This line can be removed if your modem will always be in Text Mode...Sleep 10MSComm1.Output = "AT+CMGS=" &Chr(17) & txtguardiansnumber.Text & Chr(17) & vbCrLf 'Replace this with your mobile Phone's No.Sleep 10MSComm1.Output = message & Chr(13)Sleep 20

MsgBox "Message Send"

End Sub

Private Sub getenrollee1()On Error Resume NextConnectSet rs = New ADODB.Recordsetrs.Open "select * from tblstudent where idnumber='" & txtidnumber.Text & "'", con, adOpenDynamic, adLockOptimisticIf rs.RecordCount = 0 ThenMsgBox "No record found!", , "System"Elsetxtidnumber.Text = rs.Fields!idnumbertxtyearlevel.Text = rs.Fields!yearleveltxtcompletename.Text = rs.Fields!completenametxtguardiansnumber.Text = rs.Fields!guardiansnumberEnd Ifrs.CloseEnd Sub

Private Sub searchenrollees()ListView1.ListItems.clearConnectsql = "select * from tblstudent where balance=0 and idnumber like '%" & txtidnumber.Text & "%'"Set rs = New ADODB.Recordsetrs.Open sql, con, adOpenDynamic, adLockOptimistic

Do Until rs.EOF With ListView1.ListItems.Add(, , rs!idnumber) .SubItems(1) = rs!completename .SubItems(2) = rs!yearlevel .SubItems(3) = rs!amountpaid .SubItems(4) = rs!balance End With rs.MoveNextLooprs.CloseEnd Sub

Private Sub getenrollee()On Error Resume NextConnectSet rs = New ADODB.Recordsetrs.Open "select * from tblstudent where idnumber='" & ListView1.SelectedItem.Text & "'", con, adOpenDynamic, adLockOptimistictxtidnumber.Text = rs.Fields!idnumbertxtyearlevel.Text = rs.Fields!yearleveltxtcompletename.Text = rs.Fields!completenametxtguardiansnumber.Text = rs.Fields!guardiansnumberrs.CloseEnd Sub

Private Sub getenrollees()ListView1.ListItems.clearConnectsql = "select * from tblstudent where amountpaid=0"Set rs = New ADODB.Recordsetrs.Open sql, con, adOpenDynamic, adLockOptimistic

Do Until rs.EOF With ListView1.ListItems.Add(, , rs!idnumber) .SubItems(1) = rs!completename .SubItems(2) = rs!yearlevel .SubItems(3) = rs!amountpaid .SubItems(4) = rs!balance End With rs.MoveNextLooprs.CloseEnd Sub

Public Sub printreceipt()ConnectSet rs = New ADODB.Recordsetrs.Open "select * from tblpaymenthistory join tblpaymentbreakdown where officialreceiptnumber='" & txtofficialreceiptnumber.Text & "'", con, adOpenDynamic, adLockOptimisticSet officialreceipt.DataSource = rsofficialreceipt.Show 1, mainformEnd Sub

Public Sub clear()txtidnumber.Text = ""'txtlastname.Text = ""'txtfirstname.Text = ""'txtmiddlename.Text = ""'txtextensionname.Text = ""txtyearlevel.Text = ""'txtmobilenumber.Text = ""'txtemailaddress.Text = ""'txtgender.Text = ""'txtdateofbirth.Value = Format(Now, "mm/dd/yyyy")txtamountpaid.Text = ""'txthousenumber.Text = ""'txtstreet.Text = ""'txtbarangay.Text = ""'txttowncity.Text = ""'txtprovince.Text = ""'txtguardiansname.Text = ""'txtrelationship.Text = ""txtguardiansnumber.Text = ""txtbalance.Text = txttotalfees.TextCall officialreceiptnumberEnd Sub

Public Sub getpaymentbreakdown()

ConnectSet rs = New ADODB.Recordsetrs.Open "select * from tblpaymentbreakdown", con, adOpenDynamic, adLockOptimistic

If rs.RecordCount = 0 Then MsgBox "No payment record found!", vbInformation, "System"Else txttuitionfee.Text = rs.Fields!tuitionfee txtmiscellaneousfee.Text = rs.Fields!miscellaneousfee txtcomputerfee.Text = rs.Fields!computerfee txttestpaperfee.Text = rs.Fields!testpaperfee txtstudentidfee.Text = rs.Fields!studentidfee txthandbookfee.Text = rs.Fields!handbookfee txtcertificationfee.Text = rs.Fields!certificationfee txtrecollectionfee.Text = rs.Fields!recollectionfee txtothers.Text = rs.Fields!others txttotalfees.Text = rs.Fields!totalfees txtbalance.Text = rs.Fields!totalfeesEnd Ifrs.CloseEnd Sub

Public Sub officialreceiptnumber()

ornumber = "1000000001"

Set rs = Nothingsql = "select officialreceiptnumber from tblpaymenthistory"rs.Open sql, con, adOpenDynamic, adLockOptimistic

If Not rs.EOF Then With rs .MoveLast ornumber = Val(!officialreceiptnumber) + Val(1) .Close End WithEnd If

txtofficialreceiptnumber.Text = ornumber

End Sub

Public Sub addpaymenthistory()rs.Fields!officialreceiptnumber = ornumberrs.Fields!paymentdate = Format(Now, "mm/dd/yyyy")rs.Fields!studentid = txtidnumber.Textrs.Fields!completename = completenamers.Fields!yearlevel = txtyearlevel.Textrs.Fields!totalfees = txttotalfees.Textrs.Fields!previousbalance = "0"rs.Fields!previouspayment = "0"rs.Fields!amountpaid = txtamountpaid.Textrs.Fields!remainingbalance = txtbalance.Textrs.Fields!entryby = mainform.StatusBar1.Panels(1).Textrs.Fields!entrydate = NowEnd Sub

Private Sub cmdenroll_Click()If txtidnumber.Text = "" Then MsgBox "Please fill ID Number!", , "System" txtidnumber.SetFocusElseIf txtamountpaid.Text = "" Then MsgBox "Please enter amount paid!", , "System" txtamountpaid.SetFocusElseIf Val(txtbalance.Text) < 0 Then MsgBox "Amount paid must not be greater than total fees!", , "System" txtamountpaid.SetFocusElseConnectSet rs = Nothingrs.Open "select * from tblstudent where idnumber='" & txtidnumber.Text & "' and amountpaid=0", con, adOpenDynamic, adLockOptimisticIf rs.RecordCount = 0 Then MsgBox "ID number not found!", , "System" txtidnumber.Text = "" txtidnumber.SetFocusElse Call officialreceiptnumber Connect Set rs = Nothing rs.Open "select * from tblpaymenthistory", con, adOpenDynamic, adLockOptimistic With rs .AddNew addpaymenthistory rs.Fields!entryby = mainform.StatusBar1.Panels(1).Text rs.Fields!entrydate = Now .Update End With rs.Close

con.Execute "update tblstudent set" & vbCrLf & _ "amountpaid='" & txtamountpaid.Text & "'," & vbCrLf & _ "balance='" & Val(txttotalfees.Text) - Val(txtamountpaid.Text) & "'" & vbCrLf & _ "where idnumber='" & txtidnumber.Text & "'"

Connect Set rs = Nothing rs.Open "select * from tblstudent where idnumber='" & txtidnumber.Text & "'", con, adOpenDynamic, adLockOptimistic txtguardiansnumber.Text = rs.Fields!guardiansnumber Call Send_SMS(txtguardiansnumber.Text, "From:LSC, " + completename + " is now enrolled and paid " + txtamountpaid.Text + ". Remaining balance is " + txtbalance.Text + ", Thank You.") MsgBox "Student successfully enrolled!", vbInformation, "System" Call printreceipt Call clear Call getenrolleesEnd IfEnd IfEnd Sub

Private Sub Form_Activate()ConnectCall officialreceiptnumberCall getpaymentbreakdownCall getenrolleesEnd Sub

Private Sub Form_Load()On Error GoTo errWith MSComm1 .CommPort = 8 .Settings = "6900,N,8,1" .Handshaking = comRTS .RTSEnable = True .DTREnable = True .RThreshold = 45 .SThreshold = 45 .InputMode = comInputModeText .InputLen = 50 .PortOpen = True 'must be the lastEnd Witherr: MsgBox err.DescriptionEnd Sub

Private Sub ListView1_Click()Call getenrolleeEnd Sub

Private Sub MSComm1_OnComm()Me.List1.AddItem MSComm1.InputEnd Sub

Private Sub txtamountpaid_Change()txtbalance.Text = Val(txttotalfees.Text) - Val(txtamountpaid.Text)End Sub

Private Sub txtamountpaid_KeyPress(KeyAscii As Integer)Data = "1234567890"If KeyAscii < 26 Then KeyAscii = KeyAsciiElse If InStr(Data, Chr(KeyAscii)) = 0 Then KeyAscii = 0 Exit Sub End IfEnd IfEnd Sub

Private Sub txtbarangay_KeyPress(KeyAscii As Integer)Data = "qwertyuiopasdfghjklxcvbnmQWERTYUIOPASDFGHJKLXCVBNM- "If KeyAscii < 26 Then KeyAscii = KeyAsciiElse If InStr(Data, Chr(KeyAscii)) = 0 Then KeyAscii = 0 Exit Sub End IfEnd IfEnd Sub

Private Sub txtemailaddress_KeyPress(KeyAscii As Integer)Data = "qwertyuiopasdfghjklxcvbnmQWERTYUIOPASDFGHJKLXCVBNM-_!@#$%^&*()+=[]{}./?1234567890"If KeyAscii < 26 Then KeyAscii = KeyAsciiElse If InStr(Data, Chr(KeyAscii)) = 0 Then KeyAscii = 0 Exit Sub End IfEnd IfEnd Sub

Private Sub txtextensionname_KeyPress(KeyAscii As Integer)Data = "JSrIV"If KeyAscii < 26 Then KeyAscii = KeyAsciiElse If InStr(Data, Chr(KeyAscii)) = 0 Then KeyAscii = 0 Exit Sub End IfEnd IfEnd Sub

Private Sub txtfirstname_KeyPress(KeyAscii As Integer)Data = "qwertyuiopasdfghjklxcvbnmQWERTYUIOPASDFGHJKLXCVBNM- "If KeyAscii < 26 Then KeyAscii = KeyAsciiElse If InStr(Data, Chr(KeyAscii)) = 0 Then KeyAscii = 0 Exit Sub End IfEnd IfEnd Sub

Private Sub txtguardiansname_KeyPress(KeyAscii As Integer)Data = "qwertyuiopasdfghjklxcvbnmQWERTYUIOPASDFGHJKLXCVBNM- "If KeyAscii < 26 Then KeyAscii = KeyAsciiElse If InStr(Data, Chr(KeyAscii)) = 0 Then KeyAscii = 0 Exit Sub End IfEnd IfEnd Sub

Private Sub txtguardiansnumber_KeyPress(KeyAscii As Integer)Data = "1234567890+"If KeyAscii < 26 Then KeyAscii = KeyAsciiElse If InStr(Data, Chr(KeyAscii)) = 0 Then KeyAscii = 0 Exit Sub End IfEnd IfEnd Sub

Private Sub txthousenumber_KeyPress(KeyAscii As Integer)Data = "2345678901"If KeyAscii < 26 Then KeyAscii = KeyAsciiElse If InStr(Data, Chr(KeyAscii)) = 0 Then KeyAscii = 0 Exit Sub End IfEnd IfEnd Sub

Private Sub txtidnumber_Change()Call searchenrolleesEnd Sub

Private Sub txtidnumber_KeyPress(KeyAscii As Integer)If KeyAscii = 13 Then Call getenrollee1Data = "1234567890"If KeyAscii < 26 Then KeyAscii = KeyAsciiElse If InStr(Data, Chr(KeyAscii)) = 0 Then KeyAscii = 0 Exit Sub End IfEnd IfEnd Sub

Private Sub txtlastname_KeyPress(KeyAscii As Integer)Data = "qwertyuiopasdfghjklxcvbnmQWERTYUIOPASDFGHJKLXCVBNM- "If KeyAscii < 26 Then KeyAscii = KeyAsciiElse If InStr(Data, Chr(KeyAscii)) = 0 Then KeyAscii = 0 Exit Sub End IfEnd IfEnd Sub

Private Sub txtmiddlename_KeyPress(KeyAscii As Integer)Data = "qwertyuiopasdfghjklxcvbnmQWERTYUIOPASDFGHJKLXCVBNM- "If KeyAscii < 26 Then KeyAscii = KeyAsciiElse If InStr(Data, Chr(KeyAscii)) = 0 Then KeyAscii = 0 Exit Sub End IfEnd IfEnd Sub

Private Sub txtmobilenumber_KeyPress(KeyAscii As Integer)Data = "1234567890+"If KeyAscii < 26 Then KeyAscii = KeyAsciiElse If InStr(Data, Chr(KeyAscii)) = 0 Then KeyAscii = 0 Exit Sub End IfEnd IfEnd Sub

Private Sub txtprovince_KeyPress(KeyAscii As Integer)Data = "qwertyuiopasdfghjklxcvbnmQWERTYUIOPASDFGHJKLXCVBNM- "If KeyAscii < 26 Then KeyAscii = KeyAsciiElse If InStr(Data, Chr(KeyAscii)) = 0 Then KeyAscii = 0 Exit Sub End IfEnd IfEnd Sub

Private Sub txtrelationship_KeyPress(KeyAscii As Integer)Data = "qwertyuiopasdfghjklxcvbnmQWERTYUIOPASDFGHJKLXCVBNM- "If KeyAscii < 26 Then KeyAscii = KeyAsciiElse If InStr(Data, Chr(KeyAscii)) = 0 Then KeyAscii = 0 Exit Sub End IfEnd IfEnd Sub

Private Sub txtstreet_KeyPress(KeyAscii As Integer)Data = "qwertyuiopasdfghjklxcvbnmQWERTYUIOPASDFGHJKLXCVBNM- "If KeyAscii < 26 Then KeyAscii = KeyAsciiElse If InStr(Data, Chr(KeyAscii)) = 0 Then KeyAscii = 0 Exit Sub End IfEnd IfEnd Sub

Private Sub txttowncity_KeyPress(KeyAscii As Integer)Data = "qwertyuiopasdfghjklxcvbnmQWERTYUIOPASDFGHJKLXCVBNM- "If KeyAscii < 26 Then KeyAscii = KeyAsciiElse If InStr(Data, Chr(KeyAscii)) = 0 Then KeyAscii = 0 Exit Sub End IfEnd IfEnd Sub

MessagesForm

Option ExplicitPrivate Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)Dim buffer$Dim SMS_Location As StringDim temp_cell_no, temp_date, temp_time, temp_msg As StringDim enable_send As Boolean

Public Sub savemessage()ConnectSet rs = New ADODB.Recordsetrs.Open "select * from tbldraftmessages", con, adOpenDynamic, adLockOptimisticWith rs .AddNew .Fields!messageid = id .Fields!message = txtdraftmessage.Text .UpdateEnd Withrs.CloseEnd Sub

Public Sub getmessage()ConnectSet rs = New ADODB.Recordsetrs.Open "select message, substring(message,1,3) from tbldraftmessages", con, adOpenDynamic, adLockOptimistictxtmessage.Text = UCase(rs.MoveLast)

ConnectSet rs = New ADODB.Recordsetrs.Open "select message, substring(message,4,7) from tbldraftmessages", con, adOpenDynamic, adLockOptimistictxtidnumber.Text = UCase(rs.MoveLast)

ConnectSet rs = New ADODB.Recordsetrs.Open "select * from tblstudent where idnumber='" & txtidnumber.Text & "'", con, adOpenDynamic, adLockOptimistictxtcompletename.Text = rs.Fields!completenametxtmobilenumber.Text = rs.Fields!guardiansnumbertxtbalance.Text = rs.Fields!balance

End Sub

Public Sub closeport()Timer1.Enabled = False 'incoming SMS disable...

'--- make sure the port is close before terminating the programIf MSComm1.PortOpen = True Then MSComm1.PortOpen = FalseEnd IfUnload MeEndEnd Sub

'----- Read SMS at designated location -----------------------------Public Sub readsms() '-------- Set SMS format to Text ---------- MSComm1.Output = "AT+CMGF=1" + Chr(13) Do buffer$ = MSComm1.Input Loop Until InStr(buffer$, "OK") Text2.Text = buffer$ buffer$ = ""

'----- Read SMS at designated location ----------------------------- MSComm1.Output = "AT+CMGR=" + SMS_Location + Chr(13) Do DoEvents buffer$ = buffer$ & MSComm1.Input Loop Until InStr(buffer$, "OK") Text3.Text = buffer$End Sub

'------- Delete SMS ------------------------------Public Sub deletesms() 'delete location#1... Timer1.Enabled = False 'incoming SMS disable...

MSComm1.Output = "AT+CMGD=1" + Chr(13) Do buffer$ = MSComm1.Input Loop Until InStr(buffer$, "OK") Text2.Text = buffer$

Text4.Text = "Location #1 Deleted..." DoEvents Timer1.Enabled = True 'incoming SMS enable... Sleep 200 Text4.Text = " Ready to recieve SMS..." DoEventsEnd Sub

'Public Sub sendsms() '----------------send sms-------------------'Call Send_SMS(Text12.Text, "TESTING..." + ", Date: " + Str(Date) + ", Time: " + Str(Time))'End Sub

'----- enable time ----------------Public Sub enabletime()enable_send = 1End Sub

Public Sub clear() '-----------------Clear------------------LName.Text = ""FName.Text = ""MName.Text = ""Text15.Text = ""

Text5.Text = ""Text6.Text = ""Text7.Text = ""Text8.Text = ""DoEventsEnd Sub

Private Sub Form_Load()Timer1.Enabled = False 'incoming SMS disable... With MSComm1

.CommPort = 7 'com assignment....

.Settings = "9600,N,8,1" .Handshaking = comRTS 'comNone .RTSEnable = True .DTREnable = True .RThreshold = 1 .SThreshold = 1 .InputMode = comInputModeText .InputLen = 0 .PortOpen = True 'must be the last End With

Text4.Text = "Connected" DoEvents Sleep 500 'wait for 500 milliseconds...

'Set interation of comunication Text4.Text = "Start Setting" DoEvents

'--------- AT Commands to initialized broad ------------ MSComm1.Output = "AT+CNMI=2,1,2,0,0" + Chr(13) Call Reply_OK

'-------------------------------------------------------- MSComm1.Output = "AT+CPMS=""ME"",""SM"",""ME""" + Chr(13) Call Reply_OK

'---------- Set SMS format to Text --------------------- MSComm1.Output = "AT+CMGF=1" + Chr(13) 'set text mode... Call Reply_OK

Text4.Text = "End Setting" DoEvents Sleep 200 Text4.Text = "Ready to recieve SMS..." DoEvents Timer1.Enabled = True 'incoming SMS enable...End Sub

Private Sub Form_Unload(Cancel As Integer)Call closeportEnd Sub

Private Sub Timer1_Timer()'If enable_send Then ' Text13.Text = Str(Date) + " - " + Str(Time) ' DoEvents ' If Text10.Text = Str(Date) And Text11.Text = Str(Time) Then ' Call Command4_Click ' End If ' End If

buffer$ = MSComm1.Input '---------- Wait for incomming sms ------------ If InStr(buffer$, "+CMTI: ""ME""") Then Text2.Text = buffer$ Text5.Text = "" Text6.Text = "" Text7.Text = "" Text8.Text = "" DoEvents

'------ Get location of SMS -------------- SMS_Location = Right(buffer$, 3) buffer$ = ""

'-------- Set SMS format to Text ---------- MSComm1.Output = "AT+CMGF=1" + Chr(13) Do buffer$ = MSComm1.Input Loop Until InStr(buffer$, "OK") Text2.Text = buffer$ buffer$ = ""

'----- Read SMS at designated location ----------------------------- MSComm1.Output = "AT+CMGR=" + SMS_Location + Chr(13) Do DoEvents buffer$ = buffer$ & MSComm1.Input Loop Until InStr(buffer$, "OK") Text3.Text = buffer$

'---- extract SMS Data Message ----------------

'------- Get Cell no. ------------ temp_cell_no = Left(buffer$, 36) Text5.Text = Right(temp_cell_no, 13)

'-------- Get date ----------------- temp_date = Left(buffer$, 48) Text6.Text = Right(temp_date, 8)

'-------- Get time ---------------- temp_time = Left(buffer$, 57) Text7.Text = Right(temp_time, 8)

'---------- Get SMS Message ----------------- temp_msg = Right(buffer$, Len(buffer$) - 63) Text8.Text = Left(temp_msg, Len(temp_msg) - 8) DoEvents

Call Command3_Click 'delete location #1... Call Execute_Command End IfEnd Sub

Private Sub Execute_Command() txtmessage.Text = UCase(txtmessage.Text) If txtmessage.Text = "BAL" Then 'connect 'Set rs = New ADODB.Recordset 'rs.Open "select * from tblstudent where idnumber='" & txtidnumber.Text & "'", con, adOpenDynamic, adLockOptimistic

'Call Send_SMS(Text5.Text, "Your Account Balance is " + Text15.Text + ", Date: " + Str(Date) + ", Time: " + Str(Time)) Call Send_SMS(Text5.Text, "From La Salette of Cabatuan, The remaining balance of " + FName.Text + " " + LName.Text + " is " + Text15.Text + " pesos. Thank You!!!")

Else Call Send_SMS(Text5.Text, "Sorry, command does not match!!!") End If

Text4.Text = "Message Sent..." DoEvents Sleep 200 Text4.Text = "Ready to recieve SMS..." DoEventsEnd Sub

Sub Reply_OK() Do DoEvents buffer$ = buffer$ & MSComm1.Input Loop Until InStr(buffer$, "OK")

Text1.Text = Text1.Text & vbCr & buffer$ buffer$ = "" Sleep (500)End Sub

'-------------- Send SMS -----------------------------------------Private Sub Send_SMS(Cell_no As String, SMS_msg As String) Text4.Text = "Sending SMS..." DoEvents

Timer1.Enabled = False 'incoming SMS disable...

'--- Send an 'AT' command to the phone ------ 'AT+CMGS="09157722578" Chr(13)... 'AT+CMGS - ATcommand to send message...'Chr(13) = Carriage return... 'Chr(26) = Control Z

MSComm1.Output = "AT+CMGS=" &Chr(34) & Cell_no & Chr(34) & vbCrLf 'store cell no. to modem....." Sleep 500 MSComm1.Output = SMS_msg & Chr(26) 'messages Call Reply_OK Text4.Text = "Message Sent" DoEvents

Timer1.Enabled = True 'incoming SMS enable... Sleep 200 'wait for 200 milliseconds... Text4.Text = " Ready to recieve SMS..." DoEventsEnd Sub

PaymentBreakDownForm

Public Sub getpaymentbreakdown()

ConnectSet rs = New ADODB.Recordsetrs.Open "select * from tblpaymentbreakdown", con, adOpenDynamic, adLockOptimistic

If rs.RecordCount = 0 Then MsgBox "No record found!", vbInformation, "System" cmdsave.Caption = "&Save"Else txttuitionfee.Text = rs.Fields!tuitionfee txtmiscellaneousfee.Text = rs.Fields!miscellaneousfee txtcomputerfee.Text = rs.Fields!computerfee txttestpaperfee.Text = rs.Fields!testpaperfee txtstudentidfee.Text = rs.Fields!studentidfee txthandbookfee.Text = rs.Fields!handbookfee txtcertificationfee.Text = rs.Fields!certificationfee txtrecollectionfee.Text = rs.Fields!recollectionfee txtothers.Text = rs.Fields!others txttotalfees.Text = rs.Fields!totalfees txtentryby.Text = rs.Fields!entryby txtentrydate.Text = rs.Fields!entrydate cmdsave.Caption = "&Update"End Ifrs.CloseEnd Sub

Private Sub addpaymentbreakdown()rs.Fields!feeid = idrs.Fields!tuitionfee = txttuitionfee.Textrs.Fields!miscellaneousfee = txtmiscellaneousfee.Textrs.Fields!computerfee = txtcomputerfee.Textrs.Fields!testpaperfee = txttestpaperfee.Textrs.Fields!studentidfee = txtstudentidfee.Textrs.Fields!handbookfee = txthandbookfee.Textrs.Fields!certificationfee = txtcertificationfee.Textrs.Fields!recollectionfee = txtrecollectionfee.Textrs.Fields!others = txtothers.Textrs.Fields!totalfees = txttotalfees.TextEnd Sub

Private Sub cmdsave_Click()If txttuitionfee.Text = "" Then txttuitionfee.Text = "0"ElseIf txtmiscellaneousfee.Text = "" Then txtmiscellaneousfee.Text = "0"ElseIf txtcomputerfee.Text = "" Then txtcomputerfee.Text = "0"ElseIf txttestpaperfee.Text = "" Then txttestpaperfee.Text = "0"ElseIf txtstudentidfee.Text = "" Then txtstudentidfee.Text = "0"ElseIf txthandbookfee.Text = "" Then txthandbookfee.Text = "0"ElseIf txtcertificationfee.Text = "" Then txtcertificationfee.Text = "0"ElseIf txtrecollectionfee.Text = "" Then txtrecollectionfee.Text = "0"ElseIf txtothers.Text = "" Then txtothers.Text = "0"ElseIf cmdsave.Caption = "&Save" Then Connect Set rs = New ADODB.Recordset sql = "select * from tblsystemnumber" rs.Open sql, con, adOpenDynamic, adLockOptimistic With rs .AddNew addpaymentbreakdown rs.Fields!entryby = mainform.StatusBar1.Panels(1).Text rs.Fields!entrydate = Now .Update End With Unload Me MsgBox "Payment Breakdown successfully saved!", vbInformation, "System" paymentbreakdownform.ShowElse con.Execute "update tblpaymentbreakdown set" & vbCrLf & _ "tuitionfee='" & txttuitionfee.Text & "'," & vbCrLf & _ "miscellaneousfee='" & txtmiscellaneousfee.Text & "'," & vbCrLf & _ "computerfee='" & txtcomputerfee.Text & "'," & vbCrLf & _ "testpaperfee='" & txttestpaperfee.Text & "'," & vbCrLf & _ "studentidfee='" & txtstudentidfee.Text & "'," & vbCrLf & _ "handbookfee='" & txthandbookfee.Text & "'," & vbCrLf & _ "certificationfee='" & txtcertificationfee.Text & "'," & vbCrLf & _ "recollectionfee='" & txtrecollectionfee.Text & "'," & vbCrLf & _ "others='" & txtothers.Text & "'," & vbCrLf & _ "totalfees='" & txttotalfees.Text & "'," & vbCrLf & _ "payments='" & Val(txttotalfees.Text) / 5 & "'," & vbCrLf & _ "entryby='" & mainform.StatusBar1.Panels(1).Text & "'," & vbCrLf & _ "entrydate='" & Now & "'" & vbCrLf & _ "where feeid='" & id & "'" Unload Me MsgBox "Paymet Breakdown successfully updated!", vbInformation, "System" paymentbreakdownform.ShowEnd IfEnd IfEnd Sub

Private Sub Form_Activate()id = "1"Call getpaymentbreakdownEnd Sub

Private Sub txtcertificationfee_Change()txttotalfees.Text = Val(txttuitionfee.Text) + Val(txtmiscellaneousfee.Text) + Val(txtcomputerfee.Text) + Val(txttestpaperfee.Text) + Val(txtstudentidfee.Text) + Val(txthandbookfee.Text) + Val(txtrecollectionfee.Text) + Val(txtcertificationfee.Text) + Val(txtothers.Text)End Sub

Private Sub txtcertificationfee_KeyPress(KeyAscii As Integer)Data = "1234567890"If KeyAscii < 26 Then KeyAscii = KeyAsciiElse If InStr(Data, Chr(KeyAscii)) = 0 Then KeyAscii = 0 Exit Sub End IfEnd IfEnd Sub

Private Sub txtcomputerfee_Change()txttotalfees.Text = Val(txttuitionfee.Text) + Val(txtmiscellaneousfee.Text) + Val(txtcomputerfee.Text) + Val(txttestpaperfee.Text) + Val(txtstudentidfee.Text) + Val(txthandbookfee.Text) + Val(txtrecollectionfee.Text) + Val(txtcertificationfee.Text) + Val(txtothers.Text)End Sub

Private Sub txtcomputerfee_KeyPress(KeyAscii As Integer)Data = "1234567890"If KeyAscii < 26 Then KeyAscii = KeyAsciiElse If InStr(Data, Chr(KeyAscii)) = 0 Then KeyAscii = 0 Exit Sub End IfEnd IfEnd Sub

Private Sub txthandbookfee_Change()txttotalfees.Text = Val(txttuitionfee.Text) + Val(txtmiscellaneousfee.Text) + Val(txtcomputerfee.Text) + Val(txttestpaperfee.Text) + Val(txtstudentidfee.Text) + Val(txthandbookfee.Text) + Val(txtrecollectionfee.Text) + Val(txtcertificationfee.Text) + Val(txtothers.Text)End Sub

Private Sub txthandbookfee_KeyPress(KeyAscii As Integer)Data = "1234567890"If KeyAscii < 26 Then KeyAscii = KeyAsciiElse If InStr(Data, Chr(KeyAscii)) = 0 Then KeyAscii = 0 Exit Sub End IfEnd IfEnd Sub

Private Sub txtmiscellaneousfee_Change()txttotalfees.Text = Val(txttuitionfee.Text) + Val(txtmiscellaneousfee.Text) + Val(txtcomputerfee.Text) + Val(txttestpaperfee.Text) + Val(txtstudentidfee.Text) + Val(txthandbookfee.Text) + Val(txtrecollectionfee.Text) + Val(txtcertificationfee.Text) + Val(txtothers.Text)End Sub

Private Sub txtmiscellaneousfee_KeyPress(KeyAscii As Integer)Data = "1234567890"If KeyAscii < 26 Then KeyAscii = KeyAsciiElse If InStr(Data, Chr(KeyAscii)) = 0 Then KeyAscii = 0 Exit Sub End IfEnd IfEnd Sub

Private Sub txtothers_Change()txttotalfees.Text = Val(txttuitionfee.Text) + Val(txtmiscellaneousfee.Text) + Val(txtcomputerfee.Text) + Val(txttestpaperfee.Text) + Val(txtstudentidfee.Text) + Val(txthandbookfee.Text) + Val(txtrecollectionfee.Text) + Val(txtcertificationfee.Text) + Val(txtothers.Text)End Sub

Private Sub txtothers_KeyPress(KeyAscii As Integer)Data = "1234567890"If KeyAscii < 26 Then KeyAscii = KeyAsciiElse If InStr(Data, Chr(KeyAscii)) = 0 Then KeyAscii = 0 Exit Sub End IfEnd IfEnd Sub

Private Sub txtrecollectionfee_Change()txttotalfees.Text = Val(txttuitionfee.Text) + Val(txtmiscellaneousfee.Text) + Val(txtcomputerfee.Text) + Val(txttestpaperfee.Text) + Val(txtstudentidfee.Text) + Val(txthandbookfee.Text) + Val(txtrecollectionfee.Text) + Val(txtcertificationfee.Text) + Val(txtothers.Text)End Sub

Private Sub txtrecollectionfee_KeyPress(KeyAscii As Integer)Data = "1234567890"If KeyAscii < 26 Then KeyAscii = KeyAsciiElse If InStr(Data, Chr(KeyAscii)) = 0 Then KeyAscii = 0 Exit Sub End IfEnd IfEnd Sub

Private Sub txtstudentidfee_Change()txttotalfees.Text = Val(txttuitionfee.Text) + Val(txtmiscellaneousfee.Text) + Val(txtcomputerfee.Text) + Val(txttestpaperfee.Text) + Val(txtstudentidfee.Text) + Val(txthandbookfee.Text) + Val(txtrecollectionfee.Text) + Val(txtcertificationfee.Text) + Val(txtothers.Text)End Sub

Private Sub txtstudentidfee_KeyPress(KeyAscii As Integer)Data = "1234567890"If KeyAscii < 26 Then KeyAscii = KeyAsciiElse If InStr(Data, Chr(KeyAscii)) = 0 Then KeyAscii = 0 Exit Sub End IfEnd IfEnd Sub

Private Sub txttestpaperfee_Change()txttotalfees.Text = Val(txttuitionfee.Text) + Val(txtmiscellaneousfee.Text) + Val(txtcomputerfee.Text) + Val(txttestpaperfee.Text) + Val(txtstudentidfee.Text) + Val(txthandbookfee.Text) + Val(txtrecollectionfee.Text) + Val(txtcertificationfee.Text) + Val(txtothers.Text)End Sub

Private Sub txttestpaperfee_KeyPress(KeyAscii As Integer)Data = "1234567890"If KeyAscii < 26 Then KeyAscii = KeyAsciiElse If InStr(Data, Chr(KeyAscii)) = 0 Then KeyAscii = 0 Exit Sub End IfEnd IfEnd Sub

Private Sub txttuitionfee_Change()txttotalfees.Text = Val(txttuitionfee.Text) + Val(txtmiscellaneousfee.Text) + Val(txtcomputerfee.Text) + Val(txttestpaperfee.Text) + Val(txtstudentidfee.Text) + Val(txthandbookfee.Text) + Val(txtrecollectionfee.Text) + Val(txtcertificationfee.Text) + Val(txtothers.Text)End Sub

Private Sub txttuitionfee_KeyPress(KeyAscii As Integer)Data = "1234567890"If KeyAscii < 26 Then KeyAscii = KeyAsciiElse If InStr(Data, Chr(KeyAscii)) = 0 Then KeyAscii = 0 Exit Sub End IfEnd IfEnd Sub

PaymentForm

Option ExplicitPrivate Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)Private Sub Send_SMS(Cell_no As String, SMS_msg As String)' Send an 'AT' command to the phone

message1.Text = "Sending SMS..." DoEvents MSComm1.Output = "AT" & vbCrLf Sleep 500 MSComm1.Output = "AT+CMGF=1" & vbCrLf 'This line can be removed if your modem will always be in Text Mode... Sleep 500 MSComm1.Output = "AT+CMGS=" &Chr(34) & txtguardiansnumber.Text & Chr(34) & vbCrLf 'store cell no. to modem....." Sleep 500

MSComm1.Output = SMS_msg & Chr(26) 'messages

message1.Text = "Message Sent" DoEvents

Sleep 200 'wait for 200 milliseconds... message1.Text = " Ready to recieve SMS..." DoEvents

End Sub

Public Sub clear()txtidnumber.Text = ""txtcompletename.Text = ""txtyearlevel.Text = ""txtpreviouspayment.Text = ""txtpreviousbalance.Text = ""txtremainingbalance.Text = ""txtamountpaid.Text = ""Call officialreceiptnumberEnd Sub

Private Sub getenrollees()ListView1.ListItems.clearConnectsql = "select * from tblstudent where balance>0"Set rs = New ADODB.Recordsetrs.Open sql, con, adOpenDynamic, adLockOptimistic

Do Until rs.EOF With ListView1.ListItems.Add(, , rs!idnumber) .SubItems(1) = rs!completename .SubItems(2) = rs!yearlevel .SubItems(3) = rs!amountpaid .SubItems(4) = rs!balance End With rs.MoveNextLooprs.CloseEnd Sub

Public Sub printreceipt()ConnectSet rs = New ADODB.Recordsetrs.Open "select * from tblpaymenthistory join tblpaymentbreakdown where officialreceiptnumber='" & txtofficialreceiptnumber.Text & "'", con, adOpenDynamic, adLockOptimisticSet officialreceipt2.DataSource = rsofficialreceipt2.Show 1, mainformEnd Sub

Private Sub searchenrollees()ListView1.ListItems.clearConnectsql = "select * from tblstudent where balance>0 and idnumber like '%" & txtidnumber.Text & "%'"Set rs = New ADODB.Recordsetrs.Open sql, con, adOpenDynamic, adLockOptimistic

Do Until rs.EOF With ListView1.ListItems.Add(, , rs!idnumber) .SubItems(1) = rs!completename .SubItems(2) = rs!yearlevel .SubItems(3) = rs!amountpaid .SubItems(4) = rs!balance End With rs.MoveNextLooprs.CloseEnd Sub

Public Sub officialreceiptnumber()

ornumber = "0000000001"

Set rs = Nothingsql = "select officialreceiptnumber from tblpaymenthistory"rs.Open sql, con, adOpenDynamic, adLockOptimistic

If Not rs.EOF Then With rs .MoveLast ornumber = Val(!officialreceiptnumber) + Val(1) .Close End WithEnd If

txtofficialreceiptnumber.Text = ornumber'rs.CloseEnd Sub

Private Sub getenrollee()On Error Resume NextConnectSet rs = New ADODB.Recordsetrs.Open "select * from tblstudent where idnumber='" & ListView1.SelectedItem.Text & "'", con, adOpenDynamic, adLockOptimisticid = rs.Fields!idnumbertxtyearlevel.Text = rs.Fields!yearleveltxtcompletename.Text = rs.Fields!completenametxtpreviouspayment.Text = rs.Fields!amountpaidtxtpreviousbalance.Text = rs.Fields!balancetxtremainingbalance.Text = rs.Fields!balancetxttotalfee.Text = rs.Fields!totalfeestxtguardiansnumber.Text = rs.Fields!guardiansnumberrs.Close

End Sub

Public Sub addpaymenthistory()rs.Fields!officialreceiptnumber = txtofficialreceiptnumber.Textrs.Fields!paymentdate = Format(Now, "mm/dd/yyyy")rs.Fields!studentid = ListView1.SelectedItem.Textrs.Fields!completename = txtcompletename.Textrs.Fields!yearlevel = txtyearlevel.Textrs.Fields!totalfees = txttotalfee.Textrs.Fields!previousbalance = txtpreviousbalance.Textrs.Fields!previouspayment = txtamountpaid.Textrs.Fields!amountpaid = Val(txtpreviouspayment.Text) + Val(txtamountpaid.Text)'rs.Fields!currentpayment = txtamountpaid.Textrs.Fields!remainingbalance = txtremainingbalance.Textrs.Fields!entryby = mainform.StatusBar1.Panels(1).Textrs.Fields!entrydate = NowEnd Sub

Private Sub cmdsave_Click()On Error GoTo errIf txtcompletename.Text = "" Then MsgBox "Please Select student!", , "System"ElseIf Val(txtremainingbalance.Text) < 0 Then MsgBox "Payment must not be greater than remaining balance!", , "System" txtamountpaid.SetFocusElsecompletename = txtcompletename.Text

con.Execute "update tblstudent set" & vbCrLf & _ "amountpaid='" & txtamountpaid.Text & "'," & vbCrLf & _ "balance='" & txtremainingbalance.Text & "'" & vbCrLf & _ "where idnumber='" & id & "'"'amountpaid = Val(txtpreviouspayment.Text) + Val(txtamountpaid.Text)Connect Set rs = Nothing rs.Open "select * from tblpaymenthistory", con, adOpenDynamic, adLockOptimistic With rs .AddNew addpaymenthistory .Update End With rs.Close

Call Send_SMS(txtguardiansnumber.Text, "From: La Salette of Cabatuan, " + completename + " has paid " + txtamountpaid.Text + " pesos and the remaining balance is " + txtremainingbalance.Text + " pesos, Thank You.") MsgBox "Payment successfully saved!", vbInformation, "System"err: MsgBox err.Description Call printreceiptUnload MeEnd If

End Sub

Private Sub Form_Activate()Call getenrolleesCall officialreceiptnumberEnd Sub

Private Sub Frame1_DragDrop(Source As Control, X As Single, Y As Single)

End Sub

Private Sub ListView1_Click()Call getenrolleeEnd Sub

Private Sub txtamountpaid_Change()txtremainingbalance.Text = Val(txtpreviousbalance.Text) - Val(txtamountpaid.Text)End Sub

Private Sub txtamountpaid_KeyPress(KeyAscii As Integer)Data = "1234567890"If KeyAscii < 26 Then KeyAscii = KeyAsciiElse If InStr(Data, Chr(KeyAscii)) = 0 Then KeyAscii = 0 End If Exit SubEnd IfEnd Sub

Private Sub Form_Load()On Error GoTo errWith MSComm1 .CommPort = 8 .Settings = "9600,N,8,1" .Handshaking = comRTS .RTSEnable = True .DTREnable = True .RThreshold = 1 .SThreshold = 1 .InputMode = comInputModeText .InputLen = 0 .PortOpen = True 'must be the lastEnd Witherr: MsgBox err.DescriptionEnd Sub

Private Sub MSComm1_OnComm()Me.List1.AddItem MSComm1.InputEnd Sub

Private Sub txtidnumber_Change()Call searchenrolleesEnd Sub

Private Sub txtidnumber_KeyPress(KeyAscii As Integer)Data = "1234567890"If KeyAscii < 26 Then KeyAscii = KeyAsciiElse If InStr(Data, Chr(KeyAscii)) = 0 Then KeyAscii = 0 Exit SubEnd IfEnd IfEnd Sub

PaymentInformationReportForm

Public Sub getall()ConnectSet rs = Nothingrs.Open "select * from tblpaymenthistory", con, adOpenDynamic, adLockOptimisticSet allpaymentinformation.DataSource = rsallpaymentinformation.ShowEnd Sub

Public Sub getyearlevel()ConnectSet rs = Nothingrs.Open "select * from tblpaymenthistory where yearlevel='" & txtlist.Text & "'", con, adOpenDynamic, adLockOptimisticSet yearlevelpaymentinformation.DataSource = rsyearlevelpaymentinformation.ShowEnd Sub

Public Sub getstudent()ConnectSet rs = Nothingrs.Open "select * from tblpaymenthistory where studentid='" & txtlist.Text & "'", con, adOpenDynamic, adLockOptimisticSet studentpaymentinformation.DataSource = rsstudentpaymentinformation.ShowEnd Sub

Public Sub fillyearlevel()txtlist.ClearSet rs = Nothingrs.Open "select * from tblyearlevel", con, adOpenDynamic, adLockOptimistic

Do While Not rs.EOFtxtlist.AddItem rs.Fields!yearlevelrs.MoveNextLooprs.CloseEnd Sub

Public Sub fillstudent()txtlist.ClearSet rs = Nothingrs.Open "select * from tblstudent", con, adOpenDynamic, adLockOptimistic

Do While Not rs.EOFtxtlist.AddItem rs.Fields!idnumberrs.MoveNextLooprs.CloseEnd Sub

Private Sub cmdview_Click()If Option1.Value = True Then getallIf Option2.Value = True Then getyearlevelIf Option3.Value = True Then getstudentEnd Sub

Private Sub Form_Load()

End Sub

Private Sub Option1_Click()txtlist.Cleartxtlist.Enabled = FalseEnd Sub

Private Sub Option2_Click()txtlist.Enabled = TrueCall fillyearlevelEnd Sub

Private Sub Option3_Click()txtlist.Enabled = TrueCall fillstudentEnd Sub

RemindersForm

Option ExplicitPrivate Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)Private Sub Send_SMS(Cell_no As Integer, SMS_msg As Integer)' Send an 'AT' command to the phone

message1.Text = "Sending SMS..." DoEvents MSComm1.Output = "AT" & vbCrLf Sleep 500 MSComm1.Output = "AT+CMGF=1" & vbCrLf 'This line can be removed if your modem will always be in Text Mode... Sleep 500 MSComm1.Output = "AT+CMGS=" &Chr(34) & txtguardiansnumber.Text & Chr(34) & vbCrLf 'store cell no. to modem....." Sleep 500

MSComm1.Output = SMS_msg & Chr(26) 'messages

message1.Text = "Message Sent" DoEvents

Sleep 200 'wait for 200 milliseconds... message1.Text = " Ready to recieve SMS..." DoEvents

End Sub

Private Sub mesagesent()message = txtmessage.Text' Send an 'AT' command to the phoneMSComm1.Output = "AT" & vbCrLfSleep 500MSComm1.Output = "AT+CMGF=1" & vbCrLf 'This line can be removed if your modem will always be in Text Mode...Sleep 500MSComm1.Output = "AT+CMGS=" &Chr(34) & txtguardiansnumber.Text & Chr(34) & vbCrLf 'Replace this with your mobile Phone's No.Sleep 1000MSComm1.Output = message & Chr(26)Sleep 2000

MsgBox "Message Send"

End Sub

Private Sub cmdsend_Click()If txtmessage.Text = "" ThenMsgBox "Please enter message!", , "System"ElseDo While Not rs.EOFtxtguardiansnumber.Text = rs.Fields!guardiansnumberCall Send_SMS(txtguardiansnumber.Text, txtmessage.Text)rs.MoveNextLoop

If rs.EOF = True Thenrs.MoveFirsttxtguardiansnumber.Text = rs.Fields!guardiansnumberMsgBox "All messages has been sent!", , "System"Exit SubEnd IfEnd IfEnd Sub

Private Sub Form_Activate()ConnectSet rs = Nothingrs.Open "select distinct guardiansnumber from tblstudent", con, adOpenDynamic, adLockOptimisticrs.MoveFirsttxtguardiansnumber.Text = rs.Fields!guardiansnumber '& "; " & txtguardiansnumber.TextEnd Sub

Private Sub Form_Load()On Error GoTo err'Timer1.Enabled = False

With MSComm1 .CommPort = 8 .Settings = "9600,N,8,1" .Handshaking = comRTS .RTSEnable = True .DTREnable = True .RThreshold = 1 .SThreshold = 1 .InputMode = comInputModeText .InputLen = 0 .PortOpen = True 'must be the lastEnd Witherr: MsgBox err.DescriptionEnd Sub

Private Sub MSComm1_OnComm()Me.List1.AddItem MSComm1.InputEnd Sub

'Private Sub Timer1_Timer()'Do While Not rs.EOF' Call Send_SMS(txtlist.Text, txtmessage.Text)' rs.MoveNext'Loop'End SubPrivate Sub Timer1_Timer()

End Sub

SplashForm

Private Sub Form_Load()

End Sub

Private Sub Timer1_Timer()

Dim i As IntegerStatic j As Integer

If j < 100 Then j = j + 5Else j = 0End If

For i = 0 To 4 ProgressBar1.Value = jNext

If ProgressBar1.Value = 100 ThenUnload Memainform.ShowEnd If

End Sub

StudentInfromationForm

Public Sub clear()txtidnumber.Text = ""txtlastname.Text = ""txtfirstname.Text = ""txtmiddlename.Text = ""txtextensionname.Text = ""txtyearlevel.Text = ""txtmobilenumber.Text = ""txtemailaddress.Text = ""txtgender.Text = ""txtdateofbirth.Value = Format(Now, "mm/dd/yyyy")txthousenumber.Text = ""txtstreet.Text = ""txtbarangay.Text = ""txttowncity.Text = ""txtprovince.Text = ""txtguardiansname.Text = ""txtrelationship.Text = ""txtguardiansnumber.Text = ""End Sub

Public Sub fillyearlevel()txtyearlevel.clearSet rs = Nothingrs.Open "select * from tblyearlevel", con, adOpenDynamic, adLockOptimistic

Do While Not rs.EOFtxtyearlevel.AddItem rs.Fields!yearlevelrs.MoveNextLoop

End Sub

Public Sub addstudent()rs.Fields!id = idrs.Fields!idnumber = txtidnumber.Textrs.Fields!lastname = txtlastname.Textrs.Fields!firstname = txtfirstname.Textrs.Fields!middlename = txtmiddlename.Textrs.Fields!extensionname = txtextensionname.Textrs.Fields!completename = completenamers.Fields!yearlevel = txtyearlevel.Textrs.Fields!mobilenumber = txtmobilenumber.Textrs.Fields!emailaddress = txtemailaddress.Textrs.Fields!gender = txtgender.Textrs.Fields!dateofbirth = txtdateofbirth.Valuers.Fields!dateenrolled = Format(Now, "mm/dd/yyyy")rs.Fields!totalfees = totalfeesrs.Fields!amountpaid = "0"rs.Fields!balance = totalfeesrs.Fields!housenumber = txthousenumber.Textrs.Fields!street = txtstreet.Textrs.Fields!barangay = txtbarangay.Textrs.Fields!towncity = txttowncity.Textrs.Fields!province = txtprovince.Textrs.Fields!completeaddress = txthousenumber.Text & " " & txtstreet.Text & " " &txtbarangay.Text & " " & txttowncity.Text & ", " & txtprovince.Textrs.Fields!guardiansname = txtguardiansname.Textrs.Fields!relationship = txtrelationship.Textrs.Fields!guardiansnumber = txtguardiansnumber.TextEnd Sub

Private Sub cmdsave_Click()If txtidnumber.Text = "" Then MsgBox "Please fill ID Number!", , "System" txtidnumber.SetFocusElseIf txtyearlevel.Text = "" Then MsgBox "Please select Year Level!", , "System" txtyearlevel.SetFocusElseIf txtlastname.Text = "" Then MsgBox "Please fill Last Name!", , "System" txtlastname.SetFocusElseIf txtfirstname.Text = "" Then MsgBox "Please fill First Name!", , "System" txtfirstname.SetFocusElseIf txtmiddlename.Text = "" Then MsgBox "Please fill Middle Name!", , "System" txtmiddlename.SetFocusElseIf txtmobilenumber.Text = "" Then txtmobilenumber.Text = "none"ElseIf txtgender.Text = "" Then MsgBox "Please Select Gender!", , "System" txtgender.SetFocusElseIf txtemailaddress.Text = "" Then txtemailaddress.Text = "none"ElseIf txtbarangay.Text = "" Then MsgBox "Please fill Barangay!", , "System" txtbarangay.SetFocusElseIf txttowncity.Text = "" Then MsgBox "Please fill Town/City!", , "System" txttowncity.SetFocusElseIf txtprovince.Text = "" Then MsgBox "Please fill province!", , "System" txtprovince.SetFocusElseIf txtguardiansname.Text = "" Then MsgBox "Please fill Guardian's Name!", , "System" txtguardiansname.SetFocusElseIf txtrelationship.Text = "" Then MsgBox "Please fill Relationship!", , "System" txtrelationship.SetFocusElseIf txtguardiansnumber.Text = "" Then MsgBox "Please fill Guardian's Number!", , "System" txtguardiansnumber.SetFocusElseid = "1"completename = txtfirstname.Text & " " & txtmiddlename.Text & "-" & txtlastname.Text & " " & txtextensionname.TextSet rs = New ADODB.Recordsetsql = "select * from tblstudent"rs.Open sql, con, adOpenDynamic, adLockOptimistic

If Not rs.EOF Then With rs .MoveLast id = Val(!id) + Val(1) .Close End WithEnd If

Connect rs.Open "select * from tblstudent where idnumber='" & txtidnumber.Text & "' and yearlevel='" & txtyearlevel.Text & "'", con, adOpenDynamic, adLockOptimistic

If rs.RecordCount = 1 Then MsgBox "Student already enrolled!", , "System" Call clear Else Connect sql = "select * from tblstudent" Set rs = Nothing rs.Open sql, con, adOpenDynamic, adLockOptimistic With rs .AddNew addstudent rs.Fields!entryby = mainform.StatusBar1.Panels(1).Text rs.Fields!entrydate = Now .Update End With rs.Close

Call clear End IfEnd If

End Sub

Private Sub Form_Activate()ConnectCall fillyearlevelEnd Sub

Private Sub txtbarangay_KeyPress(KeyAscii As Integer)Data = "qwertyuiopasdfghjklxcvbnmQWERTYUIOPASDFGHJKLXCVBNM- "If KeyAscii < 26 Then KeyAscii = KeyAsciiElse If InStr(Data, Chr(KeyAscii)) = 0 Then KeyAscii = 0 Exit Sub End IfEnd IfEnd Sub

Private Sub txtemailaddress_KeyPress(KeyAscii As Integer)Data = "qwertyuiopasdfghjklxcvbnmQWERTYUIOPASDFGHJKLXCVBNM-_!@#$%^&*()+=[]{}./?1234567890"If KeyAscii < 26 Then KeyAscii = KeyAsciiElse If InStr(Data, Chr(KeyAscii)) = 0 Then KeyAscii = 0 Exit Sub End IfEnd IfEnd Sub

Private Sub txtextensionname_KeyPress(KeyAscii As Integer)Data = "JSrIV"If KeyAscii < 26 Then KeyAscii = KeyAsciiElse If InStr(Data, Chr(KeyAscii)) = 0 Then KeyAscii = 0 Exit Sub End IfEnd IfEnd Sub

Private Sub txtfirstname_KeyPress(KeyAscii As Integer)Data = "qwertyuiopasdfghjklxcvbnmQWERTYUIOPASDFGHJKLXCVBNM- "If KeyAscii < 26 Then KeyAscii = KeyAsciiElse If InStr(Data, Chr(KeyAscii)) = 0 Then KeyAscii = 0 Exit Sub End IfEnd IfEnd Sub

Private Sub txtguardiansname_KeyPress(KeyAscii As Integer)Data = "qwertyuiopasdfghjklxcvbnmQWERTYUIOPASDFGHJKLXCVBNM- "If KeyAscii < 26 Then KeyAscii = KeyAsciiElse If InStr(Data, Chr(KeyAscii)) = 0 Then KeyAscii = 0 Exit Sub End IfEnd IfEnd Sub

Private Sub txtguardiansnumber_KeyPress(KeyAscii As Integer)Data = "1234567890+"If KeyAscii < 26 Then KeyAscii = KeyAsciiElse If InStr(Data, Chr(KeyAscii)) = 0 Then KeyAscii = 0 Exit Sub End IfEnd IfEnd Sub

Private Sub txthousenumber_KeyPress(KeyAscii As Integer)Data = "2345678901"If KeyAscii < 26 Then KeyAscii = KeyAsciiElse If InStr(Data, Chr(KeyAscii)) = 0 Then KeyAscii = 0 Exit Sub End IfEnd IfEnd Sub

Private Sub txtidnumber_KeyPress(KeyAscii As Integer)Data = "1234567890"If KeyAscii < 26 Then KeyAscii = KeyAsciiElse If InStr(Data, Chr(KeyAscii)) = 0 Then KeyAscii = 0 Exit Sub End IfEnd IfEnd Sub

Private Sub txtlastname_KeyPress(KeyAscii As Integer)Data = "qwertyuiopasdfghjklxcvbnmQWERTYUIOPASDFGHJKLXCVBNM- "If KeyAscii < 26 Then KeyAscii = KeyAsciiElse If InStr(Data, Chr(KeyAscii)) = 0 Then KeyAscii = 0 Exit Sub End IfEnd IfEnd Sub

Private Sub txtmiddlename_KeyPress(KeyAscii As Integer)Data = "qwertyuiopasdfghjklxcvbnmQWERTYUIOPASDFGHJKLXCVBNM- "If KeyAscii < 26 Then KeyAscii = KeyAsciiElse If InStr(Data, Chr(KeyAscii)) = 0 Then KeyAscii = 0 Exit Sub End IfEnd IfEnd Sub

Private Sub txtmobilenumber_KeyPress(KeyAscii As Integer)Data = "1234567890+"If KeyAscii < 26 Then KeyAscii = KeyAsciiElse If InStr(Data, Chr(KeyAscii)) = 0 Then KeyAscii = 0 Exit Sub End IfEnd IfEnd Sub

Private Sub txtprovince_KeyPress(KeyAscii As Integer)Data = "qwertyuiopasdfghjklxcvbnmQWERTYUIOPASDFGHJKLXCVBNM- "If KeyAscii < 26 Then KeyAscii = KeyAsciiElse If InStr(Data, Chr(KeyAscii)) = 0 Then KeyAscii = 0 Exit Sub End IfEnd IfEnd Sub

Private Sub txtrelationship_KeyPress(KeyAscii As Integer)Data = "qwertyuiopasdfghjklxcvbnmQWERTYUIOPASDFGHJKLXCVBNM- "If KeyAscii < 26 Then KeyAscii = KeyAsciiElse If InStr(Data, Chr(KeyAscii)) = 0 Then KeyAscii = 0 Exit Sub End IfEnd IfEnd Sub

Private Sub txtstreet_KeyPress(KeyAscii As Integer)Data = "qwertyuiopasdfghjklxcvbnmQWERTYUIOPASDFGHJKLXCVBNM- "If KeyAscii < 26 Then KeyAscii = KeyAsciiElse If InStr(Data, Chr(KeyAscii)) = 0 Then KeyAscii = 0 Exit Sub End IfEnd IfEnd Sub

Private Sub txttowncity_KeyPress(KeyAscii As Integer)Data = "qwertyuiopasdfghjklxcvbnmQWERTYUIOPASDFGHJKLXCVBNM- "If KeyAscii < 26 Then KeyAscii = KeyAsciiElse If InStr(Data, Chr(KeyAscii)) = 0 Then KeyAscii = 0 Exit Sub End IfEnd IfEnd SubSystemNumberForm

Public Sub systemnumber()

systemnumberid = "1"On Error Resume NextConnectSet rs = New ADODB.Recordsetrs.Open "select * from tblsystemnumber", con, adOpenDynamic, adLockOptimistic

If rs.RecordCount = 0 Then cmdsave.Caption = "&Save"Else systemnumberid = rs.Fields!systemnumberid txtsystemnumber.Text = rs.Fields!systemnumber txtentryby.Text = rs.Fields!entryby txtentrydate.Text = rs.Fields!entrydate txtupdatedby.Text = rs.Fields!updatedby txtlastupdate.Text = rs.Fields!lastupdate cmdsave.Caption = "&Update"End If

mainform.StatusBar1.Panels(2).Text = rs.Fields!systemnumber

End Sub

Private Sub cmdsave_Click()If txtsystemnumber.Text = "" Then MsgBox "System Number Required!", , "System" txtsystemnumber.SetFocusElseIf cmdsave.Caption = "&Save" Then Connect sql = "select * from tblsystemnumber" Set rs = New ADODB.connection rs.Open sql, con, adOpenDynamic, adLockOptimistic With rs .AddNew rs.Fields!systemnumberid = systemnumberid rs.Fields!systemnumber = txtsystemnumber.Text rs.Fields!entryby = mainform.StatusBar1.Panels(1).Text rs.Fields!entrydate = Now .Update End With Unload Me MsgBox "System Number successfully saved!", vbInformation, "System" systemnumberform.ShowElse con.Execute "update tblsystemnumber set" & vbCrLf & _ "systemnumber='" & txtsystemnumber.Text & "'," & vbCrLf & _ "updatedby='" & mainform.StatusBar1.Panels(1).Text & "'," & vbCrLf & _ "lastupdate='" & Now & "'" & vbCrLf & _ "where systemnumberid='" & systemnumberid & "'" Unload Me MsgBox "System Number successfully updated!", vbInformation, "System" systemnumberform.ShowEnd IfEnd IfEnd Sub

Private Sub Form_Activate()

Call systemnumber

End Sub

Private Sub txtsystemnumber_KeyPress(KeyAscii As Integer)Data = "1234567890+"If KeyAscii < 26 Then KeyAscii = KeyAsciiElse If InStr(Data, Chr(KeyAscii)) = 0 Then KeyAscii = 0 Exit Sub End IfEnd IfEnd Sub

UpdateEnrolleeForm

Public Sub fillyearlevel()Set rs = Nothingrs.Open "select * from tblyearlevel", con, adOpenDynamic, adLockOptimistic

Do While Not rs.EOFtxtyearlevel.AddItem rs.Fields!yearlevelrs.MoveNextLooprs.CloseEnd Sub

Private Sub cmdupdate_Click()If txtidnumber.Text = "" Then MsgBox "Please fill ID Number!", , "System" txtidnumber.SetFocusElseIf txtyearlevel.Text = "" Then MsgBox "Please select Year Level!", , "System" txtyearlevel.SetFocusElseIf txtlastname.Text = "" Then MsgBox "Please fill Last Name!", , "System" txtlastname.SetFocusElseIf txtfirstname.Text = "" Then MsgBox "Please fill First Name!", , "System" txtfirstname.SetFocusElseIf txtmiddlename.Text = "" Then MsgBox "Please fill Middle Name!", , "System" txtmiddlename.SetFocusElseIf txtmobilenumber.Text = "" Then MsgBox "Please fill Mobile Number!", , "System" txtmobilenumber.SetFocusElseIf txtgender.Text = "" Then MsgBox "Please Select Gender!", , "System" txtgender.SetFocusElseIf txtemailaddress.Text = "" Then txtemailaddress.Text = "none"ElseIf txtbarangay.Text = "" Then MsgBox "Please fill Barangay!", , "System" txtbarangay.SetFocusElseIf txttowncity.Text = "" Then MsgBox "Please fill Town/City!", , "System" txttowncity.SetFocusElseIf txtprovince.Text = "" Then MsgBox "Please fill province!", , "System" txtprovince.SetFocusElseIf txtguardiansname.Text = "" Then MsgBox "Please fill Guardian's Name!", , "System" txtguardiansname.SetFocusElseIf txtrelationship.Text = "" Then MsgBox "Please fill Relationship!", , "System" txtrelationship.SetFocusElseIf txtguardiansnumber.Text = "" Then MsgBox "Please fill Guardian's Number!", , "System" txtguardiansnumber.SetFocusElseIf txtamountpaid.Text = "" Then txtamountpaid.Text = "0"Elsecompletename = txtfirstname.Text & " " & txtmiddlename.Text & "-" & txtlastname.Text & " " & txtextensionname.Textcompleteaddress = txthousenumber.Text & ", " & txtstreet.Text & ", " & txtbarangay.Text & ", " & txttowncity.Text & ", " & txtprovince.Text con.Execute "update tblstudent set" & vbCrLf & _ "firstname='" & txtfirstname.Text & "'," & vbCrLf & _ "lastname='" & txtlastname.Text & "'," & vbCrLf & _ "middlename='" & txtmiddlename.Text & "'," & vbCrLf & _ "extensionname='" & txtextensionname.Text & "'," & vbCrLf & _ "completename='" & completename & "'," & vbCrLf & _ "dateofbirth='" & txtdateofbirth.Value & "'," & vbCrLf & _ "mobilenumber='" & txtmobilenumber.Text & "'," & vbCrLf & _ "gender='" & txtgender.Text & "'," & vbCrLf & _ "emailaddress='" & txtemailaddress.Text & "'," & vbCrLf & _ "housenumber='" & txthousenumber.Text & "'," & vbCrLf & _ "street='" & txtstreet.Text & "'," & vbCrLf & _ "barangay='" & txtbarangay.Text & "'," & vbCrLf & _ "towncity='" & txttowncity.Text & "'," & vbCrLf & _ "province='" & txtprovince.Text & "'," & vbCrLf & _ "guardiansname='" & txtguardiansname.Text & "'," & vbCrLf & _ "relationship='" & txtrelationship.Text & "'," & vbCrLf & _ "guardiansnumber='" & txtguardiansnumber.Text & "'," & vbCrLf & _ "completeaddress='" & completeaddress & "'," & vbCrLf & _ "yearlevel='" & txtyearlevel.Text & "'," & vbCrLf & _ "updatedby='" & mainform.StatusBar1.Panels(1).Text & "'," & vbCrLf & _ "lastupdate='" & Now & "'" & vbCrLf & _ "where idnumber='" & txtidnumber.Text & "'" MsgBox "Enrollee successfully updated!", vbInformation, "System" Unload Me enrolleemasterlistform.ShowEnd IfEnd Sub

Private Sub Form_Activate()Call fillyearlevelEnd Sub

Private Sub Form_Unload(Cancel As Integer)enrolleemasterlistform.ShowEnd Sub

Private Sub txtamountpaid_KeyPress(KeyAscii As Integer)Data = "1234567890"If KeyAscii < 26 Then KeyAscii = KeyAsciiElse If InStr(Data, Chr(KeyAscii)) = 0 Then KeyAscii = 0 Exit Sub End IfEnd IfEnd Sub

Private Sub txtbarangay_KeyPress(KeyAscii As Integer)Data = "qwertyuiopasdfghjklxcvbnmQWERTYUIOPASDFGHJKLXCVBNM- "If KeyAscii < 26 Then KeyAscii = KeyAsciiElse If InStr(Data, Chr(KeyAscii)) = 0 Then KeyAscii = 0 Exit Sub End IfEnd IfEnd Sub

Private Sub txtemailaddress_KeyPress(KeyAscii As Integer)Data = "qwertyuiopasdfghjklxcvbnmQWERTYUIOPASDFGHJKLXCVBNM-_!@#$%^&*()+=[]{}./?1234567890"If KeyAscii < 26 Then KeyAscii = KeyAsciiElse If InStr(Data, Chr(KeyAscii)) = 0 Then KeyAscii = 0 Exit Sub End IfEnd IfEnd Sub

Private Sub txtextensionname_KeyPress(KeyAscii As Integer)Data = "JSrIV"If KeyAscii < 26 Then KeyAscii = KeyAsciiElse If InStr(Data, Chr(KeyAscii)) = 0 Then KeyAscii = 0 Exit Sub End IfEnd IfEnd Sub

Private Sub txtfirstname_KeyPress(KeyAscii As Integer)Data = "qwertyuiopasdfghjklxcvbnmQWERTYUIOPASDFGHJKLXCVBNM- "If KeyAscii < 26 Then KeyAscii = KeyAsciiElse If InStr(Data, Chr(KeyAscii)) = 0 Then KeyAscii = 0 Exit Sub End IfEnd IfEnd Sub

Private Sub txtguardiansname_KeyPress(KeyAscii As Integer)Data = "qwertyuiopasdfghjklxcvbnmQWERTYUIOPASDFGHJKLXCVBNM- "If KeyAscii < 26 Then KeyAscii = KeyAsciiElse If InStr(Data, Chr(KeyAscii)) = 0 Then KeyAscii = 0 Exit Sub End IfEnd IfEnd Sub

Private Sub txtguardiansnumber_KeyPress(KeyAscii As Integer)Data = "1234567890+"If KeyAscii < 26 Then KeyAscii = KeyAsciiElse If InStr(Data, Chr(KeyAscii)) = 0 Then KeyAscii = 0 Exit Sub End IfEnd IfEnd Sub

Private Sub txthousenumber_KeyPress(KeyAscii As Integer)Data = "2345678901"If KeyAscii < 26 Then KeyAscii = KeyAsciiElse If InStr(Data, Chr(KeyAscii)) = 0 Then KeyAscii = 0 Exit Sub End IfEnd IfEnd Sub

Private Sub txtidnumber_KeyPress(KeyAscii As Integer)Data = "1234567890"If KeyAscii < 26 Then KeyAscii = KeyAsciiElse If InStr(Data, Chr(KeyAscii)) = 0 Then KeyAscii = 0 Exit Sub End IfEnd IfEnd Sub

Private Sub txtlastname_KeyPress(KeyAscii As Integer)Data = "qwertyuiopasdfghjklxcvbnmQWERTYUIOPASDFGHJKLXCVBNM- "If KeyAscii < 26 Then KeyAscii = KeyAsciiElse If InStr(Data, Chr(KeyAscii)) = 0 Then KeyAscii = 0 Exit Sub End IfEnd IfEnd Sub

Private Sub txtmiddlename_KeyPress(KeyAscii As Integer)Data = "qwertyuiopasdfghjklxcvbnmQWERTYUIOPASDFGHJKLXCVBNM- "If KeyAscii < 26 Then KeyAscii = KeyAsciiElse If InStr(Data, Chr(KeyAscii)) = 0 Then KeyAscii = 0 Exit Sub End IfEnd IfEnd Sub

Private Sub txtmobilenumber_KeyPress(KeyAscii As Integer)Data = "1234567890+"If KeyAscii < 26 Then KeyAscii = KeyAsciiElse If InStr(Data, Chr(KeyAscii)) = 0 Then KeyAscii = 0 Exit Sub End IfEnd IfEnd Sub

Private Sub txtprovince_KeyPress(KeyAscii As Integer)Data = "qwertyuiopasdfghjklxcvbnmQWERTYUIOPASDFGHJKLXCVBNM- "If KeyAscii < 26 Then KeyAscii = KeyAsciiElse If InStr(Data, Chr(KeyAscii)) = 0 Then KeyAscii = 0 Exit Sub End IfEnd IfEnd Sub

Private Sub txtrelationship_KeyPress(KeyAscii As Integer)Data = "qwertyuiopasdfghjklxcvbnmQWERTYUIOPASDFGHJKLXCVBNM- "If KeyAscii < 26 Then KeyAscii = KeyAsciiElse If InStr(Data, Chr(KeyAscii)) = 0 Then KeyAscii = 0 Exit Sub End IfEnd IfEnd Sub

Private Sub txtstreet_KeyPress(KeyAscii As Integer)Data = "qwertyuiopasdfghjklxcvbnmQWERTYUIOPASDFGHJKLXCVBNM- "If KeyAscii < 26 Then KeyAscii = KeyAsciiElse If InStr(Data, Chr(KeyAscii)) = 0 Then KeyAscii = 0 Exit Sub End IfEnd IfEnd Sub

Private Sub txttowncity_KeyPress(KeyAscii As Integer)Data = "qwertyuiopasdfghjklxcvbnmQWERTYUIOPASDFGHJKLXCVBNM- "If KeyAscii < 26 Then KeyAscii = KeyAsciiElse If InStr(Data, Chr(KeyAscii)) = 0 Then KeyAscii = 0 Exit Sub End IfEnd IfEnd Sub

UserMaintenanceForm

Private Sub getuser()ListView1.ListItems.ClearConnectsql = "select * from tblusers"Set rs = New ADODB.Recordsetrs.Open sql, con, adOpenDynamic, adLockOptimistic

Do Until rs.EOF With ListView1.ListItems.Add(, , rs!id) .SubItems(1) = rs!userid .SubItems(2) = rs!longname .SubItems(3) = rs!usertype End With rs.MoveNextLooprs.CloseEnd Sub

Private Sub edituser()On Error Resume Next

ConnectSet rs = New ADODB.Recordsetrs.Open "select * from tblusers where id='" & ListView1.SelectedItem.Text & "'", con, adOpenDynamic, adLockOptimisticWith addupdateuserform .Caption = "Edit User - " & rs.Fields!userid .txtuserid.Text = rs.Fields!userid .txtfirstname.Text = rs.Fields!firstname .txtlastname.Text = rs.Fields!lastname .txtmi.Text = rs.Fields!mi .txtextensionname.Text = rs.Fields!extensionname .txtlongname.Text = rs.Fields!longname .txtusertype.Text = rs.Fields!usertype .txtlogonpassword.Text = rs.Fields!Password .txtentryby.Text = rs.Fields!entryby .txtentrydate.Text = rs.Fields!entrydate .txtupdatedby.Text = rs.Fields!updatedby .txtlastupdate.Text = rs.Fields!lastupdate .cmdsave.Caption = "&Update" .txtuserid.Enabled = FalseEnd Withrs.Close

End Sub

Private Sub cmdadd_Click()addupdateuserform.Caption = "Add User"addupdateuserform.ShowUnload MeEnd Sub

Private Sub cmddelete_Click()If vbYes = MsgBox("Are you sure you want to delete " & ListView1.SelectedItem.SubItems(1) & "?", vbQuestion + vbYesNo, "System") Then con.Execute "delete from tblusers where userid='" & ListView1.SelectedItem.SubItems(1) & "'" MsgBox "" & ListView1.SelectedItem.SubItems(1) & " successfully deleted!", vbInformation, "System" ListView1.ListItems.Clear Call getuserElse ListView1.ListItems.Clear Call getuserEnd IfEnd Sub

Private Sub cmdedit_Click()Call edituserUnload MeEnd Sub

Private Sub Form_Load()Call getuserEnd Sub

Private Sub ListView1_DblClick()Call edituserUnload MeEnd Sub

UserTypeForm

Private Sub getusertype()ListView1.ListItems.ClearConnectsql = "select * from tblusertype"Set rs = New ADODB.Recordsetrs.Open sql, con, adOpenDynamic, adLockOptimistic

Do Until rs.EOF With ListView1.ListItems.Add(, , rs!usertypeid) .SubItems(1) = rs!usertype End With rs.MoveNextLooprs.CloseEnd Sub

Private Sub editusertype()On Error Resume Nextid = ListView1.SelectedItem.TextConnectSet rs = New ADODB.Recordsetrs.Open "select * from tblusertype where usertypeid='" & ListView1.SelectedItem.Text & "'", con, adOpenDynamic, adLockOptimisticWith addupdateusertypeform .Caption = "Edit Usertype" .txtusertype.Text = rs.Fields!usertype .cmdsave.Caption = "&Update"End Withrs.Close

End Sub

Private Sub cmdadd_Click()addupdateusertypeform.Caption = "Add User"addupdateusertypeform.ShowUnload MeEnd Sub

Private Sub cmddelete_Click()If vbYes = MsgBox("Are you sure you want to delete " & ListView1.SelectedItem.SubItems(1) & "?", vbQuestion + vbYesNo, "System") Then con.Execute "delete from tblusertype where usertypeid='" & ListView1.SelectedItem.Text & "'" MsgBox "" & ListView1.SelectedItem.SubItems(1) & " successfully deleted!", vbInformation, "System" ListView1.ListItems.Clear Call getusertypeElse ListView1.ListItems.Clear Call getusertypeEnd IfEnd Sub

Private Sub cmdedit_Click()Call editusertypeUnload MeEnd Sub

Private Sub Form_Load()Call getusertypeEnd Sub

Private Sub ListView1_DblClick()Call editusertypeUnload MeEnd Sub

YearLevelForm

Private Sub getyearlevel()ListView1.ListItems.ClearConnectsql = "select * from tblyearlevel"Set rs = New ADODB.Recordsetrs.Open sql, con, adOpenDynamic, adLockOptimistic

Do Until rs.EOF With ListView1.ListItems.Add(, , rs!yearlevelid) .SubItems(1) = rs!yearlevel End With rs.MoveNextLooprs.CloseEnd Sub

Private Sub edityearlevel()On Error Resume Nextid = ListView1.SelectedItem.TextConnectSet rs = New ADODB.Recordsetrs.Open "select * from tblyearlevel where yearlevelid='" & ListView1.SelectedItem.Text & "'", con, adOpenDynamic, adLockOptimisticWith addupdateyearlevelform .Caption = "Edit Year Level" .txtyearlevel.Text = rs.Fields!yearlevel .cmdsave.Caption = "&Update"End Withrs.Close

End Sub

Private Sub cmdadd_Click()addupdateyearlevelform.Caption = "Add Year Level"addupdateyearlevelform.ShowUnload MeEnd Sub

Private Sub cmddelete_Click()If vbYes = MsgBox("Are you sure you want to delete " & ListView1.SelectedItem.SubItems(1) & "?", vbQuestion + vbYesNo, "System") Then con.Execute "delete from tblyearlevel where yearlevelid='" & ListView1.SelectedItem.Text & "'" MsgBox "" & ListView1.SelectedItem.SubItems(1) & " successfully deleted!", vbInformation, "System" ListView1.ListItems.Clear Call getyearlevelElse ListView1.ListItems.Clear Call getyearlevelEnd IfEnd Sub

Private Sub cmdedit_Click()Call edityearlevelUnload MeEnd Sub

Private Sub Form_Load()Call getyearlevelEnd Sub

Private Sub ListView1_DblClick()Call edityearlevelUnload MeEnd Sub

Bachelor of Science in Information TechnologyPage 37