0% found this document useful (0 votes)
149 views75 pages

SMS-Based Student Monitoring Code

This document contains source code for a student account monitoring system developed as a college project. It includes code for login authentication, a main form interface, adding/updating user accounts and user types, and other system functions. The code is written in Visual Basic and uses objects, properties, and methods to manage database queries and user interface elements.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
149 views75 pages

SMS-Based Student Monitoring Code

This document contains source code for a student account monitoring system developed as a college project. It includes code for login authentication, a main form interface, adding/updating user accounts and user types, and other system functions. The code is written in Visual Basic and uses objects, properties, and methods to manage database queries and user interface elements.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

ISABELA STATE UNIVERSITY

Cauayan Campus
Cauayan City, Isabela
COLLEGE OF COMPUTING AND INFORMATION TECHNOLOGY

RELEVANT SOURCE CODE

Bachelor of Science in Information TechnologyPage 1

ISABELA STATE UNIVERSITY


Cauayan Campus
Cauayan City, Isabela
COLLEGE OF COMPUTING AND INFORMATION TECHNOLOGY

APPENDIX I
RELEVANT SOURCE CODE
Project Name:
System Code:
TTS
A SMS-Based Student Account
Monitoring System
Sub-System:

Sub-Sytem
Code:

Date: September
2014

RSC
Authors:
Socrates C. Ariola
Paulo I. Guillermo
Paul John S. Solomon
Page
1 of 74

Log in form
Private Sub cmdcancel_Click()
Unload Me
End Sub
Private Sub cmdok_Click()
Connect
sql = "select * from tblusers where userid='" & LCase([Link]) & "'"
Set rs = New [Link]
[Link] sql, con, adOpenDynamic, adLockOptimistic
If [Link] = 0 Then
MsgBox "User ID not found!", vbInformation, "System"
[Link]
[Link] = ""
[Link] = ""
ElseIf [Link] = 1 And [Link]!Password <> LCase([Link]) Then
MsgBox "Password Incorect!", vbInformation, "System"
[Link]
[Link] = ""
Else
With mainform.StatusBar1
.Panels(1).Text = [Link]!longname
End With
Connect
Set rs = Nothing
[Link] "select * from tblusers where userid='" & LCase([Link]) & "'", con,
adOpenDynamic, adLockOptimistic
If [Link]!usertype = "Admin" Then
[Link] = True
Bachelor of Science in Information TechnologyPage 2

ISABELA STATE UNIVERSITY


Cauayan Campus
Cauayan City, Isabela
COLLEGE OF COMPUTING AND INFORMATION TECHNOLOGY
Else
[Link] = False
End If
Unload Me
[Link]
End If
End Sub
Private Sub Timer1_Timer()
[Link] = "Log on @ " & "[" & Format(Now) & "]"
End Sub
Private Sub txtpassword_GotFocus()
[Link] = &H80FFFF
End Sub
Private Sub txtpassword_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then Call cmdok_Click
End Sub
Private Sub txtpassword_LostFocus()
[Link] = &H8000000F
End Sub
Private Sub txtuserid_GotFocus()
[Link] = &H80FFFF
End Sub
Private Sub txtuserid_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then Call cmdok_Click
End Sub
Private Sub txtuserid_LostFocus()
[Link] = &H8000000F
End Sub
Main Form
Private Sub cmdadd_Click()
[Link]
End Sub
Private Sub cmdenroll_Click()
[Link] 1, mainform
End Sub
Bachelor of Science in Information TechnologyPage 3

ISABELA STATE UNIVERSITY


Cauayan Campus
Cauayan City, Isabela
COLLEGE OF COMPUTING AND INFORMATION TECHNOLOGY

Private Sub cmdpay_Click()


[Link] 1, mainform
End Sub
Private Sub cmdremind_Click()
[Link] 1, mainform
End Sub
Private Sub MDIForm_Load()
Connect
sql = "select * from tblsystemnumber"
Set rs = New [Link]
[Link] sql, con, adOpenDynamic, adLockOptimistic
[Link](2).Text = [Link]!systemnumber
End Sub
Private Sub MDIForm_Unload(Cancel As Integer)
If vbYes = MsgBox("Are you sure you want exit?", vbQuestion + vbYesNo, "System")
Then
Unload Me
Else
Cancel = True
End If
End Sub
Private Sub mnuabout_Click()
[Link]
End Sub
Private Sub mnuenrollee_Click()
[Link]
End Sub
Private Sub mnuenrolleemasterlistreport_Click()
[Link]
End Sub
Private Sub mnuassestmentform_Click()
[Link]
End Sub

Bachelor of Science in Information TechnologyPage 4

ISABELA STATE UNIVERSITY


Cauayan Campus
Cauayan City, Isabela
COLLEGE OF COMPUTING AND INFORMATION TECHNOLOGY
Private Sub mnuenrollees_Click()
[Link]
End Sub
Private Sub mnuenrollment_Click()
[Link] 1, mainform
End Sub
Private Sub mnuexaminationschedules_Click()
[Link]
End Sub
Private Sub mnuexit_Click()
Unload Me
End Sub
Private Sub mnulogoff_Click()
Unload Me
[Link]
End Sub
Private Sub mnumessages_Click()
[Link]
End Sub
Private Sub mnupayment_Click()
[Link] 1, mainform
End Sub
Private Sub mnupaymentbreakdown_Click()
[Link]
End Sub
Private Sub mnupaymentinformationreport_Click()
[Link]
End Sub
Private Sub mnupaymentinformation_Click()
[Link]
End Sub
Private Sub mnupayments_Click()
[Link]
End Sub

Bachelor of Science in Information TechnologyPage 5

ISABELA STATE UNIVERSITY


Cauayan Campus
Cauayan City, Isabela
COLLEGE OF COMPUTING AND INFORMATION TECHNOLOGY
Private Sub mnureminders_Click()
[Link] 1, mainform
End Sub
Private Sub mnustudentifnformation_Click()
[Link]
End Sub
Private Sub mnusystemnumber_Click()
[Link]
End Sub
Private Sub mnuusermaintenance_Click()
[Link]
End Sub
Private Sub mnuusertype_Click()
[Link]
End Sub
Private Sub mnuyearlevel_Click()
[Link]
End Sub
AddUpdateUserType
Public Sub addusertype()
[Link]!usertypeid = id
[Link]!usertype = [Link]
End Sub
Private Sub cmdsave_Click()
If [Link] = "" Then
MsgBox "Please fill User Type!", , "System"
[Link]
Else
If [Link] = "&Save" Then
id = "1"
Set rs = New [Link]
sql = "select * from tblusertype"
[Link] sql, con, adOpenDynamic, adLockOptimistic
If Not [Link] Then
With rs
.MoveLast
id = Val(!usertypeid) + Val(1)
Bachelor of Science in Information TechnologyPage 6

ISABELA STATE UNIVERSITY


Cauayan Campus
Cauayan City, Isabela
COLLEGE OF COMPUTING AND INFORMATION TECHNOLOGY
.Close
End With
End If
Connect
[Link] "select * from tblusertype where usertype='" & txtusertype & "'", con,
adOpenDynamic, adLockOptimistic
If [Link] = 1 Then
MsgBox "Usertype already exist!", , "System"
[Link] = ""
[Link]
Else
Connect
sql = "select * from tblusertype"
Set rs = Nothing
[Link] sql, con, adOpenDynamic, adLockOptimistic
With rs
.AddNew
addusertype
.Update
End With
MsgBox "Usertype successfully saved!", vbInformation, "System"
Unload Me
[Link]
End If
Else
[Link] "update tblusertype set" & vbCrLf & _
"usertype='" & [Link] & "'" & vbCrLf & _
"where usertypeid='" & id & "'"
MsgBox "Usertype successfully updated!", vbInformation, "System"
Unload Me
[Link]
End If
End If
End Sub
Private Sub Form_Unload(Cancel As Integer)
[Link]
End Sub
Private Sub txtusertype_KeyPress(KeyAscii As Integer)
Data = "qwertyuiopasdfghjklxcvbnmQWERTYUIOPASDFGHJKLXCVBNM"
If KeyAscii < 26 Then
KeyAscii = KeyAscii
Else
Bachelor of Science in Information TechnologyPage 7

ISABELA STATE UNIVERSITY


Cauayan Campus
Cauayan City, Isabela
COLLEGE OF COMPUTING AND INFORMATION TECHNOLOGY
If InStr(Data, Chr(KeyAscii)) = 0 Then
KeyAscii = 0
Exit Sub
End If
End If
End Sub
AddUpdateUserForm
Public Sub fillusertype()
Set rs = New [Link]
[Link] "select * from tblusertype", con, adOpenDynamic, adLockOptimistic
Do While Not [Link]
[Link] [Link]!usertype
[Link]
Loop
[Link]
End Sub
Public Sub adduser()
[Link]!id = id
[Link]!userid = [Link]
[Link]!lastname = [Link]
[Link]!firstname = [Link]
[Link]!mi = [Link]
[Link]!extensionname = [Link]
[Link]!longname = [Link]
[Link]!usertype = [Link]
[Link]!Password = [Link]
[Link]!entryby = [Link](1).Text
[Link]!entrydate = Now
End Sub
Private Sub Check1_Click()
If [Link] = 1 Then
[Link] = ""
Else
[Link] = "*"
End If
End Sub
Private Sub cmdsave_Click()
If [Link] = "" Then
MsgBox "Please fill User ID!", , "System"
[Link]
Bachelor of Science in Information TechnologyPage 8

ISABELA STATE UNIVERSITY


Cauayan Campus
Cauayan City, Isabela
COLLEGE OF COMPUTING AND INFORMATION TECHNOLOGY
ElseIf [Link] = "" Then
MsgBox "Please fill First Name", , "System"
[Link]
ElseIf [Link] = "" Then
MsgBox "Please fill Last Name!", , "System"
[Link]
ElseIf [Link] = "" Then
MsgBox "Please fill Middle Initial!", , "System"
[Link]
ElseIf [Link] = "" Then
MsgBox "Please select User Type!", , "System"
[Link]
ElseIf [Link] = "" Then
MsgBox "Please fill Logon Password!", , "System"
[Link]
Else
If [Link] = "&Save" Then
Connect
[Link] "select * from tblusers where userid='" & [Link] & "'", con,
adOpenDynamic, adLockOptimistic
If [Link] = 1 Then
MsgBox "User ID already exist!", , "System"
[Link] = ""
[Link]
Else
id = "1"
Set rs = New [Link]
sql = "select * from tblstudent"
[Link] sql, con, adOpenDynamic, adLockOptimistic
If Not [Link] Then
With rs
.MoveLast
id = Val(!id) + Val(1)
.Close
End With
End If
Connect
sql = "select * from tblusers"
Set rs = Nothing
[Link] sql, con, adOpenDynamic, adLockOptimistic
With rs
.AddNew
adduser
Bachelor of Science in Information TechnologyPage 9

ISABELA STATE UNIVERSITY


Cauayan Campus
Cauayan City, Isabela
COLLEGE OF COMPUTING AND INFORMATION TECHNOLOGY
[Link]!entryby = [Link](1).Text
[Link]!entrydate = Now
.Update
End With
MsgBox "User successfully saved!", vbInformation, "System"
Unload Me
[Link]
End If
Else
[Link] "update tblusers set" & vbCrLf & _
"firstname='" & [Link] & "'," & vbCrLf & _
"lastname='" & [Link] & "'," & vbCrLf & _
"mi='" & [Link] & "'," & vbCrLf & _
"extensionname='" & [Link] & "'," & vbCrLf & _
"usertype='" & [Link] & "'," & vbCrLf & _
"longname='" & [Link] & "'," & vbCrLf & _
"password='" & [Link] & "'," & vbCrLf & _
"updatedby='" & [Link](1).Text & "'," & vbCrLf & _
"lastupdate='" & Now & "'" & vbCrLf & _
"where userid='" & [Link] & "'"
MsgBox "User successfully updated!", vbInformation, "System"
Unload Me
[Link]
End If
End If
End Sub
Private Sub Form_Activate()
Call fillusertype
End Sub
Private Sub Form_Unload(Cancel As Integer)
[Link]
End Sub

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


End Sub
Private Sub txtextensionname_Change()
[Link] = [Link] & " " & [Link] & " " & [Link] & " " &
[Link]
End Sub
Private Sub txtextensionname_KeyPress(KeyAscii As Integer)
Bachelor of Science in Information TechnologyPage 10

ISABELA STATE UNIVERSITY


Cauayan Campus
Cauayan City, Isabela
COLLEGE OF COMPUTING AND INFORMATION TECHNOLOGY
Data = "JSrIV"
If KeyAscii < 26 Then
KeyAscii = KeyAscii
Else
If InStr(Data, Chr(KeyAscii)) = 0 Then
KeyAscii = 0
Exit Sub
End If
End If
End Sub
Private Sub txtfirstname_Change()
[Link] = [Link] & " " & [Link] & " " & [Link] & " " &
[Link]
End Sub
Private Sub txtfirstname_KeyPress(KeyAscii As Integer)
Data = "qwertyuiopasdfghjklxcvbnmQWERTYUIOPASDFGHJKLXCVBNM- "
If KeyAscii < 26 Then
KeyAscii = KeyAscii
Else
If InStr(Data, Chr(KeyAscii)) = 0 Then
KeyAscii = 0
Exit Sub
End If
End If
End Sub

