Professional Documents
Culture Documents
K.A.L.M. Management: Clark
K.A.L.M. Management: Clark
TeChn0l0gY
K.A.L.M.
Management
Nicholas Santos
Thesis Adviser
Gr0up II
Ashly Jane g0mEz
KrisheL Kay AlegRE
Liza L0mibA0
Mark Alexander mAmangUN
Codes:
DG.Refresh
End Sub
Form name: emp_add (entry_add.frm)
Codes:
If VALID_FLAG Then
TXT1 = ""
TXT1 = "insert into employee values('" & txtempcode & "','" _
& txtempname & "','" _
& Combo1.Text & "'," _
& txtphone & ",'" _
& txtaddress & "'," _
& txtpincode & ",'" _
& txtemail & "','" _
& txtdoj & "'," _
& txtmonthlysal & ")"
TXT2 = ""
TXT2 = "select * from employee where EMP_CODE = '" & Trim(txtempcode) & "'"
If RS.State = 1 Then
RS.Close
End If
RS.Open TXT2, CONN, adOpenKeyset, adLockOptimistic
'MsgBox RS.RecordCount
If RS.RecordCount > 0 Then
MsgBox "Duplicate Entry : The employee code exists in employee table", vbCritical
RS.Close
Else
If RS.State = 1 Then
RS.Close
End If
RS.Open TXT1, CONN, adOpenKeyset, adLockOptimistic
MsgBox "Successfully added"
Clear_all
End If ' end of -> If RS.RecordCount > 0 Then
If RS.State = 1 Then
RS.Close
End If
txtempcode = RS.Fields(0)
txtempname = RS.Fields(1)
Combo1.Text = RS.Fields(2)
txtphone = RS.Fields(3)
txtaddress = RS.Fields(4)
txtpincode = RS.Fields(5)
txtemail = RS.Fields(6)
txtdoj = RS.Fields(7)
txtmonthlysal = RS.Fields(8)
Else
MsgBox "No matching record found for EMP CODE =" & txtempcode, vbCritical
End If
RS.Close
End Sub
End Sub
TXT1 = ""
TXT1 = "select distinct dept_cd from employee"
If RS.State = 1 Then
RS.Close
End If
End Sub
Codes:
End Sub
If RS.State = 1 Then
RS.Close
End If
txtempcode = RS.Fields(0)
txtempname = RS.Fields(1)
Combo1.Text = RS.Fields(2)
txtphone = RS.Fields(3)
txtaddress = RS.Fields(4)
txtpincode = RS.Fields(5)
txtemail = RS.Fields(6)
txtdoj = RS.Fields(7)
' TXT1 = "select salary from salary where emp_code ='" & txtempcode & "' and
sal_paid = 0 and sal_due = 0"
' If RS.State = 1 Then
' RS.Close
' End If
' RS.Open TXT1, CONN, adOpenKeyset, adLockOptimistic
txtmonthlysal = RS.Fields(8)
Delete.Enabled = True
Else
MsgBox "No matching record found for EMP CODE =" & txtempcode, vbCritical
Delete.Enabled = False
End If
RS.Close
End Sub
End Sub
If RS.State = 1 Then
RS.Close
End If
RS.Open TXT1, CONN, adOpenKeyset, adLockOptimistic
TXT1 = "delete from salary where EMP_CODE = '" & txtempcode & "'"
If RS.State = 1 Then
RS.Close
End If
RS.Open TXT1, CONN, adOpenKeyset, adLockOptimistic
Delete.Enabled = False
End If
emp.DG.Refresh
End Sub
End Sub
Codes:
If RS.State = 1 Then
RS.Close
End If
txtempcode = RS.Fields(0)
txtempname = RS.Fields(1)
Combo1.Text = RS.Fields(2)
txtphone = RS.Fields(3)
txtaddress = RS.Fields(4)
txtpincode = RS.Fields(5)
txtemail = RS.Fields(6)
txtdoj = RS.Fields(7)
txtmonthlysal = RS.Fields(8)
txtempcode.Enabled = False
Update.Enabled = True
Else
MsgBox "No matching record found for EMP CODE =" & txtempcode, vbCritical
End If
RS.Close
End Sub
End Sub
TXT1 = ""
TXT1 = "select distinct dept_cd from employee"
If RS.State = 1 Then
RS.Close
End If
Update.Enabled = False
End Sub
If VALID_FLAG Then
If MsgBox("Are you sure to update?", vbYesNo) = vbYes Then
TXT1 = ""
TXT1 = "Update employee set EMP_NAME = '" _
& txtempname & "', DEPT_CD = '" _
& Combo1.Text & "', PHONE = " _
& txtphone & ", ADDRESS = '" _
& txtaddress & "', PIN_CODE = " _
& txtpincode & ", EMAIL = '" _
& txtemail & "', DOJ = '" _
& txtdoj & "' , SALARY = " & txtmonthlysal & " where EMP_CODE = '" &
txtempcode & "'"
MsgBox TXT1
If RS.State = 1 Then
RS.Close
End If
RS.Open TXT1, CONN, adOpenKeyset, adLockOptimistic
MsgBox "Successfully updated"
Clear_all
txtempcode.Enabled = True
Update.Enabled = False
End If
End Sub
Form name : Frm1 (Frm1.frm)
Codes:
Codes:
Private Sub Command1_Click()
If (LCase(Text1.Text)) = "admin" And (LCase(Text2.Text)) = "payroll" Then
Unload Me
MDIForm1.Show
Else
MsgBox "Please Enter Correct Username and Password"
End If
End Sub
Codes:
Private Sub about_Click()
MsgBox " this is a payroll system software" & vbNewLine & "" _
&" programmed by:K.A.L.M. MANAGEMENT"
End Sub
End Sub
End Sub
If RS.State = 1 Then
RS.Close
End If
cmdPAY.Enabled = False
End Sub
Private Sub Command1_Click()
'cmdPAY.Enabled = True
TXT1 = ""
TXT1 = "select * from employee where EMP_CODE = '" & txtempcode & "'"
If RS.State = 1 Then
RS.Close
End If
TXT1 = ""
TXT1 = "select * from salary where EMP_CODE = '" & txtempcode & "'"
If RS.State = 1 Then
RS.Close
End If
If RS.RecordCount = 0 Then ' means No salary paid so far, hence calculate from
DOJ
NoOfDays = DateDiff("d", DOJ, txtdosal) + 1
MsgBox NoOfDays
If RS.State = 1 Then
RS.Close
End If
RS.Open TXT1, CONN, adOpenKeyset, adLockOptimistic
txtlastdop = RS.Fields(0)
txtLASTPAID = RS.Fields(1)
End If
End If
Else
MsgBox "No matching record found for EMP CODE =" & txtempcode, vbCritical
End If
RS.Close
End Sub
If CONN.State = 1 Then
CONN.Close
End If
Clear_all
txtdosal = Date
cmdPAY.Enabled = False
End Sub
Modules
A module is essentially a collection of declarations, statements, and
procedures stored together as one named unit to organize your Microsoft Visual Basic
(Microsoft Visual Basic is a high-level, visual-programming version of Basic. Visual
Basic was developed by Microsoft for building Windows-based applications.) code.
Microsoft Access has two types of modules: standard modules and class modules (class
module is a module that can contain the definition for a new object. Each instance of a
class creates a new object. Procedures defined in the module become properties and
methods of the object. Class modules can exist alone or with forms and reports.).
Module name: Module1(Payroll.bas)
Codes:
'******
'MODULE
'******
'PUBLIC VARIABLE DECLARATION
Global CONN As New ADODB.Connection
Global RS As New ADODB.Recordset
Global CMD As New ADODB.Command
Global TXT1, TXT2 As Variant
Global VALID_FLAG As Boolean
Designers
DataEnvironment1(DE1.Dsr)