Private Sub txtlastname_Change()


[Link] = [Link] & " " & [Link] & " " & [Link] & " " &
[Link]
End Sub
Private Sub txtlastname_KeyPress(KeyAscii As Integer)
Data = "qwertyuiopasdfghjklxcvbnmQWERTYUIOPASDFGHJKLXCVBNM- "
If KeyAscii < 26 Then
KeyAscii = KeyAscii
Else
If InStr(Data, Chr(KeyAscii)) = 0 Then
KeyAscii = 0
Exit Sub
End If
End If
End Sub

Bachelor of Science in Information TechnologyPage 11

ISABELA STATE UNIVERSITY


Cauayan Campus
Cauayan City, Isabela
COLLEGE OF COMPUTING AND INFORMATION TECHNOLOGY
Private Sub txtlogonpassword_KeyPress(KeyAscii As Integer)
Data = "qwertyuiopasdfghjklxcvbnmQWERTYUIOPASDFGHJKLXCVBNM_1234567890"
If KeyAscii < 26 Then
KeyAscii = KeyAscii
Else
If InStr(Data, Chr(KeyAscii)) = 0 Then
KeyAscii = 0
Exit Sub
End If
End If
End Sub
Private Sub txtmi_Change()
[Link] = [Link] & " " & [Link] & " " & [Link] & " " &
[Link]
End Sub
Private Sub txtmi_KeyPress(KeyAscii As Integer)
Data = "QWERTYUIOPASDFGHJKLXCVBNM"
If KeyAscii < 26 Then
KeyAscii = KeyAscii
Else
If InStr(Data, Chr(KeyAscii)) = 0 Then
KeyAscii = 0
Exit Sub
End If
End If
End Sub
Private Sub txtuserid_KeyPress(KeyAscii As Integer)
Data = "qwertyuiopasdfghjklxcvbnm1234567890-_"
If KeyAscii < 26 Then
KeyAscii = KeyAscii
Else
If InStr(Data, Chr(KeyAscii)) = 0 Then
KeyAscii = 0
Exit Sub
End If
End If
End Sub
AddUpdateYearLevel
Public Sub addyearlevel()
[Link]!yearlevelid = id
Bachelor of Science in Information TechnologyPage 12

ISABELA STATE UNIVERSITY


Cauayan Campus
Cauayan City, Isabela
COLLEGE OF COMPUTING AND INFORMATION TECHNOLOGY
[Link]!yearlevel = [Link]
End Sub
Private Sub cmdsave_Click()
If [Link] = "" Then
MsgBox "Please fill Year Level!", , "System"
[Link]
Else
If [Link] = "&Save" Then
id = "1"
Set rs = New [Link]
sql = "select * from tblyearlevel"
[Link] sql, con, adOpenDynamic, adLockOptimistic
If Not [Link] Then
With rs
.MoveLast
id = Val(!yearlevelid) + Val(1)
.Close
End With
End If
Connect
[Link] "select * from tblyearlevel where yearlevel='" & [Link] & "'", con,
adOpenDynamic, adLockOptimistic
If [Link] = 1 Then
MsgBox "Yearlevel already exist!", , "System"
[Link] = ""
[Link]
Else
Connect
sql = "select * from tblyearlevel"
Set rs = Nothing
[Link] sql, con, adOpenDynamic, adLockOptimistic
With rs
.AddNew
addyearlevel
.Update
End With
MsgBox "Year Level successfully saved!", vbInformation, "System"
Unload Me
[Link]
End If
Else
[Link] "update tblyearlevel set" & vbCrLf & _
Bachelor of Science in Information TechnologyPage 13

ISABELA STATE UNIVERSITY


Cauayan Campus
Cauayan City, Isabela
COLLEGE OF COMPUTING AND INFORMATION TECHNOLOGY
"yearlevel='" & [Link] & "'" & vbCrLf & _
"where yearlevelid='" & id & "'"
MsgBox "Year Level successfully updated!", vbInformation, "System"
Unload Me
[Link]
End If
End If
End Sub

Private Sub Form_Unload(Cancel As Integer)


[Link]
End Sub
Private Sub txtyearlevel_KeyPress(KeyAscii As Integer)
Data = "1234567890thstndraeYG "
If KeyAscii < 26 Then
KeyAscii = KeyAscii
Else
If InStr(Data, Chr(KeyAscii)) = 0 Then
KeyAscii = 0
Exit Sub
End If
End If
End Sub
AssesmentForm

Private Sub getenrollees()


[Link]
Connect
sql = "select * from tblstudent"
Set rs = New [Link]
[Link] sql, con, adOpenDynamic, adLockOptimistic
Do Until [Link]
With [Link](, , rs!idnumber)
.SubItems(1) = rs!completename
.SubItems(2) = rs!yearlevel
.SubItems(3) = rs!dateenrolled
.SubItems(4) = rs!amountpaid
.SubItems(5) = rs!balance
End With
[Link]
Loop
Bachelor of Science in Information TechnologyPage 14

ISABELA STATE UNIVERSITY


Cauayan Campus
Cauayan City, Isabela
COLLEGE OF COMPUTING AND INFORMATION TECHNOLOGY
[Link]: Set rs = Nothing
End Sub
Private Sub searchid()
[Link]
Connect
sql = "select * from tblstudent where idnumber like '" & [Link] & "%'"
Set rs = New [Link]
[Link] sql, con, adOpenDynamic, adLockOptimistic
Do Until [Link]
With [Link](, , rs!idnumber)
.SubItems(1) = rs!completename
.SubItems(2) = rs!yearlevel
.SubItems(3) = rs!dateenrolled
.SubItems(4) = rs!amountpaid
.SubItems(5) = rs!balance
End With
[Link]
Loop
[Link]: Set rs = Nothing
End Sub
Private Sub searchlastname()
[Link]
Connect
sql = "select * from tblstudent where lastname like '" & [Link] & "%'"
Set rs = New [Link]
[Link] sql, con, adOpenDynamic, adLockOptimistic
Do Until [Link]
With [Link](, , rs!idnumber)
.SubItems(1) = rs!completename
.SubItems(2) = rs!yearlevel
.SubItems(3) = rs!dateenrolled
.SubItems(4) = rs!amountpaid
.SubItems(5) = rs!balance
End With
[Link]
Loop
[Link]: Set rs = Nothing
End Sub
Private Sub searchyearlevel()
[Link]
Connect
Bachelor of Science in Information TechnologyPage 15

ISABELA STATE UNIVERSITY


Cauayan Campus
Cauayan City, Isabela
COLLEGE OF COMPUTING AND INFORMATION TECHNOLOGY
sql = "select * from tblstudent where yearlevel like '" & [Link] & "%'"
Set rs = New [Link]
[Link] sql, con, adOpenDynamic, adLockOptimistic
Do Until [Link]
With [Link](, , rs!idnumber)
.SubItems(1) = rs!completename
.SubItems(2) = rs!yearlevel
.SubItems(3) = rs!dateenrolled
.SubItems(4) = rs!amountpaid
.SubItems(5) = rs!balance
End With
[Link]
Loop
[Link]: Set rs = Nothing
End Sub
Private Sub Form_Load()
Call getenrollees
End Sub
Private Sub ListView1_DblClick()
Call cmdview_Click
End Sub
Private Sub txtsearchid_Change()
Call searchid
End Sub
Private Sub txtsearchlastname_Change()
Call searchlastname
End Sub
Private Sub txtsearchyearlevel_Change()
Call searchyearlevel
End Sub
EnrolleeMasterListForm

Private Sub getenrollees()


[Link]
Connect
sql = "select * from tblstudent"
Set rs = New [Link]
[Link] sql, con, adOpenDynamic, adLockOptimistic
Bachelor of Science in Information TechnologyPage 16

ISABELA STATE UNIVERSITY


Cauayan Campus
Cauayan City, Isabela
COLLEGE OF COMPUTING AND INFORMATION TECHNOLOGY

Do Until [Link]
With [Link](, , rs!idnumber)
.SubItems(1) = rs!completename
.SubItems(2) = rs!yearlevel
.SubItems(3) = rs!dateenrolled
.SubItems(4) = rs!amountpaid
.SubItems(5) = rs!balance
End With
[Link]
Loop
[Link]: Set rs = Nothing
End Sub
Private Sub searchid()
[Link]
Connect
sql = "select * from tblstudent where idnumber like '" & [Link] & "%'"
Set rs = New [Link]
[Link] sql, con, adOpenDynamic, adLockOptimistic
Do Until [Link]
With [Link](, , rs!idnumber)
.SubItems(1) = rs!completename
.SubItems(2) = rs!yearlevel
.SubItems(3) = rs!dateenrolled
.SubItems(4) = rs!amountpaid
.SubItems(5) = rs!balance
End With
[Link]
Loop
[Link]: Set rs = Nothing
End Sub
Private Sub searchlastname()
[Link]
Connect
sql = "select * from tblstudent where lastname like '" & [Link] & "%'"
Set rs = New [Link]
[Link] sql, con, adOpenDynamic, adLockOptimistic
Do Until [Link]
With [Link](, , rs!idnumber)
.SubItems(1) = rs!completename
.SubItems(2) = rs!yearlevel
.SubItems(3) = rs!dateenrolled
Bachelor of Science in Information TechnologyPage 17

ISABELA STATE UNIVERSITY


Cauayan Campus
Cauayan City, Isabela
COLLEGE OF COMPUTING AND INFORMATION TECHNOLOGY
.SubItems(4) = rs!amountpaid
.SubItems(5) = rs!balance
End With
[Link]
Loop
[Link]: Set rs = Nothing
End Sub
Private Sub searchyearlevel()
[Link]
Connect
sql = "select * from tblstudent where yearlevel like '" & [Link] & "%'"
Set rs = New [Link]
[Link] sql, con, adOpenDynamic, adLockOptimistic
Do Until [Link]
With [Link](, , rs!idnumber)
.SubItems(1) = rs!completename
.SubItems(2) = rs!yearlevel
.SubItems(3) = rs!dateenrolled
.SubItems(4) = rs!amountpaid
.SubItems(5) = rs!balance
End With
[Link]
Loop
[Link]: Set rs = Nothing
End Sub
Private Sub editenrollee()
On Error Resume Next
Connect
Set rs = New [Link]
[Link] "select * from tblstudent where idnumber='" & [Link] &
"'", con, adOpenDynamic, adLockOptimistic
With updateenrolleeform
.Caption = "Edit Enrollee - " & [Link]!idnumber
.[Link] = [Link]!idnumber
.[Link] = [Link]!amountpaid
.[Link] = [Link]!balance
.[Link] = [Link]!barangay
.[Link] = [Link]!dateofbirth
.[Link] = [Link]!emailaddress
.[Link] = [Link]!extensionname
.[Link] = [Link]!firstname
.[Link] = [Link]!gender
Bachelor of Science in Information TechnologyPage 18

ISABELA STATE UNIVERSITY


Cauayan Campus
Cauayan City, Isabela
COLLEGE OF COMPUTING AND INFORMATION TECHNOLOGY
.[Link] = [Link]!guardiansname
.[Link] = [Link]!guardiansnumber
.[Link] = [Link]!housenumber
.[Link] = [Link]!idnumber
.[Link] = [Link]!lastname
.[Link] = [Link]!middlename
.[Link] = [Link]!mobilenumber
.[Link] = [Link]!province
.[Link] = [Link]!relationship
.[Link] = [Link]!street
.[Link] = [Link]!totalfees
.[Link] = [Link]!towncity
.[Link] = [Link]!yearlevel
End With
[Link]
End Sub
Private Sub cmdadd_Click()
[Link]
Unload Me
End Sub
Private Sub cmddelete_Click()
If vbYes = MsgBox("Are you sure you want to delete " &
[Link](1) & "?", vbQuestion + vbYesNo, "System") Then
[Link] "delete from tblstudent where idnumber='" & [Link]
& "'"
MsgBox "" & [Link](1) & " successfully deleted!",
vbInformation, "System"
[Link]
Call getenrollees
Else
[Link]
Call getenrollees
End If
End Sub
Private Sub cmdedit_Click()
Call editenrollee
Unload Me
End Sub
Private Sub Form_Load()
Call getenrollees
End Sub
Bachelor of Science in Information TechnologyPage 19

ISABELA STATE UNIVERSITY


Cauayan Campus
Cauayan City, Isabela
COLLEGE OF COMPUTING AND INFORMATION TECHNOLOGY

Private Sub ListView1_DblClick()


Call editenrollee
Unload Me
End Sub
Private Sub txtsearchid_Change()
Call searchid
End Sub
Private Sub txtsearchlastname_Change()
Call searchlastname
End Sub
Private Sub txtsearchyearlevel_Change()
Call searchyearlevel
End Sub
EnrolleeMasterListReportForm
Public Sub getall()
Connect
Set rs = Nothing
[Link] "select * from tblstudent", con, adOpenDynamic, adLockOptimistic
Set [Link] = rs
[Link]
End Sub
Public Sub getyearlevel()
Connect
Set rs = Nothing
[Link] "select * from tblstudent where yearlevel='" & [Link] & "'", con,
adOpenDynamic, adLockOptimistic
Set [Link] = rs
[Link]
End Sub
Public Sub fillyearlevel()
[Link]
Set rs = Nothing
[Link] "select * from tblyearlevel", con, adOpenDynamic, adLockOptimistic
Do While Not [Link]
[Link] [Link]!yearlevel
[Link]
Loop
Bachelor of Science in Information TechnologyPage 20

ISABELA STATE UNIVERSITY


Cauayan Campus
Cauayan City, Isabela
COLLEGE OF COMPUTING AND INFORMATION TECHNOLOGY
[Link]
End Sub
Private Sub cmdview_Click()
If [Link] = True Then getall
If [Link] = True Then getyearlevel
End Sub
Private Sub Form_Load()
End Sub
Private Sub Option1_Click()
[Link]
[Link] = False
End Sub
Private Sub Option2_Click()
[Link] = True
Call fillyearlevel
End Sub
EnrollmentForm
Option Explicit
Private 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
[Link] = "Sending SMS..."
DoEvents
[Link] = "AT" & vbCrLf
Sleep 10
[Link] = "AT+CMGS=1" & vbCrLf
'This line can be
removed if your modem will always be in Text Mode...
Sleep10
[Link] = "AT+CMGS=" &Chr(17) & [Link] & Chr(17)
& vbCrLf 'store cell no. to modem....."
Sleep 10
[Link] = SMS_msg & Chr(13)
[Link] = "Message Sent"
DoEvents

Bachelor of Science in Information TechnologyPage 21

'messages

ISABELA STATE UNIVERSITY


Cauayan Campus
Cauayan City, Isabela
COLLEGE OF COMPUTING AND INFORMATION TECHNOLOGY
Sleep 200 'wait for 200 milliseconds...
[Link] = " 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 + [Link] + pesos and the remaining balance is +
[Link] + pesos, Thank You.
' Send an 'AT' command to the phone
[Link] = "AT" & vbCrLf
Sleep 10
[Link] = "AT+CMGS=1" & vbCrLf
'This line can be removed
if your modem will always be in Text Mode...
Sleep 10
[Link] = "AT+CMGS=" &Chr(17) & [Link] & Chr(17) &
vbCrLf 'Replace this with your mobile Phone's No.
Sleep 10
[Link] = message & Chr(13)
Sleep 20
MsgBox "Message Send"
End Sub
Private Sub getenrollee1()
On Error Resume Next
Connect
Set rs = New [Link]
[Link] "select * from tblstudent where idnumber='" & [Link] & "'", con,
adOpenDynamic, adLockOptimistic
If [Link] = 0 Then
MsgBox "No record found!", , "System"
Else
[Link] = [Link]!idnumber
[Link] = [Link]!yearlevel
[Link] = [Link]!completename
[Link] = [Link]!guardiansnumber
End If
[Link]
End Sub
Private Sub searchenrollees()
[Link]
Connect
Bachelor of Science in Information TechnologyPage 22

ISABELA STATE UNIVERSITY


Cauayan Campus
Cauayan City, Isabela
COLLEGE OF COMPUTING AND INFORMATION TECHNOLOGY
sql = "select * from tblstudent where balance=0 and idnumber like '%" &
[Link] & "%'"
Set rs = New [Link]
[Link] sql, con, adOpenDynamic, adLockOptimistic
Do Until [Link]
With [Link](, , rs!idnumber)
.SubItems(1) = rs!completename
.SubItems(2) = rs!yearlevel
.SubItems(3) = rs!amountpaid
.SubItems(4) = rs!balance
End With
[Link]
Loop
[Link]
End Sub
Private Sub getenrollee()
On Error Resume Next
Connect
Set rs = New [Link]
[Link] "select * from tblstudent where idnumber='" & [Link] &
"'", con, adOpenDynamic, adLockOptimistic
[Link] = [Link]!idnumber
[Link] = [Link]!yearlevel
[Link] = [Link]!completename
[Link] = [Link]!guardiansnumber
[Link]
End Sub
Private Sub getenrollees()
[Link]
Connect
sql = "select * from tblstudent where amountpaid=0"
Set rs = New [Link]
[Link] sql, con, adOpenDynamic, adLockOptimistic
Do Until [Link]
With [Link](, , rs!idnumber)
.SubItems(1) = rs!completename
.SubItems(2) = rs!yearlevel
.SubItems(3) = rs!amountpaid
.SubItems(4) = rs!balance
End With
[Link]
Loop
Bachelor of Science in Information TechnologyPage 23

ISABELA STATE UNIVERSITY


Cauayan Campus
Cauayan City, Isabela
COLLEGE OF COMPUTING AND INFORMATION TECHNOLOGY
[Link]
End Sub
Public Sub printreceipt()
Connect
Set rs = New [Link]
[Link] "select * from tblpaymenthistory join tblpaymentbreakdown where
officialreceiptnumber='" & [Link] & "'", con, adOpenDynamic,
adLockOptimistic
Set [Link] = rs
[Link] 1, mainform
End Sub
Public Sub clear()
[Link] = ""
'[Link] = ""
'[Link] = ""
'[Link] = ""
'[Link] = ""
[Link] = ""
'[Link] = ""
'[Link] = ""
'[Link] = ""
'[Link] = Format(Now, "mm/dd/yyyy")
[Link] = ""
'[Link] = ""
'[Link] = ""
'[Link] = ""
'[Link] = ""
'[Link] = ""
'[Link] = ""
'[Link] = ""
[Link] = ""
[Link] = [Link]
Call officialreceiptnumber
End Sub

Public Sub getpaymentbreakdown()


Connect
Set rs = New [Link]
[Link] "select * from tblpaymentbreakdown", con, adOpenDynamic, adLockOptimistic
If [Link] = 0 Then
MsgBox "No payment record found!", vbInformation, "System"
Bachelor of Science in Information TechnologyPage 24

ISABELA STATE UNIVERSITY


Cauayan Campus
Cauayan City, Isabela
COLLEGE OF COMPUTING AND INFORMATION TECHNOLOGY
Else
[Link] = [Link]!tuitionfee
[Link] = [Link]!miscellaneousfee
[Link] = [Link]!computerfee
[Link] = [Link]!testpaperfee
[Link] = [Link]!studentidfee
[Link] = [Link]!handbookfee
[Link] = [Link]!certificationfee
[Link] = [Link]!recollectionfee
[Link] = [Link]!others
[Link] = [Link]!totalfees
[Link] = [Link]!totalfees
End If
[Link]
End Sub
Public Sub officialreceiptnumber()
ornumber = "1000000001"
Set rs = Nothing
sql = "select officialreceiptnumber from tblpaymenthistory"
[Link] sql, con, adOpenDynamic, adLockOptimistic
If Not [Link] Then
With rs
.MoveLast
ornumber = Val(!officialreceiptnumber) + Val(1)
.Close
End With
End If
[Link] = ornumber
End Sub
Public Sub addpaymenthistory()
[Link]!officialreceiptnumber = ornumber
[Link]!paymentdate = Format(Now, "mm/dd/yyyy")
[Link]!studentid = [Link]
[Link]!completename = completename
[Link]!yearlevel = [Link]
[Link]!totalfees = [Link]
[Link]!previousbalance = "0"
[Link]!previouspayment = "0"
[Link]!amountpaid = [Link]
Bachelor of Science in Information TechnologyPage 25

ISABELA STATE UNIVERSITY


Cauayan Campus
Cauayan City, Isabela
COLLEGE OF COMPUTING AND INFORMATION TECHNOLOGY
[Link]!remainingbalance = [Link]
[Link]!entryby = [Link](1).Text
[Link]!entrydate = Now
End Sub
Private Sub cmdenroll_Click()
If [Link] = "" Then
MsgBox "Please fill ID Number!", , "System"
[Link]
ElseIf [Link] = "" Then
MsgBox "Please enter amount paid!", , "System"
[Link]
ElseIf Val([Link]) < 0 Then
MsgBox "Amount paid must not be greater than total fees!", , "System"
[Link]
Else
Connect
Set rs = Nothing
[Link] "select * from tblstudent where idnumber='" & [Link] & "' and
amountpaid=0", con, adOpenDynamic, adLockOptimistic
If [Link] = 0 Then
MsgBox "ID number not found!", , "System"
[Link] = ""
[Link]
Else
Call officialreceiptnumber
Connect
Set rs = Nothing
[Link] "select * from tblpaymenthistory", con, adOpenDynamic, adLockOptimistic
With rs
.AddNew
addpaymenthistory
[Link]!entryby = [Link](1).Text
[Link]!entrydate = Now
.Update
End With
[Link]
[Link] "update tblstudent set" & vbCrLf & _
"amountpaid='" & [Link] & "'," & vbCrLf & _
"balance='" & Val([Link]) - Val([Link]) & "'" & vbCrLf
&_
"where idnumber='" & [Link] & "'"
Connect
Set rs = Nothing
Bachelor of Science in Information TechnologyPage 26

ISABELA STATE UNIVERSITY


Cauayan Campus
Cauayan City, Isabela
COLLEGE OF COMPUTING AND INFORMATION TECHNOLOGY
[Link] "select * from tblstudent where idnumber='" & [Link] & "'", con,
adOpenDynamic, adLockOptimistic
[Link] = [Link]!guardiansnumber
Call Send_SMS([Link], "From:LSC, " + completename + " is now
enrolled and paid " + [Link] + ". Remaining balance is " + [Link] +
", Thank You.")
MsgBox "Student successfully enrolled!", vbInformation, "System"
Call printreceipt
Call clear
Call getenrollees
End If
End If
End Sub
Private Sub Form_Activate()
Connect
Call officialreceiptnumber
Call getpaymentbreakdown
Call getenrollees
End Sub
Private Sub Form_Load()
On Error GoTo err
With 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 last
End With
err: MsgBox [Link]
End Sub
Private Sub ListView1_Click()
Call getenrollee
End Sub
Private Sub MSComm1_OnComm()
[Link] [Link]
End Sub

Bachelor of Science in Information TechnologyPage 27

ISABELA STATE UNIVERSITY


Cauayan Campus
Cauayan City, Isabela
COLLEGE OF COMPUTING AND INFORMATION TECHNOLOGY
Private Sub txtamountpaid_Change()
[Link] = Val([Link]) - Val([Link])
End Sub
Private Sub txtamountpaid_KeyPress(KeyAscii As Integer)
Data = "1234567890"
If KeyAscii < 26 Then
KeyAscii = KeyAscii
Else
If InStr(Data, Chr(KeyAscii)) = 0 Then
KeyAscii = 0
Exit Sub
End If
End If
End Sub
Private Sub txtbarangay_KeyPress(KeyAscii As Integer)
Data = "qwertyuiopasdfghjklxcvbnmQWERTYUIOPASDFGHJKLXCVBNM- "
If KeyAscii < 26 Then
KeyAscii = KeyAscii
Else
If InStr(Data, Chr(KeyAscii)) = 0 Then
KeyAscii = 0
Exit Sub
End If
End If
End Sub
Private Sub txtemailaddress_KeyPress(KeyAscii As Integer)
Data = "qwertyuiopasdfghjklxcvbnmQWERTYUIOPASDFGHJKLXCVBNM-_!@#$
%^&*()+=[]{}<>./?1234567890"
If KeyAscii < 26 Then
KeyAscii = KeyAscii
Else
If InStr(Data, Chr(KeyAscii)) = 0 Then
KeyAscii = 0
Exit Sub
End If
End If
End Sub
Private Sub txtextensionname_KeyPress(KeyAscii As Integer)
Data = "JSrIV"
If KeyAscii < 26 Then
KeyAscii = KeyAscii
Else
Bachelor of Science in Information TechnologyPage 28

ISABELA STATE UNIVERSITY


Cauayan Campus
Cauayan City, Isabela
COLLEGE OF COMPUTING AND INFORMATION TECHNOLOGY
If InStr(Data, Chr(KeyAscii)) = 0 Then
KeyAscii = 0
Exit Sub
End If
End If
End Sub
Private Sub txtfirstname_KeyPress(KeyAscii As Integer)
Data = "qwertyuiopasdfghjklxcvbnmQWERTYUIOPASDFGHJKLXCVBNM- "
If KeyAscii < 26 Then
KeyAscii = KeyAscii
Else
If InStr(Data, Chr(KeyAscii)) = 0 Then
KeyAscii = 0
Exit Sub
End If
End If
End Sub
Private Sub txtguardiansname_KeyPress(KeyAscii As Integer)
Data = "qwertyuiopasdfghjklxcvbnmQWERTYUIOPASDFGHJKLXCVBNM- "
If KeyAscii < 26 Then
KeyAscii = KeyAscii
Else
If InStr(Data, Chr(KeyAscii)) = 0 Then
KeyAscii = 0
Exit Sub
End If
End If
End Sub
Private Sub txtguardiansnumber_KeyPress(KeyAscii As Integer)
Data = "1234567890+"
If KeyAscii < 26 Then
KeyAscii = KeyAscii
Else
If InStr(Data, Chr(KeyAscii)) = 0 Then
KeyAscii = 0
Exit Sub
End If
End If
End Sub
Private Sub txthousenumber_KeyPress(KeyAscii As Integer)
Data = "2345678901"
If KeyAscii < 26 Then
Bachelor of Science in Information TechnologyPage 29

ISABELA STATE UNIVERSITY


Cauayan Campus
Cauayan City, Isabela
COLLEGE OF COMPUTING AND INFORMATION TECHNOLOGY
KeyAscii = KeyAscii
Else
If InStr(Data, Chr(KeyAscii)) = 0 Then
KeyAscii = 0
Exit Sub
End If
End If
End Sub
Private Sub txtidnumber_Change()
Call searchenrollees
End Sub
Private Sub txtidnumber_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then Call getenrollee1
Data = "1234567890"
If KeyAscii < 26 Then
KeyAscii = KeyAscii
Else
If InStr(Data, Chr(KeyAscii)) = 0 Then
KeyAscii = 0
Exit Sub
End If
End If
End Sub
Private Sub txtlastname_KeyPress(KeyAscii As Integer)
Data = "qwertyuiopasdfghjklxcvbnmQWERTYUIOPASDFGHJKLXCVBNM- "
If KeyAscii < 26 Then
KeyAscii = KeyAscii
Else
If InStr(Data, Chr(KeyAscii)) = 0 Then
KeyAscii = 0
Exit Sub
End If
End If
End Sub
Private Sub txtmiddlename_KeyPress(KeyAscii As Integer)
Data = "qwertyuiopasdfghjklxcvbnmQWERTYUIOPASDFGHJKLXCVBNM- "
If KeyAscii < 26 Then
KeyAscii = KeyAscii
Else
If InStr(Data, Chr(KeyAscii)) = 0 Then
KeyAscii = 0
Exit Sub
Bachelor of Science in Information TechnologyPage 30

ISABELA STATE UNIVERSITY


Cauayan Campus
Cauayan City, Isabela
COLLEGE OF COMPUTING AND INFORMATION TECHNOLOGY
End If
End If
End Sub
Private Sub txtmobilenumber_KeyPress(KeyAscii As Integer)
Data = "1234567890+"
If KeyAscii < 26 Then
KeyAscii = KeyAscii
Else
If InStr(Data, Chr(KeyAscii)) = 0 Then
KeyAscii = 0
Exit Sub
End If
End If
End Sub
Private Sub txtprovince_KeyPress(KeyAscii As Integer)
Data = "qwertyuiopasdfghjklxcvbnmQWERTYUIOPASDFGHJKLXCVBNM- "
If KeyAscii < 26 Then
KeyAscii = KeyAscii
Else
If InStr(Data, Chr(KeyAscii)) = 0 Then
KeyAscii = 0
Exit Sub
End If
End If
End Sub
Private Sub txtrelationship_KeyPress(KeyAscii As Integer)
Data = "qwertyuiopasdfghjklxcvbnmQWERTYUIOPASDFGHJKLXCVBNM- "
If KeyAscii < 26 Then
KeyAscii = KeyAscii
Else
If InStr(Data, Chr(KeyAscii)) = 0 Then
KeyAscii = 0
Exit Sub
End If
End If
End Sub
Private Sub txtstreet_KeyPress(KeyAscii As Integer)
Data = "qwertyuiopasdfghjklxcvbnmQWERTYUIOPASDFGHJKLXCVBNM- "
If KeyAscii < 26 Then
KeyAscii = KeyAscii
Else
If InStr(Data, Chr(KeyAscii)) = 0 Then
Bachelor of Science in Information TechnologyPage 31

ISABELA STATE UNIVERSITY


Cauayan Campus
Cauayan City, Isabela
COLLEGE OF COMPUTING AND INFORMATION TECHNOLOGY
KeyAscii = 0
Exit Sub
End If
End If
End Sub
Private Sub txttowncity_KeyPress(KeyAscii As Integer)
Data = "qwertyuiopasdfghjklxcvbnmQWERTYUIOPASDFGHJKLXCVBNM- "
If KeyAscii < 26 Then
KeyAscii = KeyAscii
Else
If InStr(Data, Chr(KeyAscii)) = 0 Then
KeyAscii = 0
Exit Sub
End If
End If
End Sub
MessagesForm
Option Explicit
Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)
Dim buffer$
Dim SMS_Location As String
Dim temp_cell_no, temp_date, temp_time, temp_msg As String
Dim enable_send As Boolean
Public Sub savemessage()
Connect
Set rs = New [Link]
[Link] "select * from tbldraftmessages", con, adOpenDynamic, adLockOptimistic
With rs
.AddNew
.Fields!messageid = id
.Fields!message = [Link]
.Update
End With
[Link]
End Sub
Public Sub getmessage()
Connect
Set rs = New [Link]
[Link] "select message, substring(message,1,3) from tbldraftmessages", con,
adOpenDynamic, adLockOptimistic
[Link] = UCase([Link])
Bachelor of Science in Information TechnologyPage 32

ISABELA STATE UNIVERSITY


Cauayan Campus
Cauayan City, Isabela
COLLEGE OF COMPUTING AND INFORMATION TECHNOLOGY

Connect
Set rs = New [Link]
[Link] "select message, substring(message,4,7) from tbldraftmessages", con,
adOpenDynamic, adLockOptimistic
[Link] = UCase([Link])
Connect
Set rs = New [Link]
[Link] "select * from tblstudent where idnumber='" & [Link] & "'", con,
adOpenDynamic, adLockOptimistic
[Link] = [Link]!completename
[Link] = [Link]!guardiansnumber
[Link] = [Link]!balance
End Sub
Public Sub closeport()
[Link] = False 'incoming SMS disable...
'--- make sure the port is close before terminating the program
If [Link] = True Then
[Link] = False
End If
Unload Me
End
End Sub
'----- Read SMS at designated location ----------------------------Public Sub readsms()
'-------- Set SMS format to Text ---------[Link] = "AT+CMGF=1" + Chr(13)
Do
buffer$ = [Link]
Loop Until InStr(buffer$, "OK")
[Link] = buffer$
buffer$ = ""
'----- Read SMS at designated location ----------------------------[Link] = "AT+CMGR=" + SMS_Location + Chr(13)
Do
DoEvents
buffer$ = buffer$ & [Link]
Loop Until InStr(buffer$, "OK")
[Link] = buffer$
End Sub
Bachelor of Science in Information TechnologyPage 33

ISABELA STATE UNIVERSITY


Cauayan Campus
Cauayan City, Isabela
COLLEGE OF COMPUTING AND INFORMATION TECHNOLOGY

'------- Delete SMS -----------------------------Public Sub deletesms() 'delete location#1...


[Link] = False 'incoming SMS disable...
[Link] = "AT+CMGD=1" + Chr(13)
Do
buffer$ = [Link]
Loop Until InStr(buffer$, "OK")
[Link] = buffer$
[Link] = "Location #1 Deleted..."
DoEvents
[Link] = True 'incoming SMS enable...
Sleep 200
[Link] = " Ready to recieve SMS..."
DoEvents
End Sub
'Public Sub sendsms() '----------------send sms------------------'Call Send_SMS([Link], "TESTING..." + ", Date: " + Str(Date) + ", Time: " +
Str(Time))
'End Sub
'----- enable time ---------------Public Sub enabletime()
enable_send = 1
End Sub
Public Sub clear() '-----------------[Link] = ""
[Link] = ""
[Link] = ""
[Link] = ""
[Link] = ""
[Link] = ""
[Link] = ""
[Link] = ""
DoEvents
End Sub
Private Sub Form_Load()
[Link] = False 'incoming SMS disable...
With MSComm1

Bachelor of Science in Information TechnologyPage 34

ISABELA STATE UNIVERSITY


Cauayan Campus
Cauayan City, Isabela
COLLEGE OF COMPUTING AND INFORMATION TECHNOLOGY
.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
[Link] = "Connected"
DoEvents
Sleep 500 'wait for 500 milliseconds...
'Set interation of comunication
[Link] = "Start Setting"
DoEvents
'--------- AT Commands to initialized broad -----------[Link] = "AT+CNMI=2,1,2,0,0" + Chr(13)
Call Reply_OK
'-------------------------------------------------------[Link] = "AT+CPMS=""ME"",""SM"",""ME""" + Chr(13)
Call Reply_OK
'---------- Set SMS format to Text --------------------[Link] = "AT+CMGF=1" + Chr(13) 'set text mode...
Call Reply_OK
[Link] = "End Setting"
DoEvents
Sleep 200
[Link] = "Ready to recieve SMS..."
DoEvents
[Link] = True 'incoming SMS enable...
End Sub
Private Sub Form_Unload(Cancel As Integer)
Call closeport
End Sub
Private Sub Timer1_Timer()
Bachelor of Science in Information TechnologyPage 35

ISABELA STATE UNIVERSITY


Cauayan Campus
Cauayan City, Isabela
COLLEGE OF COMPUTING AND INFORMATION TECHNOLOGY
'If enable_send Then
'
[Link] = Str(Date) + " - " + Str(Time)
' DoEvents
' If [Link] = Str(Date) And [Link] = Str(Time) Then
' Call Command4_Click
' End If
' End If
buffer$ = [Link]
'---------- Wait for incomming sms -----------If InStr(buffer$, "+CMTI: ""ME""") Then
[Link] = buffer$
[Link] = ""
[Link] = ""
[Link] = ""
[Link] = ""
DoEvents
'------ Get location of SMS -------------SMS_Location = Right(buffer$, 3)
buffer$ = ""
'-------- Set SMS format to Text ---------[Link] = "AT+CMGF=1" + Chr(13)
Do
buffer$ = [Link]
Loop Until InStr(buffer$, "OK")
[Link] = buffer$
buffer$ = ""
'----- Read SMS at designated location ----------------------------[Link] = "AT+CMGR=" + SMS_Location + Chr(13)
Do
DoEvents
buffer$ = buffer$ & [Link]
Loop Until InStr(buffer$, "OK")
[Link] = buffer$
'---- extract SMS Data Message ---------------'------- Get Cell no. -----------temp_cell_no = Left(buffer$, 36)
[Link] = Right(temp_cell_no, 13)
'-------- Get date ----------------temp_date = Left(buffer$, 48)
Bachelor of Science in Information TechnologyPage 36

ISABELA STATE UNIVERSITY


Cauayan Campus
Cauayan City, Isabela
COLLEGE OF COMPUTING AND INFORMATION TECHNOLOGY
[Link] = Right(temp_date, 8)
'-------- Get time ---------------temp_time = Left(buffer$, 57)
[Link] = Right(temp_time, 8)
'---------- Get SMS Message ----------------temp_msg = Right(buffer$, Len(buffer$) - 63)
[Link] = Left(temp_msg, Len(temp_msg) - 8)
DoEvents

Call Command3_Click 'delete location #1...


Call Execute_Command
End If
End Sub
Private Sub Execute_Command()
[Link] = UCase([Link])
If [Link] = "BAL" Then
'connect
'Set rs = New [Link]
'[Link] "select * from tblstudent where idnumber='" & [Link] & "'", con,
adOpenDynamic, adLockOptimistic
'Call Send_SMS([Link], "Your Account Balance is " + [Link] + ", Date: " +
Str(Date) + ", Time: " + Str(Time))
Call Send_SMS([Link], "From La Salette of Cabatuan, The remaining balance of
" + [Link] + " " + [Link] + " is " + [Link] + " pesos. Thank You!!!")
Else
Call Send_SMS([Link], "Sorry, command does not match!!!")
End If
[Link] = "Message Sent..."
DoEvents
Sleep 200
[Link] = "Ready to recieve SMS..."
DoEvents
End Sub
Sub Reply_OK()
Do
Bachelor of Science in Information TechnologyPage 37

ISABELA STATE UNIVERSITY


Cauayan Campus
Cauayan City, Isabela
COLLEGE OF COMPUTING AND INFORMATION TECHNOLOGY
DoEvents
buffer$ = buffer$ & [Link]
Loop Until InStr(buffer$, "OK")
[Link] = [Link] & vbCr & buffer$
buffer$ = ""
Sleep (500)
End Sub
'-------------- Send SMS ----------------------------------------Private Sub Send_SMS(Cell_no As String, SMS_msg As String)
[Link] = "Sending SMS..."
DoEvents
[Link] = 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
[Link] = "AT+CMGS=" &Chr(34) & Cell_no & Chr(34) & vbCrLf 'store
cell no. to modem....."
Sleep 500
[Link] = SMS_msg & Chr(26)
'messages
Call Reply_OK
[Link] = "Message Sent"
DoEvents
[Link] = True 'incoming SMS enable...
Sleep 200 'wait for 200 milliseconds...
[Link] = " Ready to recieve SMS..."
DoEvents
End Sub
PaymentBreakDownForm
Public Sub getpaymentbreakdown()
Connect
Set rs = New [Link]
[Link] "select * from tblpaymentbreakdown", con, adOpenDynamic, adLockOptimistic
If [Link] = 0 Then
MsgBox "No record found!", vbInformation, "System"
Bachelor of Science in Information TechnologyPage 38

ISABELA STATE UNIVERSITY


Cauayan Campus
Cauayan City, Isabela
COLLEGE OF COMPUTING AND INFORMATION TECHNOLOGY
[Link] = "&Save"
Else
[Link] = [Link]!tuitionfee
[Link] = [Link]!miscellaneousfee
[Link] = [Link]!computerfee
[Link] = [Link]!testpaperfee
[Link] = [Link]!studentidfee
[Link] = [Link]!handbookfee
[Link] = [Link]!certificationfee
[Link] = [Link]!recollectionfee
[Link] = [Link]!others
[Link] = [Link]!totalfees
[Link] = [Link]!entryby
[Link] = [Link]!entrydate
[Link] = "&Update"
End If
[Link]
End Sub
Private Sub addpaymentbreakdown()
[Link]!feeid = id
[Link]!tuitionfee = [Link]
[Link]!miscellaneousfee = [Link]
[Link]!computerfee = [Link]
[Link]!testpaperfee = [Link]
[Link]!studentidfee = [Link]
[Link]!handbookfee = [Link]
[Link]!certificationfee = [Link]
[Link]!recollectionfee = [Link]
[Link]!others = [Link]
[Link]!totalfees = [Link]
End Sub
Private Sub cmdsave_Click()
If [Link] = "" Then
[Link] = "0"
ElseIf [Link] = "" Then
[Link] = "0"
ElseIf [Link] = "" Then
[Link] = "0"
ElseIf [Link] = "" Then
[Link] = "0"
ElseIf [Link] = "" Then
[Link] = "0"
ElseIf [Link] = "" Then
[Link] = "0"
Bachelor of Science in Information TechnologyPage 39

ISABELA STATE UNIVERSITY


Cauayan Campus
Cauayan City, Isabela
COLLEGE OF COMPUTING AND INFORMATION TECHNOLOGY
ElseIf [Link] = "" Then
[Link] = "0"
ElseIf [Link] = "" Then
[Link] = "0"
ElseIf [Link] = "" Then
[Link] = "0"
Else
If [Link] = "&Save" Then
Connect
Set rs = New [Link]
sql = "select * from tblsystemnumber"
[Link] sql, con, adOpenDynamic, adLockOptimistic
With rs
.AddNew
addpaymentbreakdown
[Link]!entryby = [Link](1).Text
[Link]!entrydate = Now
.Update
End With
Unload Me
MsgBox "Payment Breakdown successfully saved!", vbInformation, "System"
[Link]
Else
[Link] "update tblpaymentbreakdown set" & vbCrLf & _
"tuitionfee='" & [Link] & "'," & vbCrLf & _
"miscellaneousfee='" & [Link] & "'," & vbCrLf & _
"computerfee='" & [Link] & "'," & vbCrLf & _
"testpaperfee='" & [Link] & "'," & vbCrLf & _
"studentidfee='" & [Link] & "'," & vbCrLf & _
"handbookfee='" & [Link] & "'," & vbCrLf & _
"certificationfee='" & [Link] & "'," & vbCrLf & _
"recollectionfee='" & [Link] & "'," & vbCrLf & _
"others='" & [Link] & "'," & vbCrLf & _
"totalfees='" & [Link] & "'," & vbCrLf & _
"payments='" & Val([Link]) / 5 & "'," & vbCrLf & _
"entryby='" & [Link](1).Text & "'," & vbCrLf & _
"entrydate='" & Now & "'" & vbCrLf & _
"where feeid='" & id & "'"
Unload Me
MsgBox "Paymet Breakdown successfully updated!", vbInformation, "System"
[Link]
End If
End If
End Sub
Private Sub Form_Activate()
Bachelor of Science in Information TechnologyPage 40

ISABELA STATE UNIVERSITY


Cauayan Campus
Cauayan City, Isabela
COLLEGE OF COMPUTING AND INFORMATION TECHNOLOGY
id = "1"
Call getpaymentbreakdown
End Sub
Private Sub txtcertificationfee_Change()
[Link] = Val([Link]) + Val([Link]) +
Val([Link]) + Val([Link]) + Val([Link]) +
Val([Link]) + Val([Link]) + Val([Link]) +
Val([Link])
End Sub
Private Sub txtcertificationfee_KeyPress(KeyAscii As Integer)
Data = "1234567890"
If KeyAscii < 26 Then
KeyAscii = KeyAscii
Else
If InStr(Data, Chr(KeyAscii)) = 0 Then
KeyAscii = 0
Exit Sub
End If
End If
End Sub
Private Sub txtcomputerfee_Change()
[Link] = Val([Link]) + Val([Link]) +
Val([Link]) + Val([Link]) + Val([Link]) +
Val([Link]) + Val([Link]) + Val([Link]) +
Val([Link])
End Sub
Private Sub txtcomputerfee_KeyPress(KeyAscii As Integer)
Data = "1234567890"
If KeyAscii < 26 Then
KeyAscii = KeyAscii
Else
If InStr(Data, Chr(KeyAscii)) = 0 Then
KeyAscii = 0
Exit Sub
End If
End If
End Sub
Private Sub txthandbookfee_Change()
[Link] = Val([Link]) + Val([Link]) +
Val([Link]) + Val([Link]) + Val([Link]) +
Val([Link]) + Val([Link]) + Val([Link]) +
Bachelor of Science in Information TechnologyPage 41

ISABELA STATE UNIVERSITY


Cauayan Campus
Cauayan City, Isabela
COLLEGE OF COMPUTING AND INFORMATION TECHNOLOGY
Val([Link])
End Sub
Private Sub txthandbookfee_KeyPress(KeyAscii As Integer)
Data = "1234567890"
If KeyAscii < 26 Then
KeyAscii = KeyAscii
Else
If InStr(Data, Chr(KeyAscii)) = 0 Then
KeyAscii = 0
Exit Sub
End If
End If
End Sub
Private Sub txtmiscellaneousfee_Change()
[Link] = Val([Link]) + Val([Link]) +
Val([Link]) + Val([Link]) + Val([Link]) +
Val([Link]) + Val([Link]) + Val([Link]) +
Val([Link])
End Sub
Private Sub txtmiscellaneousfee_KeyPress(KeyAscii As Integer)
Data = "1234567890"
If KeyAscii < 26 Then
KeyAscii = KeyAscii
Else
If InStr(Data, Chr(KeyAscii)) = 0 Then
KeyAscii = 0
Exit Sub
End If
End If
End Sub
Private Sub txtothers_Change()
[Link] = Val([Link]) + Val([Link]) +
Val([Link]) + Val([Link]) + Val([Link]) +
Val([Link]) + Val([Link]) + Val([Link]) +
Val([Link])
End Sub
Private Sub txtothers_KeyPress(KeyAscii As Integer)
Data = "1234567890"
If KeyAscii < 26 Then
KeyAscii = KeyAscii
Else
Bachelor of Science in Information TechnologyPage 42

ISABELA STATE UNIVERSITY


Cauayan Campus
Cauayan City, Isabela
COLLEGE OF COMPUTING AND INFORMATION TECHNOLOGY
If InStr(Data, Chr(KeyAscii)) = 0 Then
KeyAscii = 0
Exit Sub
End If
End If
End Sub
Private Sub txtrecollectionfee_Change()
[Link] = Val([Link]) + Val([Link]) +
Val([Link]) + Val([Link]) + Val([Link]) +
Val([Link]) + Val([Link]) + Val([Link]) +
Val([Link])
End Sub
Private Sub txtrecollectionfee_KeyPress(KeyAscii As Integer)
Data = "1234567890"
If KeyAscii < 26 Then
KeyAscii = KeyAscii
Else
If InStr(Data, Chr(KeyAscii)) = 0 Then
KeyAscii = 0
Exit Sub
End If
End If
End Sub
Private Sub txtstudentidfee_Change()
[Link] = Val([Link]) + Val([Link]) +
Val([Link]) + Val([Link]) + Val([Link]) +
Val([Link]) + Val([Link]) + Val([Link]) +
Val([Link])
End Sub
Private Sub txtstudentidfee_KeyPress(KeyAscii As Integer)
Data = "1234567890"
If KeyAscii < 26 Then
KeyAscii = KeyAscii
Else
If InStr(Data, Chr(KeyAscii)) = 0 Then
KeyAscii = 0
Exit Sub
End If
End If
End Sub
Private Sub txttestpaperfee_Change()
Bachelor of Science in Information TechnologyPage 43

ISABELA STATE UNIVERSITY


Cauayan Campus
Cauayan City, Isabela
COLLEGE OF COMPUTING AND INFORMATION TECHNOLOGY
[Link] = Val([Link]) + Val([Link]) +
Val([Link]) + Val([Link]) + Val([Link]) +
Val([Link]) + Val([Link]) + Val([Link]) +
Val([Link])
End Sub
Private Sub txttestpaperfee_KeyPress(KeyAscii As Integer)
Data = "1234567890"
If KeyAscii < 26 Then
KeyAscii = KeyAscii
Else
If InStr(Data, Chr(KeyAscii)) = 0 Then
KeyAscii = 0
Exit Sub
End If
End If
End Sub
Private Sub txttuitionfee_Change()
[Link] = Val([Link]) + Val([Link]) +
Val([Link]) + Val([Link]) + Val([Link]) +
Val([Link]) + Val([Link]) + Val([Link]) +
Val([Link])
End Sub
Private Sub txttuitionfee_KeyPress(KeyAscii As Integer)
Data = "1234567890"
If KeyAscii < 26 Then
KeyAscii = KeyAscii
Else
If InStr(Data, Chr(KeyAscii)) = 0 Then
KeyAscii = 0
Exit Sub
End If
End If
End Sub
PaymentForm
Option Explicit
Private 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
[Link] = "Sending SMS..."
DoEvents
Bachelor of Science in Information TechnologyPage 44

ISABELA STATE UNIVERSITY


Cauayan Campus
Cauayan City, Isabela
COLLEGE OF COMPUTING AND INFORMATION TECHNOLOGY
[Link] = "AT" & vbCrLf
Sleep 500
[Link] = "AT+CMGF=1" & vbCrLf
'This line can be
removed if your modem will always be in Text Mode...
Sleep 500
[Link] = "AT+CMGS=" &Chr(34) & [Link] & Chr(34)
& vbCrLf 'store cell no. to modem....."
Sleep 500
[Link] = SMS_msg & Chr(26)
[Link] = "Message Sent"
DoEvents
Sleep 200 'wait for 200 milliseconds...
[Link] = " Ready to recieve SMS..."
DoEvents
End Sub
Public Sub clear()
[Link] = ""
[Link] = ""
[Link] = ""
[Link] = ""
[Link] = ""
[Link] = ""
[Link] = ""
Call officialreceiptnumber
End Sub
Private Sub getenrollees()
[Link]
Connect
sql = "select * from tblstudent where balance>0"
Set rs = New [Link]
[Link] sql, con, adOpenDynamic, adLockOptimistic
Do Until [Link]
With [Link](, , rs!idnumber)
.SubItems(1) = rs!completename
.SubItems(2) = rs!yearlevel
.SubItems(3) = rs!amountpaid
.SubItems(4) = rs!balance
End With
[Link]
Bachelor of Science in Information TechnologyPage 45

'messages

ISABELA STATE UNIVERSITY


Cauayan Campus
Cauayan City, Isabela
COLLEGE OF COMPUTING AND INFORMATION TECHNOLOGY
Loop
[Link]
End Sub
Public Sub printreceipt()
Connect
Set rs = New [Link]
[Link] "select * from tblpaymenthistory join tblpaymentbreakdown where
officialreceiptnumber='" & [Link] & "'", con, adOpenDynamic,
adLockOptimistic
Set [Link] = rs
[Link] 1, mainform
End Sub
Private Sub searchenrollees()
[Link]
Connect
sql = "select * from tblstudent where balance>0 and idnumber like '%" &
[Link] & "%'"
Set rs = New [Link]
[Link] sql, con, adOpenDynamic, adLockOptimistic
Do Until [Link]
With [Link](, , rs!idnumber)
.SubItems(1) = rs!completename
.SubItems(2) = rs!yearlevel
.SubItems(3) = rs!amountpaid
.SubItems(4) = rs!balance
End With
[Link]
Loop
[Link]
End Sub
Public Sub officialreceiptnumber()
ornumber = "0000000001"
Set rs = Nothing
sql = "select officialreceiptnumber from tblpaymenthistory"
[Link] sql, con, adOpenDynamic, adLockOptimistic
If Not [Link] Then
With rs
.MoveLast
ornumber = Val(!officialreceiptnumber) + Val(1)
Bachelor of Science in Information TechnologyPage 46

ISABELA STATE UNIVERSITY


Cauayan Campus
Cauayan City, Isabela
COLLEGE OF COMPUTING AND INFORMATION TECHNOLOGY
.Close
End With
End If
[Link] = ornumber
'[Link]
End Sub
Private Sub getenrollee()
On Error Resume Next
Connect
Set rs = New [Link]
[Link] "select * from tblstudent where idnumber='" & [Link] &
"'", con, adOpenDynamic, adLockOptimistic
id = [Link]!idnumber
[Link] = [Link]!yearlevel
[Link] = [Link]!completename
[Link] = [Link]!amountpaid
[Link] = [Link]!balance
[Link] = [Link]!balance
[Link] = [Link]!totalfees
[Link] = [Link]!guardiansnumber
[Link]
End Sub
Public Sub addpaymenthistory()
[Link]!officialreceiptnumber = [Link]
[Link]!paymentdate = Format(Now, "mm/dd/yyyy")
[Link]!studentid = [Link]
[Link]!completename = [Link]
[Link]!yearlevel = [Link]
[Link]!totalfees = [Link]
[Link]!previousbalance = [Link]
[Link]!previouspayment = [Link]
[Link]!amountpaid = Val([Link]) + Val([Link])
'[Link]!currentpayment = [Link]
[Link]!remainingbalance = [Link]
[Link]!entryby = [Link](1).Text
[Link]!entrydate = Now
End Sub
Private Sub cmdsave_Click()
On Error GoTo err
If [Link] = "" Then
MsgBox "Please Select student!", , "System"
Bachelor of Science in Information TechnologyPage 47

ISABELA STATE UNIVERSITY


Cauayan Campus
Cauayan City, Isabela
COLLEGE OF COMPUTING AND INFORMATION TECHNOLOGY
ElseIf Val([Link]) < 0 Then
MsgBox "Payment must not be greater than remaining balance!", , "System"
[Link]
Else
completename = [Link]
[Link] "update tblstudent set" & vbCrLf & _
"amountpaid='" & [Link] & "'," & vbCrLf & _
"balance='" & [Link] & "'" & vbCrLf & _
"where idnumber='" & id & "'"
'amountpaid = Val([Link]) + Val([Link])
Connect
Set rs = Nothing
[Link] "select * from tblpaymenthistory", con, adOpenDynamic, adLockOptimistic
With rs
.AddNew
addpaymenthistory
.Update
End With
[Link]
Call Send_SMS([Link], "From: La Salette of Cabatuan, " +
completename + " has paid " + [Link] + " pesos and the remaining balance is
" + [Link] + " pesos, Thank You.")
MsgBox "Payment successfully saved!", vbInformation, "System"
err: MsgBox [Link]
Call printreceipt
Unload Me
End If
End Sub
Private Sub Form_Activate()
Call getenrollees
Call officialreceiptnumber
End Sub
Private Sub Frame1_DragDrop(Source As Control, X As Single, Y As Single)
End Sub
Private Sub ListView1_Click()
Call getenrollee
End Sub
Private Sub txtamountpaid_Change()
Bachelor of Science in Information TechnologyPage 48

ISABELA STATE UNIVERSITY


Cauayan Campus
Cauayan City, Isabela
COLLEGE OF COMPUTING AND INFORMATION TECHNOLOGY
[Link] = Val([Link]) - Val([Link])
End Sub
Private Sub txtamountpaid_KeyPress(KeyAscii As Integer)
Data = "1234567890"
If KeyAscii < 26 Then
KeyAscii = KeyAscii
Else
If InStr(Data, Chr(KeyAscii)) = 0 Then
KeyAscii = 0
End If
Exit Sub
End If
End Sub

Private Sub Form_Load()


On Error GoTo err
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 last
End With
err: MsgBox [Link]
End Sub
Private Sub MSComm1_OnComm()
[Link] [Link]
End Sub
Private Sub txtidnumber_Change()
Call searchenrollees
End Sub
Private Sub txtidnumber_KeyPress(KeyAscii As Integer)
Data = "1234567890"
If KeyAscii < 26 Then
KeyAscii = KeyAscii
Else
Bachelor of Science in Information TechnologyPage 49

ISABELA STATE UNIVERSITY


Cauayan Campus
Cauayan City, Isabela
COLLEGE OF COMPUTING AND INFORMATION TECHNOLOGY
If InStr(Data, Chr(KeyAscii)) = 0 Then
KeyAscii = 0
Exit Sub
End If
End If
End Sub
PaymentInformationReportForm
Public Sub getall()
Connect
Set rs = Nothing
[Link] "select * from tblpaymenthistory", con, adOpenDynamic, adLockOptimistic
Set [Link] = rs
[Link]
End Sub
Public Sub getyearlevel()
Connect
Set rs = Nothing
[Link] "select * from tblpaymenthistory where yearlevel='" & [Link] & "'", con,
adOpenDynamic, adLockOptimistic
Set [Link] = rs
[Link]
End Sub
Public Sub getstudent()
Connect
Set rs = Nothing
[Link] "select * from tblpaymenthistory where studentid='" & [Link] & "'", con,
adOpenDynamic, adLockOptimistic
Set [Link] = rs
[Link]
End Sub
Public Sub fillyearlevel()
[Link]
Set rs = Nothing
[Link] "select * from tblyearlevel", con, adOpenDynamic, adLockOptimistic
Do While Not [Link]
[Link] [Link]!yearlevel
[Link]
Loop
[Link]
End Sub
Bachelor of Science in Information TechnologyPage 50

ISABELA STATE UNIVERSITY


Cauayan Campus
Cauayan City, Isabela
COLLEGE OF COMPUTING AND INFORMATION TECHNOLOGY

Public Sub fillstudent()


[Link]
Set rs = Nothing
[Link] "select * from tblstudent", con, adOpenDynamic, adLockOptimistic
Do While Not [Link]
[Link] [Link]!idnumber
[Link]
Loop
[Link]
End Sub
Private Sub cmdview_Click()
If [Link] = True Then getall
If [Link] = True Then getyearlevel
If [Link] = True Then getstudent
End Sub
Private Sub Form_Load()
End Sub
Private Sub Option1_Click()
[Link]
[Link] = False
End Sub
Private Sub Option2_Click()
[Link] = True
Call fillyearlevel
End Sub
Private Sub Option3_Click()
[Link] = True
Call fillstudent
End Sub
RemindersForm
Option Explicit
Private 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

Bachelor of Science in Information TechnologyPage 51

ISABELA STATE UNIVERSITY


Cauayan Campus
Cauayan City, Isabela
COLLEGE OF COMPUTING AND INFORMATION TECHNOLOGY
[Link] = "Sending SMS..."
DoEvents
[Link] = "AT" & vbCrLf
Sleep 500
[Link] = "AT+CMGF=1" & vbCrLf
'This line can be
removed if your modem will always be in Text Mode...
Sleep 500
[Link] = "AT+CMGS=" &Chr(34) & [Link] & Chr(34)
& vbCrLf 'store cell no. to modem....."
Sleep 500
[Link] = SMS_msg & Chr(26)

'messages

[Link] = "Message Sent"


DoEvents
Sleep 200 'wait for 200 milliseconds...
[Link] = " Ready to recieve SMS..."
DoEvents
End Sub
Private Sub mesagesent()
message = [Link]
' Send an 'AT' command to the phone
[Link] = "AT" & vbCrLf
Sleep 500
[Link] = "AT+CMGF=1" & vbCrLf
'This line can be removed
if your modem will always be in Text Mode...
Sleep 500
[Link] = "AT+CMGS=" &Chr(34) & [Link] & Chr(34) &
vbCrLf 'Replace this with your mobile Phone's No.
Sleep 1000
[Link] = message & Chr(26)
Sleep 2000
MsgBox "Message Send"
End Sub
Private Sub cmdsend_Click()
If [Link] = "" Then
MsgBox "Please enter message!", , "System"
Else
Do While Not [Link]
[Link] = [Link]!guardiansnumber
Bachelor of Science in Information TechnologyPage 52

ISABELA STATE UNIVERSITY


Cauayan Campus
Cauayan City, Isabela
COLLEGE OF COMPUTING AND INFORMATION TECHNOLOGY
Call Send_SMS([Link], [Link])
[Link]
Loop
If [Link] = True Then
[Link]
[Link] = [Link]!guardiansnumber
MsgBox "All messages has been sent!", , "System"
Exit Sub
End If
End If
End Sub
Private Sub Form_Activate()
Connect
Set rs = Nothing
[Link] "select distinct guardiansnumber from tblstudent", con, adOpenDynamic,
adLockOptimistic
[Link]
[Link] = [Link]!guardiansnumber '& "; " & [Link]
End Sub
Private Sub Form_Load()
On Error GoTo err
'[Link] = 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 last
End With
err: MsgBox [Link]
End Sub
Private Sub MSComm1_OnComm()
[Link] [Link]
End Sub
'Private Sub Timer1_Timer()
Bachelor of Science in Information TechnologyPage 53

ISABELA STATE UNIVERSITY


Cauayan Campus
Cauayan City, Isabela
COLLEGE OF COMPUTING AND INFORMATION TECHNOLOGY
'Do While Not [Link]
' Call Send_SMS([Link], [Link])
' [Link]
'Loop
'End Sub
Private Sub Timer1_Timer()
End Sub
SplashForm

Private Sub Form_Load()


End Sub
Private Sub Timer1_Timer()
Dim i As Integer
Static j As Integer
If j < 100 Then
j=j+5
Else
j=0
End If
For i = 0 To 4
[Link] = j
Next
If [Link] = 100 Then
Unload Me
[Link]
End If
End Sub
StudentInfromationForm

Public Sub clear()


[Link] = ""
[Link] = ""
[Link] = ""
Bachelor of Science in Information TechnologyPage 54

ISABELA STATE UNIVERSITY


Cauayan Campus
Cauayan City, Isabela
COLLEGE OF COMPUTING AND INFORMATION TECHNOLOGY
[Link] = ""
[Link] = ""
[Link] = ""
[Link] = ""
[Link] = ""
[Link] = ""
[Link] = Format(Now, "mm/dd/yyyy")
[Link] = ""
[Link] = ""
[Link] = ""
[Link] = ""
[Link] = ""
[Link] = ""
[Link] = ""
[Link] = ""
End Sub
Public Sub fillyearlevel()
[Link]
Set rs = Nothing
[Link] "select * from tblyearlevel", con, adOpenDynamic, adLockOptimistic
Do While Not [Link]
[Link] [Link]!yearlevel
[Link]
Loop
End Sub
Public Sub addstudent()
[Link]!id = id
[Link]!idnumber = [Link]
[Link]!lastname = [Link]
[Link]!firstname = [Link]
[Link]!middlename = [Link]
[Link]!extensionname = [Link]
[Link]!completename = completename
[Link]!yearlevel = [Link]
[Link]!mobilenumber = [Link]
[Link]!emailaddress = [Link]
[Link]!gender = [Link]
[Link]!dateofbirth = [Link]
[Link]!dateenrolled = Format(Now, "mm/dd/yyyy")
[Link]!totalfees = totalfees
[Link]!amountpaid = "0"
[Link]!balance = totalfees
Bachelor of Science in Information TechnologyPage 55

ISABELA STATE UNIVERSITY


Cauayan Campus
Cauayan City, Isabela
COLLEGE OF COMPUTING AND INFORMATION TECHNOLOGY
[Link]!housenumber = [Link]
[Link]!street = [Link]
[Link]!barangay = [Link]
[Link]!towncity = [Link]
[Link]!province = [Link]
[Link]!completeaddress = [Link] & " " & [Link] & " "
&[Link] & " " & [Link] & ", " & [Link]
[Link]!guardiansname = [Link]
[Link]!relationship = [Link]
[Link]!guardiansnumber = [Link]
End Sub
Private Sub cmdsave_Click()
If [Link] = "" Then
MsgBox "Please fill ID Number!", , "System"
[Link]
ElseIf [Link] = "" Then
MsgBox "Please select Year Level!", , "System"
[Link]
ElseIf [Link] = "" Then
MsgBox "Please fill Last Name!", , "System"
[Link]
ElseIf [Link] = "" Then
MsgBox "Please fill First Name!", , "System"
[Link]
ElseIf [Link] = "" Then
MsgBox "Please fill Middle Name!", , "System"
[Link]
ElseIf [Link] = "" Then
[Link] = "none"
ElseIf [Link] = "" Then
MsgBox "Please Select Gender!", , "System"
[Link]
ElseIf [Link] = "" Then
[Link] = "none"
ElseIf [Link] = "" Then
MsgBox "Please fill Barangay!", , "System"
[Link]
ElseIf [Link] = "" Then
MsgBox "Please fill Town/City!", , "System"
[Link]
ElseIf [Link] = "" Then
MsgBox "Please fill province!", , "System"
[Link]
ElseIf [Link] = "" Then
MsgBox "Please fill Guardian's Name!", , "System"
Bachelor of Science in Information TechnologyPage 56

ISABELA STATE UNIVERSITY


Cauayan Campus
Cauayan City, Isabela
COLLEGE OF COMPUTING AND INFORMATION TECHNOLOGY
[Link]
ElseIf [Link] = "" Then
MsgBox "Please fill Relationship!", , "System"
[Link]
ElseIf [Link] = "" Then
MsgBox "Please fill Guardian's Number!", , "System"
[Link]
Else
id = "1"
completename = [Link] & " " & [Link] & "-" & [Link]
& " " & [Link]
Set rs = New [Link]
sql = "select * from tblstudent"
[Link] sql, con, adOpenDynamic, adLockOptimistic
If Not [Link] Then
With rs
.MoveLast
id = Val(!id) + Val(1)
.Close
End With
End If
Connect
[Link] "select * from tblstudent where idnumber='" & [Link] & "' and
yearlevel='" & [Link] & "'", con, adOpenDynamic, adLockOptimistic
If [Link] = 1 Then
MsgBox "Student already enrolled!", , "System"
Call clear
Else
Connect
sql = "select * from tblstudent"
Set rs = Nothing
[Link] sql, con, adOpenDynamic, adLockOptimistic
With rs
.AddNew
addstudent
[Link]!entryby = [Link](1).Text
[Link]!entrydate = Now
.Update
End With
[Link]
Call clear
End If
Bachelor of Science in Information TechnologyPage 57

ISABELA STATE UNIVERSITY


Cauayan Campus
Cauayan City, Isabela
COLLEGE OF COMPUTING AND INFORMATION TECHNOLOGY
End If
End Sub
Private Sub Form_Activate()
Connect
Call fillyearlevel
End Sub
Private Sub txtbarangay_KeyPress(KeyAscii As Integer)
Data = "qwertyuiopasdfghjklxcvbnmQWERTYUIOPASDFGHJKLXCVBNM- "
If KeyAscii < 26 Then
KeyAscii = KeyAscii
Else
If InStr(Data, Chr(KeyAscii)) = 0 Then
KeyAscii = 0
Exit Sub
End If
End If
End Sub
Private Sub txtemailaddress_KeyPress(KeyAscii As Integer)
Data = "qwertyuiopasdfghjklxcvbnmQWERTYUIOPASDFGHJKLXCVBNM-_!@#$
%^&*()+=[]{}<>./?1234567890"
If KeyAscii < 26 Then
KeyAscii = KeyAscii
Else
If InStr(Data, Chr(KeyAscii)) = 0 Then
KeyAscii = 0
Exit Sub
End If
End If
End Sub
Private Sub txtextensionname_KeyPress(KeyAscii As Integer)
Data = "JSrIV"
If KeyAscii < 26 Then
KeyAscii = KeyAscii
Else
If InStr(Data, Chr(KeyAscii)) = 0 Then
KeyAscii = 0
Exit Sub
End If
End If
End Sub

Bachelor of Science in Information TechnologyPage 58

ISABELA STATE UNIVERSITY


Cauayan Campus
Cauayan City, Isabela
COLLEGE OF COMPUTING AND INFORMATION TECHNOLOGY
Private Sub txtfirstname_KeyPress(KeyAscii As Integer)
Data = "qwertyuiopasdfghjklxcvbnmQWERTYUIOPASDFGHJKLXCVBNM- "
If KeyAscii < 26 Then
KeyAscii = KeyAscii
Else
If InStr(Data, Chr(KeyAscii)) = 0 Then
KeyAscii = 0
Exit Sub
End If
End If
End Sub
Private Sub txtguardiansname_KeyPress(KeyAscii As Integer)
Data = "qwertyuiopasdfghjklxcvbnmQWERTYUIOPASDFGHJKLXCVBNM- "
If KeyAscii < 26 Then
KeyAscii = KeyAscii
Else
If InStr(Data, Chr(KeyAscii)) = 0 Then
KeyAscii = 0
Exit Sub
End If
End If
End Sub
Private Sub txtguardiansnumber_KeyPress(KeyAscii As Integer)
Data = "1234567890+"
If KeyAscii < 26 Then
KeyAscii = KeyAscii
Else
If InStr(Data, Chr(KeyAscii)) = 0 Then
KeyAscii = 0
Exit Sub
End If
End If
End Sub
Private Sub txthousenumber_KeyPress(KeyAscii As Integer)
Data = "2345678901"
If KeyAscii < 26 Then
KeyAscii = KeyAscii
Else
If InStr(Data, Chr(KeyAscii)) = 0 Then
KeyAscii = 0
Exit Sub
End If
End If
Bachelor of Science in Information TechnologyPage 59

ISABELA STATE UNIVERSITY


Cauayan Campus
Cauayan City, Isabela
COLLEGE OF COMPUTING AND INFORMATION TECHNOLOGY
End Sub
Private Sub txtidnumber_KeyPress(KeyAscii As Integer)
Data = "1234567890"
If KeyAscii < 26 Then
KeyAscii = KeyAscii
Else
If InStr(Data, Chr(KeyAscii)) = 0 Then
KeyAscii = 0
Exit Sub
End If
End If
End Sub
Private Sub txtlastname_KeyPress(KeyAscii As Integer)
Data = "qwertyuiopasdfghjklxcvbnmQWERTYUIOPASDFGHJKLXCVBNM- "
If KeyAscii < 26 Then
KeyAscii = KeyAscii
Else
If InStr(Data, Chr(KeyAscii)) = 0 Then
KeyAscii = 0
Exit Sub
End If
End If
End Sub
Private Sub txtmiddlename_KeyPress(KeyAscii As Integer)
Data = "qwertyuiopasdfghjklxcvbnmQWERTYUIOPASDFGHJKLXCVBNM- "
If KeyAscii < 26 Then
KeyAscii = KeyAscii
Else
If InStr(Data, Chr(KeyAscii)) = 0 Then
KeyAscii = 0
Exit Sub
End If
End If
End Sub
Private Sub txtmobilenumber_KeyPress(KeyAscii As Integer)
Data = "1234567890+"
If KeyAscii < 26 Then
KeyAscii = KeyAscii
Else
If InStr(Data, Chr(KeyAscii)) = 0 Then
KeyAscii = 0
Exit Sub
Bachelor of Science in Information TechnologyPage 60

ISABELA STATE UNIVERSITY


Cauayan Campus
Cauayan City, Isabela
COLLEGE OF COMPUTING AND INFORMATION TECHNOLOGY
End If
End If
End Sub
Private Sub txtprovince_KeyPress(KeyAscii As Integer)
Data = "qwertyuiopasdfghjklxcvbnmQWERTYUIOPASDFGHJKLXCVBNM- "
If KeyAscii < 26 Then
KeyAscii = KeyAscii
Else
If InStr(Data, Chr(KeyAscii)) = 0 Then
KeyAscii = 0
Exit Sub
End If
End If
End Sub
Private Sub txtrelationship_KeyPress(KeyAscii As Integer)
Data = "qwertyuiopasdfghjklxcvbnmQWERTYUIOPASDFGHJKLXCVBNM- "
If KeyAscii < 26 Then
KeyAscii = KeyAscii
Else
If InStr(Data, Chr(KeyAscii)) = 0 Then
KeyAscii = 0
Exit Sub
End If
End If
End Sub
Private Sub txtstreet_KeyPress(KeyAscii As Integer)
Data = "qwertyuiopasdfghjklxcvbnmQWERTYUIOPASDFGHJKLXCVBNM- "
If KeyAscii < 26 Then
KeyAscii = KeyAscii
Else
If InStr(Data, Chr(KeyAscii)) = 0 Then
KeyAscii = 0
Exit Sub
End If
End If
End Sub
Private Sub txttowncity_KeyPress(KeyAscii As Integer)
Data = "qwertyuiopasdfghjklxcvbnmQWERTYUIOPASDFGHJKLXCVBNM- "
If KeyAscii < 26 Then
KeyAscii = KeyAscii
Else
If InStr(Data, Chr(KeyAscii)) = 0 Then
Bachelor of Science in Information TechnologyPage 61

ISABELA STATE UNIVERSITY


Cauayan Campus
Cauayan City, Isabela
COLLEGE OF COMPUTING AND INFORMATION TECHNOLOGY
KeyAscii = 0
Exit Sub
End If
End If
End Sub
SystemNumberForm
Public Sub systemnumber()
systemnumberid = "1"
On Error Resume Next
Connect
Set rs = New [Link]
[Link] "select * from tblsystemnumber", con, adOpenDynamic, adLockOptimistic
If [Link] = 0 Then
[Link] = "&Save"
Else
systemnumberid = [Link]!systemnumberid
[Link] = [Link]!systemnumber
[Link] = [Link]!entryby
[Link] = [Link]!entrydate
[Link] = [Link]!updatedby
[Link] = [Link]!lastupdate
[Link] = "&Update"
End If
[Link](2).Text = [Link]!systemnumber
End Sub
Private Sub cmdsave_Click()
If [Link] = "" Then
MsgBox "System Number Required!", , "System"
[Link]
Else
If [Link] = "&Save" Then
Connect
sql = "select * from tblsystemnumber"
Set rs = New [Link]
[Link] sql, con, adOpenDynamic, adLockOptimistic
With rs
.AddNew
[Link]!systemnumberid = systemnumberid
[Link]!systemnumber = [Link]
[Link]!entryby = [Link](1).Text
Bachelor of Science in Information TechnologyPage 62

ISABELA STATE UNIVERSITY


Cauayan Campus
Cauayan City, Isabela
COLLEGE OF COMPUTING AND INFORMATION TECHNOLOGY
[Link]!entrydate = Now
.Update
End With
Unload Me
MsgBox "System Number successfully saved!", vbInformation, "System"
[Link]
Else
[Link] "update tblsystemnumber set" & vbCrLf & _
"systemnumber='" & [Link] & "'," & vbCrLf & _
"updatedby='" & [Link](1).Text & "'," & vbCrLf & _
"lastupdate='" & Now & "'" & vbCrLf & _
"where systemnumberid='" & systemnumberid & "'"
Unload Me
MsgBox "System Number successfully updated!", vbInformation, "System"
[Link]
End If
End If
End Sub
Private Sub Form_Activate()
Call systemnumber
End Sub
Private Sub txtsystemnumber_KeyPress(KeyAscii As Integer)
Data = "1234567890+"
If KeyAscii < 26 Then
KeyAscii = KeyAscii
Else
If InStr(Data, Chr(KeyAscii)) = 0 Then
KeyAscii = 0
Exit Sub
End If
End If
End Sub

UpdateEnrolleeForm
Public Sub fillyearlevel()
Set rs = Nothing
[Link] "select * from tblyearlevel", con, adOpenDynamic, adLockOptimistic
Do While Not [Link]
[Link] [Link]!yearlevel
Bachelor of Science in Information TechnologyPage 63

ISABELA STATE UNIVERSITY


Cauayan Campus
Cauayan City, Isabela
COLLEGE OF COMPUTING AND INFORMATION TECHNOLOGY
[Link]
Loop
[Link]
End Sub
Private Sub cmdupdate_Click()
If [Link] = "" Then
MsgBox "Please fill ID Number!", , "System"
[Link]
ElseIf [Link] = "" Then
MsgBox "Please select Year Level!", , "System"
[Link]
ElseIf [Link] = "" Then
MsgBox "Please fill Last Name!", , "System"
[Link]
ElseIf [Link] = "" Then
MsgBox "Please fill First Name!", , "System"
[Link]
ElseIf [Link] = "" Then
MsgBox "Please fill Middle Name!", , "System"
[Link]
ElseIf [Link] = "" Then
MsgBox "Please fill Mobile Number!", , "System"
[Link]
ElseIf [Link] = "" Then
MsgBox "Please Select Gender!", , "System"
[Link]
ElseIf [Link] = "" Then
[Link] = "none"
ElseIf [Link] = "" Then
MsgBox "Please fill Barangay!", , "System"
[Link]
ElseIf [Link] = "" Then
MsgBox "Please fill Town/City!", , "System"
[Link]
ElseIf [Link] = "" Then
MsgBox "Please fill province!", , "System"
[Link]
ElseIf [Link] = "" Then
MsgBox "Please fill Guardian's Name!", , "System"
[Link]
ElseIf [Link] = "" Then
MsgBox "Please fill Relationship!", , "System"
[Link]
ElseIf [Link] = "" Then
MsgBox "Please fill Guardian's Number!", , "System"
Bachelor of Science in Information TechnologyPage 64

ISABELA STATE UNIVERSITY


Cauayan Campus
Cauayan City, Isabela
COLLEGE OF COMPUTING AND INFORMATION TECHNOLOGY
[Link]
ElseIf [Link] = "" Then
[Link] = "0"
Else
completename = [Link] & " " & [Link] & "-" & [Link]
& " " & [Link]
completeaddress = [Link] & ", " & [Link] & ", " & [Link]
& ", " & [Link] & ", " & [Link]
[Link] "update tblstudent set" & vbCrLf & _
"firstname='" & [Link] & "'," & vbCrLf & _
"lastname='" & [Link] & "'," & vbCrLf & _
"middlename='" & [Link] & "'," & vbCrLf & _
"extensionname='" & [Link] & "'," & vbCrLf & _
"completename='" & completename & "'," & vbCrLf & _
"dateofbirth='" & [Link] & "'," & vbCrLf & _
"mobilenumber='" & [Link] & "'," & vbCrLf & _
"gender='" & [Link] & "'," & vbCrLf & _
"emailaddress='" & [Link] & "'," & vbCrLf & _
"housenumber='" & [Link] & "'," & vbCrLf & _
"street='" & [Link] & "'," & vbCrLf & _
"barangay='" & [Link] & "'," & vbCrLf & _
"towncity='" & [Link] & "'," & vbCrLf & _
"province='" & [Link] & "'," & vbCrLf & _
"guardiansname='" & [Link] & "'," & vbCrLf & _
"relationship='" & [Link] & "'," & vbCrLf & _
"guardiansnumber='" & [Link] & "'," & vbCrLf & _
"completeaddress='" & completeaddress & "'," & vbCrLf & _
"yearlevel='" & [Link] & "'," & vbCrLf & _
"updatedby='" & [Link](1).Text & "'," & vbCrLf & _
"lastupdate='" & Now & "'" & vbCrLf & _
"where idnumber='" & [Link] & "'"
MsgBox "Enrollee successfully updated!", vbInformation, "System"
Unload Me
[Link]
End If
End Sub
Private Sub Form_Activate()
Call fillyearlevel
End Sub
Private Sub Form_Unload(Cancel As Integer)
[Link]
End Sub
Private Sub txtamountpaid_KeyPress(KeyAscii As Integer)
Bachelor of Science in Information TechnologyPage 65

ISABELA STATE UNIVERSITY


Cauayan Campus
Cauayan City, Isabela
COLLEGE OF COMPUTING AND INFORMATION TECHNOLOGY
Data = "1234567890"
If KeyAscii < 26 Then
KeyAscii = KeyAscii
Else
If InStr(Data, Chr(KeyAscii)) = 0 Then
KeyAscii = 0
Exit Sub
End If
End If
End Sub
Private Sub txtbarangay_KeyPress(KeyAscii As Integer)
Data = "qwertyuiopasdfghjklxcvbnmQWERTYUIOPASDFGHJKLXCVBNM- "
If KeyAscii < 26 Then
KeyAscii = KeyAscii
Else
If InStr(Data, Chr(KeyAscii)) = 0 Then
KeyAscii = 0
Exit Sub
End If
End If
End Sub
Private Sub txtemailaddress_KeyPress(KeyAscii As Integer)
Data = "qwertyuiopasdfghjklxcvbnmQWERTYUIOPASDFGHJKLXCVBNM-_!@#$
%^&*()+=[]{}<>./?1234567890"
If KeyAscii < 26 Then
KeyAscii = KeyAscii
Else
If InStr(Data, Chr(KeyAscii)) = 0 Then
KeyAscii = 0
Exit Sub
End If
End If
End Sub
Private Sub txtextensionname_KeyPress(KeyAscii As Integer)
Data = "JSrIV"
If KeyAscii < 26 Then
KeyAscii = KeyAscii
Else
If InStr(Data, Chr(KeyAscii)) = 0 Then
KeyAscii = 0
Exit Sub
End If
End If
Bachelor of Science in Information TechnologyPage 66

ISABELA STATE UNIVERSITY


Cauayan Campus
Cauayan City, Isabela
COLLEGE OF COMPUTING AND INFORMATION TECHNOLOGY
End Sub
Private Sub txtfirstname_KeyPress(KeyAscii As Integer)
Data = "qwertyuiopasdfghjklxcvbnmQWERTYUIOPASDFGHJKLXCVBNM- "
If KeyAscii < 26 Then
KeyAscii = KeyAscii
Else
If InStr(Data, Chr(KeyAscii)) = 0 Then
KeyAscii = 0
Exit Sub
End If
End If
End Sub
Private Sub txtguardiansname_KeyPress(KeyAscii As Integer)
Data = "qwertyuiopasdfghjklxcvbnmQWERTYUIOPASDFGHJKLXCVBNM- "
If KeyAscii < 26 Then
KeyAscii = KeyAscii
Else
If InStr(Data, Chr(KeyAscii)) = 0 Then
KeyAscii = 0
Exit Sub
End If
End If
End Sub
Private Sub txtguardiansnumber_KeyPress(KeyAscii As Integer)
Data = "1234567890+"
If KeyAscii < 26 Then
KeyAscii = KeyAscii
Else
If InStr(Data, Chr(KeyAscii)) = 0 Then
KeyAscii = 0
Exit Sub
End If
End If
End Sub
Private Sub txthousenumber_KeyPress(KeyAscii As Integer)
Data = "2345678901"
If KeyAscii < 26 Then
KeyAscii = KeyAscii
Else
If InStr(Data, Chr(KeyAscii)) = 0 Then
KeyAscii = 0
Exit Sub
Bachelor of Science in Information TechnologyPage 67

ISABELA STATE UNIVERSITY


Cauayan Campus
Cauayan City, Isabela
COLLEGE OF COMPUTING AND INFORMATION TECHNOLOGY
End If
End If
End Sub
Private Sub txtidnumber_KeyPress(KeyAscii As Integer)
Data = "1234567890"
If KeyAscii < 26 Then
KeyAscii = KeyAscii
Else
If InStr(Data, Chr(KeyAscii)) = 0 Then
KeyAscii = 0
Exit Sub
End If
End If
End Sub
Private Sub txtlastname_KeyPress(KeyAscii As Integer)
Data = "qwertyuiopasdfghjklxcvbnmQWERTYUIOPASDFGHJKLXCVBNM- "
If KeyAscii < 26 Then
KeyAscii = KeyAscii
Else
If InStr(Data, Chr(KeyAscii)) = 0 Then
KeyAscii = 0
Exit Sub
End If
End If
End Sub
Private Sub txtmiddlename_KeyPress(KeyAscii As Integer)
Data = "qwertyuiopasdfghjklxcvbnmQWERTYUIOPASDFGHJKLXCVBNM- "
If KeyAscii < 26 Then
KeyAscii = KeyAscii
Else
If InStr(Data, Chr(KeyAscii)) = 0 Then
KeyAscii = 0
Exit Sub
End If
End If
End Sub
Private Sub txtmobilenumber_KeyPress(KeyAscii As Integer)
Data = "1234567890+"
If KeyAscii < 26 Then
KeyAscii = KeyAscii
Else
If InStr(Data, Chr(KeyAscii)) = 0 Then
Bachelor of Science in Information TechnologyPage 68

ISABELA STATE UNIVERSITY


Cauayan Campus
Cauayan City, Isabela
COLLEGE OF COMPUTING AND INFORMATION TECHNOLOGY
KeyAscii = 0
Exit Sub
End If
End If
End Sub
Private Sub txtprovince_KeyPress(KeyAscii As Integer)
Data = "qwertyuiopasdfghjklxcvbnmQWERTYUIOPASDFGHJKLXCVBNM- "
If KeyAscii < 26 Then
KeyAscii = KeyAscii
Else
If InStr(Data, Chr(KeyAscii)) = 0 Then
KeyAscii = 0
Exit Sub
End If
End If
End Sub
Private Sub txtrelationship_KeyPress(KeyAscii As Integer)
Data = "qwertyuiopasdfghjklxcvbnmQWERTYUIOPASDFGHJKLXCVBNM- "
If KeyAscii < 26 Then
KeyAscii = KeyAscii
Else
If InStr(Data, Chr(KeyAscii)) = 0 Then
KeyAscii = 0
Exit Sub
End If
End If
End Sub
Private Sub txtstreet_KeyPress(KeyAscii As Integer)
Data = "qwertyuiopasdfghjklxcvbnmQWERTYUIOPASDFGHJKLXCVBNM- "
If KeyAscii < 26 Then
KeyAscii = KeyAscii
Else
If InStr(Data, Chr(KeyAscii)) = 0 Then
KeyAscii = 0
Exit Sub
End If
End If
End Sub
Private Sub txttowncity_KeyPress(KeyAscii As Integer)
Data = "qwertyuiopasdfghjklxcvbnmQWERTYUIOPASDFGHJKLXCVBNM- "
If KeyAscii < 26 Then
KeyAscii = KeyAscii
Bachelor of Science in Information TechnologyPage 69

ISABELA STATE UNIVERSITY


Cauayan Campus
Cauayan City, Isabela
COLLEGE OF COMPUTING AND INFORMATION TECHNOLOGY
Else
If InStr(Data, Chr(KeyAscii)) = 0 Then
KeyAscii = 0
Exit Sub
End If
End If
End Sub
UserMaintenanceForm
Private Sub getuser()
[Link]
Connect
sql = "select * from tblusers"
Set rs = New [Link]
[Link] sql, con, adOpenDynamic, adLockOptimistic
Do Until [Link]
With [Link](, , rs!id)
.SubItems(1) = rs!userid
.SubItems(2) = rs!longname
.SubItems(3) = rs!usertype
End With
[Link]
Loop
[Link]
End Sub
Private Sub edituser()
On Error Resume Next
Connect
Set rs = New [Link]
[Link] "select * from tblusers where id='" & [Link] & "'", con,
adOpenDynamic, adLockOptimistic
With addupdateuserform
.Caption = "Edit User - " & [Link]!userid
.[Link] = [Link]!userid
.[Link] = [Link]!firstname
.[Link] = [Link]!lastname
.[Link] = [Link]!mi
.[Link] = [Link]!extensionname
.[Link] = [Link]!longname
.[Link] = [Link]!usertype
.[Link] = [Link]!Password
.[Link] = [Link]!entryby
Bachelor of Science in Information TechnologyPage 70

ISABELA STATE UNIVERSITY


Cauayan Campus
Cauayan City, Isabela
COLLEGE OF COMPUTING AND INFORMATION TECHNOLOGY
.[Link] = [Link]!entrydate
.[Link] = [Link]!updatedby
.[Link] = [Link]!lastupdate
.[Link] = "&Update"
.[Link] = False
End With
[Link]
End Sub
Private Sub cmdadd_Click()
[Link] = "Add User"
[Link]
Unload Me
End Sub
Private Sub cmddelete_Click()
If vbYes = MsgBox("Are you sure you want to delete " &
[Link](1) & "?", vbQuestion + vbYesNo, "System") Then
[Link] "delete from tblusers where userid='" &
[Link](1) & "'"
MsgBox "" & [Link](1) & " successfully deleted!",
vbInformation, "System"
[Link]
Call getuser
Else
[Link]
Call getuser
End If
End Sub
Private Sub cmdedit_Click()
Call edituser
Unload Me
End Sub
Private Sub Form_Load()
Call getuser
End Sub
Private Sub ListView1_DblClick()
Call edituser
Unload Me
End Sub
UserTypeForm
Bachelor of Science in Information TechnologyPage 71

ISABELA STATE UNIVERSITY


Cauayan Campus
Cauayan City, Isabela
COLLEGE OF COMPUTING AND INFORMATION TECHNOLOGY

Private Sub getusertype()


[Link]
Connect
sql = "select * from tblusertype"
Set rs = New [Link]
[Link] sql, con, adOpenDynamic, adLockOptimistic
Do Until [Link]
With [Link](, , rs!usertypeid)
.SubItems(1) = rs!usertype
End With
[Link]
Loop
[Link]
End Sub
Private Sub editusertype()
On Error Resume Next
id = [Link]
Connect
Set rs = New [Link]
[Link] "select * from tblusertype where usertypeid='" & [Link] &
"'", con, adOpenDynamic, adLockOptimistic
With addupdateusertypeform
.Caption = "Edit Usertype"
.[Link] = [Link]!usertype
.[Link] = "&Update"
End With
[Link]
End Sub
Private Sub cmdadd_Click()
[Link] = "Add User"
[Link]
Unload Me
End Sub
Private Sub cmddelete_Click()
If vbYes = MsgBox("Are you sure you want to delete " &
[Link](1) & "?", vbQuestion + vbYesNo, "System") Then
[Link] "delete from tblusertype where usertypeid='" &
[Link] & "'"
MsgBox "" & [Link](1) & " successfully deleted!",
vbInformation, "System"
Bachelor of Science in Information TechnologyPage 72

ISABELA STATE UNIVERSITY


Cauayan Campus
Cauayan City, Isabela
COLLEGE OF COMPUTING AND INFORMATION TECHNOLOGY
[Link]
Call getusertype
Else
[Link]
Call getusertype
End If
End Sub
Private Sub cmdedit_Click()
Call editusertype
Unload Me
End Sub
Private Sub Form_Load()
Call getusertype
End Sub
Private Sub ListView1_DblClick()
Call editusertype
Unload Me
End Sub
YearLevelForm
Private Sub getyearlevel()
[Link]
Connect
sql = "select * from tblyearlevel"
Set rs = New [Link]
[Link] sql, con, adOpenDynamic, adLockOptimistic
Do Until [Link]
With [Link](, , rs!yearlevelid)
.SubItems(1) = rs!yearlevel
End With
[Link]
Loop
[Link]
End Sub
Private Sub edityearlevel()
On Error Resume Next
id = [Link]
Connect
Set rs = New [Link]
[Link] "select * from tblyearlevel where yearlevelid='" & [Link]
Bachelor of Science in Information TechnologyPage 73

ISABELA STATE UNIVERSITY


Cauayan Campus
Cauayan City, Isabela
COLLEGE OF COMPUTING AND INFORMATION TECHNOLOGY
& "'", con, adOpenDynamic, adLockOptimistic
With addupdateyearlevelform
.Caption = "Edit Year Level"
.[Link] = [Link]!yearlevel
.[Link] = "&Update"
End With
[Link]
End Sub
Private Sub cmdadd_Click()
[Link] = "Add Year Level"
[Link]
Unload Me
End Sub
Private Sub cmddelete_Click()
If vbYes = MsgBox("Are you sure you want to delete " &
[Link](1) & "?", vbQuestion + vbYesNo, "System") Then
[Link] "delete from tblyearlevel where yearlevelid='" &
[Link] & "'"
MsgBox "" & [Link](1) & " successfully deleted!",
vbInformation, "System"
[Link]
Call getyearlevel
Else
[Link]
Call getyearlevel
End If
End Sub
Private Sub cmdedit_Click()
Call edityearlevel
Unload Me
End Sub
Private Sub Form_Load()
Call getyearlevel
End Sub
Private Sub ListView1_DblClick()
Call edityearlevel
Unload Me
End Sub

Bachelor of Science in Information TechnologyPage 74

ISABELA STATE UNIVERSITY


Cauayan Campus
Cauayan City, Isabela
COLLEGE OF COMPUTING AND INFORMATION TECHNOLOGY

Bachelor of Science in Information TechnologyPage 75

You might also like