Vous êtes sur la page 1sur 80

LIST OF TABLES

Page
Table 4.1 Account Table ---------------------------------------------------------- 11
Figure 4.2 Deactivated Table ---------------------------------------------------- 11
Figure 4.3 DTR Table ------------------------------------------------------------ 12
Figure 4.4 Employees Table ----------------------------------------------------- 12
Figure 4.5 Event Table ----------------------------------------------------------- 13
Figure 4.6 Paid Table ------------------------------------------------------------- 13
Figure 4.7 Salary Loan Table ---------------------------------------------------- 14
Figure 4.8 Data Dictionary -------------------------------------------------- 25 - 26

Page | 1

LIST OF FIGURES
Page
Figure 4.1 Employee Tracking System ER Diagram ----------------------------- 10
Figure 4.2 Log-in Option ------------------------------------------------------------- 14
Figure 4.3 Log-in Form --------------------------------------------------------------- 15
Figure 4.4 User Account Form ----------------------------------------------------- 15
Figure 4.5 Employee Tracking Form ---------------------------------------------- 16
Figure 4.6 Employee DTR ----------------------------------------------------------- 17
Figure 4.7 Payroll Form -------------------------------------------------------------- 18
Figure 4.8 Position Form ------------------------------------------------------------- 19
Figure 4.9 System Menu Form ------------------------------------------------------- 20
Figure 4.11 Freeze -------------------------------------------------------------------- 20
Figure 4.12 Back-up ------------------------------------------------------------------- 21
Figure 4.13 Confirm Back-up -------------------------------------------------------- 21
Figure 4.14 Save Back-up file -------------------------------------------------------- 22
Figure 4.15 Restore ------------------------------------------------------------------- 22
Figure 4.16 Lock for Restore File -------------------------------------------------- 23
Figure 4.17 Confirm Restore ------------------------------------------------------- 23
Figure 4.18 About the Program --------------------------------------------------- 24
Figure 4.19 Log-out ------------------------------------------------------------------ 24
Figure 4.20 Flowchart --------------------------------------------------------- 26 - 27

Page | 2

CHAPTER 1
INTRODUCTION
Nowadays, successful businesses use technology and make the best of it. They use it as a
tool for a progressive production in different aspects of a company. Including organizing,
storing, and securing data and others with technology, and the help of computers,
business transactions goes smoother, faster, and better.

1.1.

BACKGROUND OF THE STUDY


Payroll function is necessary for every company. From large and complex
app the way to small and medium enterprises, payroll is crucial and critical.
Payroll department calculates the employees salaries, wages, bonus, withheld
taxes and other companies liabilities.
Payroll is very crucial and critical becauseit may greatly affect the net
income of the company. A great calculation and efficient practices of payroll
department causes growth and high differentiation of the company.
This Employee Tracking System aims to support DTR and Payroll
function is more advanced and efficient way. To get rid of difficult basic practices
of DTR and Payroll, the developers created system to assist those conditions.

1.2.

STATEMENT OF THE PROBLEM


The Payroll System is usually done by the Accounting Officer with the
guidance of the general manager of the company. He/she must keep track of the
employees track record and be updated about positions salary. And the said
company uses spreadsheet application to provide payslip and salary computations.

Page | 3

The above mentioned processes are prone to human error and may lead to
companys incompetence and profit loss. But on these situations may be avoided
with the use of our developed Payroll System.
1.3.

OBJECTIVES
This system aims to assist the company to have an efficient and effective
way of monitoring employees time keeping and payroll system to give a higher
quality and service.
1. To minimize the manual checking of each daily time record.
2. Develop a system that will monitor employees data that is efficient to
3.
4.
5.
6.
7.

1.4.

use.
To provide an easy log-in and log-out of the employees and staff
Calculate payroll transaction easily.
View employees current salary and status.
Provide an efficient and interactive interface for the users.
Have an accurate view on all employees daily record.

SIGNIFICANCE OF THE STUDY


. Many company use a timekeeping system, such as clock time to track
work hours of the employees. The proponents develop a system to make
transactions more reliable and easy to use. The Employee Tracking and Payroll
System will manage employees personal information, salaries/wages in safe and
efficient manner. It calculates the total hours worked and paid. And to provide
accurate payslip records and payroll computations. In order to avoid misprints and
miscalculations on every employees salary.
With the help of our system, company will benefit on our system and
provide smoother, faster service.

1.5.

SCOPE AND LIMITATIONS


SCOPE
Page | 4

The proposed system Time Keeping and Payroll System covers many aspects of
time keeping and payroll process. This includes the capture of information based
on the employees work schedule, daily time worked and daily time rendered. The
payroll process encompasses all activities necessary to report employees time
worked. The system will convert the current companys time keeping and payroll
into Visual Basic Program.
1.
2.
3.
4.
5.

The system allows the user to add, edit, and delete employee records.
The system allows to add or delete user accounts.
Calculate payroll transaction easily.
It has log-in log-out process for security purpose.
The administrator or Human Resources will be the one who can
manipulate all the records

LIMITATIONS
With utilization and proper usage, the Payroll System with DTR will
function smoothly to help the company. But there are some limitations in using
the system in order to acquire satisfaction. The following are the limitations of our
system:

1. A proposed system which can only be access by authorized person.


2. It does not support network topology implementation, online program,
or online transaction.
3. To find out what is the salary history of an employee.

Page | 5

CHAPTER 2
METHODOLOGY
In this chapter, it is all about how the proposed system study, being planned, and
design. This also tackles with the gathering procedures, analysis of the data, research
design, and instruments being used.
The Employee tracking and Payroll System focuses on helping the company make
calculations for payslips accurately and smoothly. It also enables the companys
employee to monitor the daily time record with interactive user interface, records, and
datas are easy to manage. Employees can view their current record and salary. The
administrator and Human Resources will handle the encoding and editing of details
depending on what type employee details.
With the help of research, sample online system models, applications especially
the Microsoft Visual Basic and Adobe Photoshop CS3, we were able to create and
propose such reliable system.
VB or Visual Basic is a programming tool that user used to develop Windows or
GUI (Graphical User Interface) applications. It means that rather than writing numerous
line for code to describe the appearance and location for interface elements like C, C++,
Page | 6

or Basic. User can simply drag and drop pre-built objects into the form window on
computer screen.
Adobe Photoshop is an image editing software developed and manufactured by
Adobe System Inc. Photoshop is considered one of the leaders in photo editing software.
The software allows users to manipulate, crop, resize, and correct color on digital photos.
CHAPTER 3
DATA GATHERING PROCEDURES AND OUTPUTS
The proponents conduct internet research to gather more data and topics that are
related to our study. We also conduct interview with the staff of Unident Dental
Laboratory, who offers denture making services and orthodontic equipments located in
Mandaluyong City.
The Timekeeping and Payroll System of Unident Dental Laboratory are
sometimes imprecise to use. Because the employees of the company are using Bundy
Clock to indicate their daily time record of work in and out every day. It is hustle to them
to use long term creating the payroll slip and the time keeping which the Human
Resources need to encode all the attendance of employee using spreadsheets.
Because of the current Timekeeping and Payroll system of Unident Dental
Laboratory, weve decided to do some research on the internet of sample payroll system
to gather more ideas and how to design our proposed system.

Page | 7

CHAPTER 4
PROPOSED SYSTEM
The proposed system is the Employee tracking System. The system aims to assist
the companys payroll department with their calculations practices. With the utilization of
the system, all computations and transactions are expected to be a reliable and accurate.
Employee Tracking System also features the log-in and log-out platform for all
the employees. This is an effective way of monitoring the attendance performance of all
the staff and employees of the company.
Through this system, the administrator has a direct access with the employees
records. The administrator may add, edit, and delete employee records.
Employee tracking System is specifically designed to lessen the wasted time and
efforts exerted to Payroll practices done through manual process. This system made an
automated, reliable, and fast Payroll function possible.

THE DATABASE DESIGN

Page | 8

Our system Employee Tracking System manages employees personal


information, salaries, wage in safe and efficient manner. And to make this feasible, the
researchers incorporate the system with a database design and system.
The database design of the system is created in Microsoft Access 2003
application. It consists of all the tables with corresponding fields, accessible by the
Employee Tracking System itself. The entities-attributes figure is show below.
The entities relationships diagram of the Employee tracking System is shown
below.

Page | 9

Payroll Department

Id Number
Password
Retype Password
Position
Full Name

Rate
SSS
Bonus
Month13
Phil Health

Salary
Loss Damage
Cash Advance
Loan Interest
Loan amount
Loan Damage
Loan Remain
Total Gross

User
Account

1:N
1:N

Position

1:N

Deactivate
Account

Employee

Id Number
Lname
Fname
MI
Phone

Id Number
Lname
Fname
MI
Phone
Emergency
Email
Contact Number
Spouse
SSS number

1:N

Salary
Loan

1:N

Paid

Date Start
Ca
Date Ended
Basic Pay
Over Time
ABwhole
Holiday
Working Days
Rate

Figure 4.1

This Account table shows all the users of the system. Those who have a right
access with the entire system, and their informations are shown in this table.

Page | 10

Table 4.1

This Deactivated table displays all the employees who are not fortunate enough
to build their dreams along with campaigns growth. Those who are fired, resigned
employees are shown here.

Table 4.2

The DTR Table displays the attendance information of a specific employee. The
login of an employee as well as for the log out, all are displayed in the table.

Page | 11

Table 4.3

This Employees table shows all the list of employees in the company. All the
employees information are located in this table.

Table 4.4

Page | 12

The Position Table show all the rate of employee with respect to its position and
working day. All the condition and application for specific event are showed in this table.

Table 4.5

The Paid Table shows all the employee who were able to be payed and received their
salary, bonus, incentives on a specific time frame.

Table 4.6

The salary loan table display all the employee who was owes a loan from the
company. The amount of the loan and other deductions are shown in this table.

Page | 13

Table 4.7

THE SYSTEM DESIGN


This system was made to check the salary and records of employee. It will accept
Username and Passwords from the User Accounts and Employee Accounts. The
Employees will be able to record their Time in and Time out through this system. The
User Accounts (Admin,HR,Payroll) can modify and manipulate the data inside the
system.

Figure 4.2

Page | 14

1. ADD/HR/PAYROLL Log in button for Administrator, HR, and Payroll


Officers.
2. EMPLOYEE Log-in button for Employee.

Figure 4.3
1.
2.
3.
4.
5.

Username Textbox for username.


Password textbox for password.
Log-in Log-in button.
Cancel Cancel button.
Date Current time and date.

Figure 4.4
1. User Accounts List of user accounts.
2. Entry form information to be provided for adding new user.
3. Add Add new user.
Page | 15

4.
5.
6.
7.
8.

Edit edit a user.


Save save a user.
Delete delete a user.
Cancel cancel operation.
Exit close

Figure 4.5
1.
2.
3.
4.
5.
6.
7.
8.

Employee Accounts List of Employee accounts.


Entry form information to be provided for adding new user.
Add Add new user.
Edit edit a user.
Save save a user.
Delete delete a user.
Cancel cancel operation.
Exit close

Page | 16

Figure 4.6

1. Employee ID employee ID number.


2. DTR Table list of Daily Time Record of employee.
3. Exit Close

Figure 4.7

Page | 17

1.
2.
3.
4.
5.
6.
7.

Search Bar search by surname of the employees.


Employee Details display the details of employees.
Pay slip Generate pay slip.
Finish reset all the salary records.
Display Gross display the breakdown of gross income details.
Deductions display all the deductions.
Total display all the total net income of the employee.

Figure 4.8
1. Positions Display all the positions.
2. Rate, Taxes, and Bonuses Display the rate, taxes, and bonuses of particular
3.
4.
5.
6.

position.
Save save changes in rates.
Edit edit rates.
Cancel discard changes
Exit Close

Page | 18

Figure 4.9
1. Freeze - lock the system.

Figure 4.11
1. Unfreeze to unfreeze the program.

Page | 19

Figure 4.12
1. Back up to back-up the database.

Figure 4.13
1. Confirm back - up

Page | 20

Figure 4.14

1. Save save the back-up file.

Figure 4.15
1. Restore to restore the back-up file.

Page | 21

Figure 4.16

1. Load restore file

Figure 4.17
1. Confirm restore
Page | 22

Figure 4.18

1. About description about the system.

Figure 4.19
1. Log-out quit using system.

DATA DICTIONARY
Page | 23

In this table you can see the different variables that is used and applied on the
system. This Table will help you understand the variables and shows its description.

Attributes
Idnumber
Password
Retype
Fullname
Type
Position
lname
fname
mi
phone
emergency
email
spouse
cnumber
gender
status
hadd
padd
gross

Description
The unique number assigned to
employee
The security code to access an account
The confirmation of the encoded
password
The name of the User and Employee
The type of account (Admin, HR, Payroll
& Employee)
The position assigned to an employee
The Lastname of the employee
The given name of the employee
The middle name of the employee
The home number of an employee
Contact information incase of
emergency
The email address of the employee
Employee's partner
The mobile number of the employee

net

The gender of the employee


The civil status of the employee
The current address of the employee
The provincial address of the employee
The total salary without taxes and
deductions
The salary with taxes and deductions

month13

The 13th month bonus for the employees

bonus

The additional salary for employee

sss

The Social Security System deduction

lossdamages

The loss damages deductions

Type
Numb
er
Text
Text
Text
Text
Text
Text
Text
Text
Numb
er
Text
Text
Text
Numb
er
Text
Text
Text
Text
Numb
er
Numb
er
Numb
er
Numb
er
Numb
er
Numb
Page | 24

cashadvance

The cash advance by an employee

datestart
dateended
basicpay

The date an employee is hired


The seperation of the employee to the
company
The basic salary of an employee

overtime

The salary during overtime period

holiday

The salary during holiday

rate

The rate salary of an employee

overtimerate

The rate salary during overtime

overtimetot

The total salary earned for overtime

statuslog
Datelog
Timein
Timeout
TotalHours

The status if it is Login or Logout


The date an employee logged
The time-in of the employee
The timeout of the employee
The total hours rendered by the
employee

er
Numb
er
Date
Date
Numb
er
Numb
er
Numb
er
Numb
er
Numb
er
Numb
er
Text
Date
Date
Date
Numb
er

FLOWCHART
This Chart shows the step by step procedure of the system.

Page | 25

S
t
Inpu
a
t
Check
User
r
Usern
nam
ame
e
t
and
and

D
is
p
l
a
y
I
Passw
Pass
n
F
ord
on
word
v
a
Emplo
a
l
yees
li
Display
s
table T
d
P
Main
e
on r
aI
Menuu
Ma
Datab
V
n
y
ste T ase
ei
F
F
p
r
r r a
a
e
Empl
u
o
Fil u l
User
w T l Creat
oyee
T
llt T
e e s
Empl
Acco
s e Pay
Empl
r
Detai
r
r
oyee
unt
e slip
e oyee
u
l
u
u
Acco
DTR e
eExit
e
unt

A
B

C
D

F
a
l
s
e

E
v
Positi
e
on ,
n
rates
t
,Tax T
s
And r
Bonuu
s e

F
a
l
s
e

S
y
s
t
e T
Lock
m r
Backu
Up
Restoe
re

F
a
l
s
e

DISP
LAY
ABO
A
UT
b T
o r
u u
t e

E
xL
io
tg

H
I
J

Page | 26

o
u
t

A
B
C

If
Us
er
Ac
If
co
E
un
m
t
pl
is
oy
If
cli
eA
E
ck
cc
m
ed
ou
pl
nt
oy
is
ee
If
cli
de
E
ck
tai
m
ed
If
l
pl
po
is
oy
siti
cli
ee
on
ck
D
rat
ed
TR
e
is
ta
cli
x
ck
bo
ed
nu
s
is
cli
ck
ed
If
Lo
ck
is
If
cli
Us
ck
er
ed
Ba
ck
up
If
is
Re
cli
st
ck
or
ed
e
is
cli
ck
ed

E
E

I
J

Ea

E
E

l
s
F
e
a
l
s
F
e
a

T
r
u
e
T
r
u
e
T

r
u
e
l T
s r
F
e u
a e
T
l
s r
eF u
a e
l
s
e

F
a
l
s
e
F
a
l
s
F
e
a
l
s
e

T
r
u
e
T
r
u
e
T
r
u
e

Add,Edit
And
Delete

Save to
Data
Base

Add, Edit
And
Delete
Add, Edit
And
Activate
Accounts
Display of
sort Daily
Time
Record
Edit of
Rate,Tax,R
ate And
bonus

Save to
Data
Base
Save to
Data
Base

E
E
E

Save to
Data
Base

Save to
Data
Base

Lock
System

Save to
Data
Base

Find File
Path

Save to
Data
Base

Find File
Path

Save to
Data
Base

Page | 27

APPENDIX

SOURCE CODES

User Level

Codes
Private Sub cmdAdmin_Click()
frmLogin.Show
Unload Me
End Sub
Private Sub cmdExit_Click()
Unload Me
End Sub
Private Sub cmdEmployee_Click()
DTR.Show
Unload Me
End Sub
Private Sub Label3_Click()
End Sub

Page | 28

Employees DTR

Codes
Private Sub cmdCancel_Click()
Unload Me
frmChoices.Show vbModal
End Sub
Private Sub cmdLogout_Click()
If Not adoEmpz.Recordset.EOF Then
adoEmpz.Recordset.MoveFirst
Do While Not adoEmpz.Recordset.EOF
If adoEmpz.Recordset!idnumber = Trim(idnumber.Text) Then
If adoEmpz.Recordset!password = Trim(password.Text) Then
If adoEmpz.Recordset.Fields("condition") = "False" Then
If adoEmpz.Recordset.Fields("time") >= Format(Time, "hh") Then
MsgBox "You cant logout yet. Please wait after half of the day " &
adoEmpz.Recordset.Fields("list") & "!!!", vbInformation
Exit Sub
End If
MsgBox "Greetings " & adoEmpz.Recordset.Fields("Idnumber") & "!!! You logout at exactly "
& Time, vbInformation
adoEmpz.Recordset.Fields("condition") = "True"
adoEmpz.Recordset.Fields("statuslog") = "Logout"
adoEmpz.Recordset.Fields("logoutday") = Format(date, "d")
If adoEmpz.Recordset.Fields("loginday") > adoEmpz.Recordset.Fields("logoutday") Then
adoEmpz.Recordset.Fields("daytot") = adoEmpz.Recordset.Fields("loginday") adoEmpz.Recordset.Fields("logoutday")
tot = adoEmpz.Recordset.Fields("daytot")
If Format(date, "mmmm") = "January" Then
For tot = tot To 31

Page | 29

'MsgBox "January"
adoEmpz.Recordset.Fields("workingdays") = adoEmpz.Recordset.Fields("workingdays")
adoEmpz.Recordset.Update
Next tot
End If
If Format(date, "mmmm") = "February" Then
For tot = tot To febz
'MsgBox "February"
adoEmpz.Recordset.Fields("workingdays") = adoEmpz.Recordset.Fields("workingdays")
+1
adoEmpz.Recordset.Update
Next tot
End If
If Format(date, "mmmm") = "March" Then
For tot = tot To 28
'MsgBox "March"
adoEmpz.Recordset.Fields("workingdays") = adoEmpz.Recordset.Fields("workingdays")
+1
adoEmpz.Recordset.Update
Next tot
End If
If Format(date, "mmmm") = "April" Then
For tot = tot To 31
'MsgBox "April"
adoEmpz.Recordset.Fields("workingdays") = adoEmpz.Recordset.Fields("workingdays")
+1
adoEmpz.Recordset.Update
Next tot
End If
If Format(date, "mmmm") = "May" Then
For tot = tot To 30
'MsgBox "May"
adoEmpz.Recordset.Fields("workingdays") = adoEmpz.Recordset.Fields("workingdays")
+1
adoEmpz.Recordset.Update
Next tot
End If
If Format(date, "mmmm") = "June" Then
For tot = tot To 31
'MsgBox "June"
adoEmpz.Recordset.Fields("workingdays") = adoEmpz.Recordset.Fields("workingdays")
+1
adoEmpz.Recordset.Update
Next tot
End If

Page | 30

If Format(date, "mmmm") = "July" Then


For tot = tot To 30
'MsgBox "July"
adoEmpz.Recordset.Fields("workingdays") = adoEmpz.Recordset.Fields("workingdays")
+1
adoEmpz.Recordset.Update
Next tot
End If
If Format(date, "mmmm") = "August" Then
For tot = tot To 31
'MsgBox "August"
adoEmpz.Recordset.Fields("workingdays") = adoEmpz.Recordset.Fields("workingdays")
+1
adoEmpz.Recordset.Update
Next tot
End If
If Format(date, "mmmm") = "September" Then
For tot = tot To 31
'MsgBox "September"
adoEmpz.Recordset.Fields("workingdays") = adoEmpz.Recordset.Fields("workingdays")
+1
adoEmpz.Recordset.Update
Next tot
End If
If Format(date, "mmmm") = "October" Then
For tot = tot To 30
'MsgBox "October"
adoEmpz.Recordset.Fields("workingdays") = adoEmpz.Recordset.Fields("workingdays")
+1
adoEmpz.Recordset.Update
Next tot
End If
If Format(date, "mmmm") = "November" Then
For tot = tot To 31
'MsgBox "November"
adoEmpz.Recordset.Fields("workingdays") = adoEmpz.Recordset.Fields("workingdays")
adoEmpz.Recordset.Update
Next tot
End If
If Format(date, "mmmm") = "December" Then
For tot = tot To 30
'MsgBox "December"
adoEmpz.Recordset.Fields("workingdays") = adoEmpz.Recordset.Fields("workingdays")

Page | 31

adoEmpz.Recordset.Update
Next tot
End If

Else
adoEmpz.Recordset.Fields("workingdays") = adoEmpz.Recordset.Fields("workingdays")
+1
Do While Not adoEmpz.Recordset.Fields("loginday") =
adoEmpz.Recordset.Fields("logoutday")
adoEmpz.Recordset.Fields("loginday") = adoEmpz.Recordset.Fields("loginday") + 1
adoEmpz.Recordset.Fields("workingdays") = adoEmpz.Recordset.Fields("workingdays")
+1
adoEmpz.Recordset.Update
Loop
End If

Exit Sub
End If
MsgBox "You cant logout yet if you did not login " & adoEmpz.Recordset.Fields("Idnumber") &
"!!!", vbInformation
password.Text = ""
idnumber.Text = ""
idnumber.SetFocus
Exit Sub
End If
MsgBox "Wrong Input!", vbInformation
password.Text = ""
idnumber.Text = ""
idnumber.SetFocus
Exit Sub
End If

adoEmpz.Recordset.MoveNext
Loop
MsgBox "Wrong Input!", vbInformation
password.Text = ""
idnumber.Text = ""
idnumber.SetFocus
Exit Sub
End If
End Sub

Page | 32

Private Sub cmdOK_Click()


If Not adoEmpz.Recordset.EOF Then
adoEmpz.Recordset.MoveFirst
Do While Not adoEmpz.Recordset.EOF
If adoEmpz.Recordset!idnumber = Trim(idnumber.Text) Then
If adoEmpz.Recordset!password = Trim(password.Text) Then
If adoEmpz.Recordset.Fields("loginday") = Format(date, "d") Then
MsgBox "You can't Login twice in a day " & adoEmpz.Recordset.Fields("Idnumber") & "!",
vbInformation
Exit Sub
End If
If adoEmpz.Recordset.Fields("condition") = "True" Then
MsgBox "Greetings " & adoEmpz.Recordset.Fields("Idnumber") & "!!! You login at exactly "
& Time, vbInformation
adoEmpz.Recordset.Fields("condition") = "False"
adoEmpz.Recordset.Fields("loginday") = Format(date, "d")
adoEmpz.Recordset.Fields("statuslog") = "Login"
adoEmpz.Recordset.Fields("time") = Format(Time, "hh") + 4
adoEmpz.Recordset.Update
adoEmpz.Recordset.Update
Else
MsgBox "You can't Login yet, please Logout first " & adoEmpz.Recordset.Fields("Idnumber")
& "!", vbInformation
End If
password.Text = ""
idnumber.Text = ""
idnumber.SetFocus
Exit Sub
End If
End If
adoEmpz.Recordset.MoveNext
Loop
MsgBox "Wrong Input!", vbInformation
password.Text = ""
idnumber.Text = ""
idnumber.SetFocus
Exit Sub
End If
End Sub
Private Sub Form_Load()
febz = 28
If Format(date, "yyyy") = 2012 Then
febz = 29
End If

Page | 33

If Format(date, "yyyy") = 2016 Then


febz = 29
End If
If Format(date, "yyyy") = 2020 Then
febz = 29
End If
If Format(date, "yyyy") = 2024 Then
febz = 29
End If
If Format(date, "yyyy") = 2028 Then
febz = 29
End If
If Format(date, "yyyy") = 2028 Then
febz = 29
End If
If Format(date, "yyyy") = 2032 Then
febz = 29
End If

End Sub

Log-in

Codes
Private Sub cmdBack_Click()
frmChoices.Show
Unload Me
End Sub

Page | 34

Private Sub cmdLogin_Click()


Adodc1.RecordSource = "select * from Account where Idnumber = '" + idnumber.Text + "' and Password =
'" + password.Text + "'"
Adodc1.Refresh
If Adodc1.Recordset.EOF Then
MsgBox "Wrong ID Number or Password!"
Else
If Adodc1.Recordset.Fields("Type") = "Admin" Then
Unload Me
User = 1
MDIForm1.Show

ElseIf Adodc1.Recordset.Fields("Type") = "HR" Then


Unload Me
User = 2
MDIForm1.Show
ElseIf Adodc1.Recordset.Fields("Type") = "Payroll" Then
Unload Me
User = 3
MDIForm1.Show
ElseIf Adodc1.Recordset.Fields("Type") = "Employee" Then
Unload Me
MsgBox "Strictly for Administrator only."
Unload Me
DTR.Show
End If
End If
End Sub
Private Sub Form_Load()
date.Caption = Format(Now, "mmm dd, yyyy hh:nn AM/PM")
date.Enabled = False
End Sub
Private Sub idnumber_KeyPress(KeyAscii As Integer)
If (KeyAscii < 48 Or KeyAscii > 57) And KeyAscii <> 8 Then KeyAscii = 0
End Sub

Page | 35

User Accounts

Codes
Dim newrec As Boolean
Private Sub level_click()
Timer1.Enabled = False
End Sub
Private Sub add_Click()
Timer1.Enabled = False
fullname.Enabled = True
idnumber.Enabled = True
password.Enabled = True
password2.Enabled = True
level.Enabled = True
position.Enabled = True
newrec = True
DataGrid1.Enabled = False
add.Enabled = False
edit.Enabled = False
delete.Enabled = False
cancel.Enabled = True

Page | 36

save.Enabled = True
adoUserAccount.Recordset.AddNew
fullname.SetFocus
End Sub
Private Sub cancel_Click()
adoUserAccount.Recordset.CancelBatch
adoUserAccount.Refresh
save.Enabled = False
add.Enabled = True
edit.Enabled = True
delete.Enabled = True
newrec = False
cancel.Enabled = False
DataGrid1.Enabled = True
save.Caption = "&Save"
fullname.Enabled = False
idnumber.Enabled = False
password.Enabled = False
password2.Enabled = False
level.Enabled = False
position.Enabled = False
Timer1.Enabled = True
End Sub
Private Sub cmdExit_Click()
adoUserAccount.Recordset.cancel
adoUserAccount.Recordset.CancelBatch adAffectAllChapters
Unload Me
End Sub
Private Sub DataGrid1_Click()
Timer1.Enabled = False
End Sub
Private Sub DataGrid1_Scroll(cancel As Integer)
Timer1.Enabled = False
End Sub
Private Sub delete_Click()
Timer1.Enabled = False
If idnumber.Text = "123" Then
MsgBox "Sorry you can't Delete it..", vbInformation
Exit Sub
Else
If fullname.Text = "" Then
MsgBox "Select a record first to delete..", vbCritical
Else

Page | 37

If MsgBox("are you sure you want to delete " & adoUserAccount.Recordset.Fields("fullname") & "
record?", vbYesNo) = vbYes Then
On Error GoTo ex
adoUserAccount.Recordset.delete adAffectCurrent
Timer1.Enabled = True
End If
ex:
fullname.Enabled = False
idnumber.Enabled = False
password.Enabled = False
password2.Enabled = False
level.Enabled = False
position.Enabled = False
End If
End If
Timer1.Enabled = True
End Sub
Private Sub edit_Click()
Timer1.Enabled = False
If idnumber.Text = "123" Then
MsgBox "Sorry you can't edit this admin..", vbInformation
Exit Sub
Else
fullname.Enabled = True
idnumber.Enabled = True
password.Enabled = True
password2.Enabled = True
level.Enabled = True
position.Enabled = True
newrec = False
save.Enabled = True
cancel.Enabled = True
add.Enabled = False
edit.Enabled = False
delete.Enabled = False
save.Caption = "&Update"

fullname.SetFocus
End If
End Sub

Private Sub Form_Deactivate()


Unload Me
End Sub

Page | 38

Private Sub fullname_Click()


Timer1.Enabled = False
End Sub

Private Sub password_Click()


Timer1.Enabled = False
End Sub
Private Sub password2_Click()
Timer1.Enabled = False
End Sub
Private Sub position_Click()
Timer1.Enabled = False
End Sub
Private Sub save_Click()
If fullname & lname = "" Then
MsgBox "Imposible! Please complete the details!", vbCritical
GoTo ext
ElseIf idnumber.Text = "" Then
MsgBox "Imposible! Please input a ID Number too!", vbCritical
GoTo ext
ElseIf password.Text = "" Then
MsgBox "Imposible! Please input a Password too!", vbCritical
GoTo ext
ElseIf level.Text = "" Then
MsgBox "Please dont forget to assign a Level!", vbCritical
GoTo ext
ElseIf Not password.Text = password2.Text Then
MsgBox "Password Mismatched!", vbCritical
GoTo ext
ElseIf MsgBox("Are you sure you want to save " & fullname.Text & " record?", vbYesNo) = vbYes Then
adoUserAccount.Recordset.Update
save.Enabled = False
cancel.Enabled = False
add.Enabled = True
edit.Enabled = True
delete.Enabled = True
MsgBox "Succesfully Save!", vbInformation
newrec = True
DataGrid1.Enabled = True
save.Caption = "Save"
Timer1.Enabled = True
'AccEnabledF
DataGrid1.Enabled = True
fullname.Enabled = False

Page | 39

idnumber.Enabled = False
password.Enabled = False
password2.Enabled = False
level.Enabled = False
position.Enabled = False
Else
adoUserAccount.Recordset.CancelBatch
add.Enabled = True
edit.Enabled = True
delete.Enabled = True
save.Caption = "Save"
cancel.Enabled = False
save.Enabled = False
adoUserAccount.Refresh
DataGrid1.Enabled = True
End If
ext:
fullname.Enabled = False
idnumber.Enabled = False
password.Enabled = False
password2.Enabled = False
level.Enabled = False
position.Enabled = False
add.Enabled = True
edit.Enabled = True
delete.Enabled = True
save.Caption = "Save"
cancel.Enabled = False
save.Enabled = False
adoUserAccount.Refresh
Timer1.Enabled = True
End Sub
Private Sub Form_Load()
Me.Top = 1
Me.Left = 1
save.Enabled = False
cancel.Enabled = False
fullname.Enabled = False
idnumber.Enabled = False
password.Enabled = False
password2.Enabled = False
level.Enabled = False
position.Enabled = False

level.AddItem ("Admin")

Page | 40

level.AddItem ("HR")
level.AddItem ("Payroll")
End Sub
Private Sub Timer1_Timer()
DataGrid1.Refresh
adoUserAccount.Refresh
End Sub
Private Sub idnumber_Click()
Timer1.Enabled = False
End Sub
Private Sub idnumber_KeyPress(KeyAscii As Integer)
If (KeyAscii < 48 Or KeyAscii > 57) And KeyAscii <> 8 Then KeyAscii = 0
End Sub

Employees Accounts

Codes
Dim newrec As Boolean
Private Sub level_click()
Timer1.Enabled = False
End Sub
Private Sub idnumber_Click()
Timer1.Enabled = False
End Sub
Private Sub idnumber_KeyPress(KeyAscii As Integer)
If (KeyAscii < 48 Or KeyAscii > 57) And KeyAscii <> 8 Then KeyAscii = 0
End Sub

Page | 41

Private Sub add_Click()


Timer1.Enabled = False
fname.Enabled = True
mi.Enabled = True
lname.Enabled = True
idnumber.Enabled = True
password.Enabled = True
password2.Enabled = True
newrec = True
DataGrid2.Enabled = False
add.Enabled = False
edit.Enabled = False
delete.Enabled = False
cancel.Enabled = True
save.Enabled = True
adoEmployeeAccount.Recordset.AddNew
lname.SetFocus
End Sub
Private Sub cancel_Click()
adoEmployeeAccount.Recordset.CancelBatch
adoEmployeeAccount.Refresh
save.Enabled = False
add.Enabled = True
edit.Enabled = True
delete.Enabled = True
newrec = False
cancel.Enabled = False
DataGrid2.Enabled = True
save.Caption = "&Save"
fname.Enabled = False
mi.Enabled = False
lname.Enabled = False
idnumber.Enabled = False
password.Enabled = False
password2.Enabled = False
Timer1.Enabled = True
End Sub
Private Sub cmdExit_Click()
adoEmployeeAccount.Recordset.cancel
adoEmployeeAccount.Recordset.CancelBatch adAffectAllChapters
Unload Me
End Sub

Page | 42

Private Sub DataGrid2_ButtonClick(ByVal ColIndex As Integer)


Timer1.Enabled = False
Timer2.Enabled = False
End Sub
Private Sub DataGrid2_Click()
Timer1.Enabled = False
Timer2.Enabled = False
End Sub
Private Sub DataGrid2_HeadClick(ByVal ColIndex As Integer)
Timer1.Enabled = False
Timer2.Enabled = False
End Sub
Private Sub DataGrid2_Scroll(cancel As Integer)
Timer1.Enabled = False
End Sub
Private Sub delete_Click()
Timer1.Enabled = False
If idnumber.Text = "123" Then
MsgBox "Sorry you can't Delete it..", vbInformation
Exit Sub
Else
If lname.Text = "" Then
MsgBox "Select a record first to delete..", vbCritical
Else
If MsgBox("Are you sure you want to delete " & adoEmployeeAccount.Recordset.Fields("fname") & "
record?", vbYesNo) = vbYes Then
On Error GoTo ex
adoEmployeeAccount.Recordset.delete adAffectCurrent
Timer1.Enabled = True
End If
ex:
fname.Enabled = False
mi.Enabled = False
lname.Enabled = False
idnumber.Enabled = False
password.Enabled = False
password2.Enabled = False
End If
End If
Timer1.Enabled = True
End Sub
Private Sub edit_Click()
Timer1.Enabled = False
If idnumber.Text = "123" Then
MsgBox "Sorry you can't edit this admin..", vbInformation

Page | 43

Exit Sub
Else
fname.Enabled = True
mi.Enabled = True
lname.Enabled = True
idnumber.Enabled = True
password.Enabled = True
password2.Enabled = True
newrec = False
save.Enabled = True
cancel.Enabled = True
add.Enabled = False
edit.Enabled = False
delete.Enabled = False
save.Caption = "&Update"

lname.SetFocus
End If
End Sub

Private Sub Form_Deactivate()


Unload Me
End Sub
Private Sub Label9_Click()
End Sub
Private Sub lname_Click()
Timer1.Enabled = False
End Sub

Private Sub password_Click()


Timer1.Enabled = False
End Sub
Private Sub password2_Click()
Timer1.Enabled = False
End Sub
Private Sub position_Click()
Timer1.Enabled = False
End Sub
Private Sub save_Click()

Page | 44

If fname = "" Then


MsgBox "Imposible! Please input a First Name!", vbCritical
GoTo ext
ElseIf lname = "" Then
MsgBox "Imposible! Please input a Surname!", vbCritical
GoTo ext
ElseIf password.Text = "" Then
MsgBox "Imposible! Please input a Password too!", vbCritical
GoTo ext
ElseIf Not password.Text = password2.Text Then
MsgBox "Password Mismatched!", vbCritical
GoTo ext
ElseIf MsgBox("Are you sure you want to save " & lname.Text & " record?", vbYesNo) = vbYes Then
adoEmployeeAccount.Recordset.Update
save.Enabled = False
cancel.Enabled = False
add.Enabled = True
edit.Enabled = True
delete.Enabled = True
MsgBox "Succesfully Save!", vbInformation
newrec = True
DataGrid2.Enabled = True
save.Caption = "Save"
Timer1.Enabled = True
'AccEnabledF
DataGrid2.Enabled = True
lname.Enabled = False
mi.Enabled = False
fname.Enabled = False
idnumber.Enabled = False
password.Enabled = False
password2.Enabled = False
Else
adoEmployeeAccount.Recordset.CancelBatch
add.Enabled = True
edit.Enabled = True
delete.Enabled = True
save.Caption = "Save"
cancel.Enabled = False
save.Enabled = False
adoEmployeeAccount.Refresh
DataGrid2.Enabled = True
End If
ext:
lname.Enabled = False
mi.Enabled = False
fname.Enabled = False
idnumber.Enabled = False
password.Enabled = False

Page | 45

password2.Enabled = False
add.Enabled = True
edit.Enabled = True
delete.Enabled = True
save.Caption = "Save"
cancel.Enabled = False
save.Enabled = False
adoEmployeeAccount.Refresh
Timer1.Enabled = True
End Sub
Private Sub Form_Load()
Me.Top = 1
Me.Left = 1
save.Enabled = False
cancel.Enabled = False
lname.Enabled = False
mi.Enabled = False
fname.Enabled = False
idnumber.Enabled = False
password.Enabled = False
password2.Enabled = False
End Sub
Private Sub Timer1_Timer()
If Not searchtxt.Text = "" Then
adoEmployeeAccount.Recordset.Filter = "lname like '%" & searchtxt.Text & "%'"
Else
DataGrid2.Refresh
adoEmployeeAccount.Refresh
End If
End Sub
Private Sub Timer2_Timer()
DataGrid2.Refresh
adoEmployeeAccount.Refresh
End Sub
Private Sub searchtxt_click()
searchtxt.Text = ""
Timer1.Enabled = True
Timer2.Enabled = False
End Sub
Private Sub searchtxt_GotFocus()

Page | 46

Timer2.Enabled = False
Timer1.Enabled = True
End Sub
Private Sub searchtxt_LostFocus()
Timer1.Enabled = False
Timer2.Enabled = True
End Sub

Employees Detail

Codes
Dim ok As Boolean
Dim notok As Boolean
Dim Active As Boolean
Dim newrec As Boolean
Private Sub cmdActivate_Click()
If MsgBox("Note: You can 'Edit', before you 'Save' to add
AdoDeactivated.Recordset.Fields("list") & " data.", vbOKCancel) = vbOK Then

back

again

"

&

Timer3.Enabled = False
Timer2.Enabled = False
Timer1.Enabled = False
adoEmpz.Recordset.AddNew
cmdAdd.Enabled = False
cmdSave.Enabled = True
cmdEdit.Enabled = False
cmdCancel.Enabled = False
DataEmployee.Enabled = False
searchtxt.Enabled = False

Page | 47

cmdSearch.Enabled = False
cmdActivate.Enabled = False
LockFalse
ok = False
Active = True
Manager.Value = True
DataDeactivated.Enabled = False
fname.Text = AdoDeactivated.Recordset.Fields("fname")
lname.Text = AdoDeactivated.Recordset.Fields("lname")
mi.Text = AdoDeactivated.Recordset.Fields("mi")
phone.Text = AdoDeactivated.Recordset.Fields("phone")
emergency.Text = AdoDeactivated.Recordset.Fields("emergency")
emailadd.Text = AdoDeactivated.Recordset.Fields("email")
spouse.Text = AdoDeactivated.Recordset.Fields("spouse")
scontact.Text = AdoDeactivated.Recordset.Fields("cnumber")
'AdoDeactivated.Recordset.Fields("bday") = bday.Text
haddress.Text = AdoDeactivated.Recordset.Fields("hadd")
paddress.Text = AdoDeactivated.Recordset.Fields("padd")
gender.Text = AdoDeactivated.Recordset.Fields("gender")
status.Text = AdoDeactivated.Recordset.Fields("status")
Else
ok = True
Timer3.Enabled = True
Timer2.Enabled = True
Active = False
End If
End Sub
Private Sub cmdAdd_Click()
Timer3.Enabled = False
Timer2.Enabled = False
Timer1.Enabled = False
adoEmpz.Refresh
AdoDeactivated.Refresh
DataEmployee.Refresh
adoEmpz.Recordset.AddNew
cmdEdit.Enabled = False
Active = False
DataEmployee.Enabled = False
LockFalse
Manager.Value = True
cmdAdd.Enabled = False
cmdCancel.Enabled = True
cmdActivate.Enabled = False
cmdSave.Enabled = True

Page | 48

cmdEdit.Enabled = False
txtEmpty
u=1
For u = u To 10
spouse.Text = "n/a"
scontact.Text = "n/a"
paddress.Text = "n/a"
phone.Text = "n/a"
emergency.Text = "n/a"
emailadd.Text = "n/a"
gender.Text = ""
status.Text = ""
u=1+u
Next u
Manager.Value = True
ok = False
notok = True
lname.SetFocus
End Sub
Private Sub cmdCancel_Click()
Active = False
LockTrue
txtEmpty
Timer3.Enabled = True
Timer2.Enabled = True
Timer3.Enabled = True
adoEmpz.Recordset.CancelBatch
adoEmpz.Refresh
AdoDeactivated.Refresh
DataEmployee.Refresh
cmdCancel.Enabled = False
cmdEdit.Enabled = True
cmdSave.Enabled = False
cmdAdd.Enabled = True
cmdSave.Caption = "&Save"
DataEmployee.Enabled = True
If adoEmpz.Recordset.EOF Then
cmdEdit.Enabled = False
Else
cmdEdit.Enabled = True
End If
End Sub

Page | 49

Private Sub cmdEdit_Click()


If MsgBox("Proceed edit to " & adoEmpz.Recordset.Fields("fname") & " " &
adoEmpz.Recordset.Fields("mi") & ". " & adoEmpz.Recordset.Fields("lname") & " data?", vbOKCancel) =
vbOK Then
Timer3.Enabled = False
Timer2.Enabled = False
DataDeactivated.Enabled = False
cmdActivate.Enabled = False
cmdEdit.Enabled = False
DataEmployee.Enabled = False
ok = True
cmdAdd.Enabled = False
cmdSave.Enabled = True
cmdEdit.Enabled = False
cmdCancel.Enabled = False
cmdSave.Caption = "&Update"
'DataEmployee.Enabled = False
searchtxt.Enabled = False
cmdSearch.Enabled = False
LockFalse
If adoEmpz.Recordset.Fields("position") = "Driver" Then
Driver.Value = True
End If
If adoEmpz.Recordset.Fields("position") = "Messenger" Then
Messenger.Value = True
End If
If adoEmpz.Recordset.Fields("position") = "Helper" Then
Helper.Value = True
End If
If adoEmpz.Recordset.Fields("position") = "Assistant Manager" Then
AsstManager.Value = True
End If
If adoEmpz.Recordset.Fields("position") = "Manager" Then
Manager.Value = True
End If
If adoEmpz.Recordset.Fields("position") = "Plant Supervisor" Then
PSupervisor.Value = True
End If
If adoEmpz.Recordset.Fields("position") = "Secretary" Then
Secretary.Value = True
End If
If adoEmpz.Recordset.Fields("position") = "Operation Manager" Then
OpManager.Value = True
End If
If adoEmpz.Recordset.Fields("position") = "Salesman" Then

Page | 50

Salesman.Value = True
End If
lname.SetFocus
Else
ok = False
End If

End Sub
Private Sub cmdSave_Click()
If fname.Text = "" Then
MsgBox "Please enter Firstname", vbCritical
Exit Sub
ElseIf lname.Text = "" Then
MsgBox "Please enter Lastname", vbCritical
Exit Sub
ElseIf mi.Text = "" Then
MsgBox "Please enter MI", vbCritical
Exit Sub
ElseIf phone.Text = "" Then
MsgBox "Please enter Phone", vbCritical
Exit Sub
ElseIf emergency.Text = "" Then
MsgBox "Please enter Emergency", vbCritical
Exit Sub
ElseIf emailadd.Text = "" Then
MsgBox "Please enter Email", vbCritical
Exit Sub
ElseIf spouse.Text = "" Then
MsgBox "Please enter Spouse name", vbCritical
Exit Sub
ElseIf scontact.Text = "" Then
MsgBox "Please enter Spouse Contact Number", vbCritical
Exit Sub
ElseIf haddress.Text = "" Then
MsgBox "Please enter Home Address", vbCritical
Exit Sub
ElseIf paddress.Text = "" Then
MsgBox "Please enter Present Address", vbCritical
Exit Sub
ElseIf gender.Text = "" Then
MsgBox "Please Select Gender", vbCritical
Exit Sub
ElseIf status.Text = "" Then
MsgBox "Please Select Status", vbCritical
Exit Sub
Else
If MsgBox("Are you sure!?!", vbYesNo) = vbYes Then

Page | 51

If Active = True Then


AdoDeactivated.Recordset.delete adAffectCurrent
End If
'empz
adoEmpz.Recordset.Fields("fname") = fname.Text
adoEmpz.Recordset.Fields("lname") = lname.Text
adoEmpz.Recordset.Fields("mi") = mi.Text
adoEmpz.Recordset.Fields("phone") = phone.Text
adoEmpz.Recordset.Fields("emergency") = emergency.Text
adoEmpz.Recordset.Fields("email") = emailadd.Text
adoEmpz.Recordset.Fields("spouse") = spouse.Text
adoEmpz.Recordset.Fields("cnumber") = scontact.Text
'.adoEmpz.Recordset.Fields("bday") = bday.Text
adoEmpz.Recordset.Fields("hadd") = haddress.Text
adoEmpz.Recordset.Fields("padd") = paddress.Text
adoEmpz.Recordset.Fields("gender") = gender.Text
adoEmpz.Recordset.Fields("status") = status.Text
adoEmpz.Recordset.Fields("totalgross") = 0
adoEmpz.Recordset.Fields("net") = 0
adoEmpz.Recordset.Fields("bonus") = 0
adoEmpz.Recordset.Fields("sss") = 0
adoEmpz.Recordset.Fields("lossdamages") = 0
adoEmpz.Recordset.Fields("cashadvance") = 0
adoEmpz.Recordset.Fields("basicpay") = 0
adoEmpz.Recordset.Fields("overtimetot") = 0
adoEmpz.Recordset.Fields("abwhole") = 0
adoEmpz.Recordset.Fields("abhalf") = 0
adoEmpz.Recordset.Fields("statuslog") = "Logout"
adoEmpz.Recordset.Fields("holiday") = 0
If Active = True Then
MsgBox "Employee is now Active again!", vbInformation
End If
Active = False
If ok = False Then
adoEmpz.Recordset.Fields("totalded") = 0
adoEmpz.Recordset.Fields("Rate") = 0
adoEmpz.Recordset.Fields("workingdays") = 0
adoEmpz.Recordset.Fields("loanded") = 0
adoEmpz.Recordset.Fields("loanremain") = 0
adoEmpz.Recordset.Fields("salaryloan") = 0
adoEmpz.Recordset.Fields("password") = 1234
adoEmpz.Recordset.Fields("retype") = 1234
adoEmpz.Recordset.Fields("condition") = "True"
ok = True
End If

Page | 52

If Driver.Value = True Then


adoEvents.Recordset.MoveFirst
Do While Not adoPost.Recordset.EOF
If adoEvents.Recordset.Fields("position") = "Driver" Then
adoEmpz.Recordset.Fields("position") = "Driver"
adoEmpz.Recordset.Fields("rate") = adoEvents.Recordset.Fields("rate")
adoEmpz.Recordset.Fields("sss") = adoEvents.Recordset.Fields("sss")
adoEmpz.Recordset.Fields("bonus") = adoEvents.Recordset.Fields("bonus")
adoEmpz.Recordset.Fields("month13") = adoEvents.Recordset.Fields("month13")
End If
adoEvents.Recordset.MoveNext
Loop
End If
If Messenger.Value = True Then
adoEvents.Recordset.MoveFirst
Do While Not adoEvents.Recordset.EOF
If adoEvents.Recordset.Fields("position") = "Messenger" Then
adoEmpz.Recordset.Fields("position") = "Messenger"
adoEmpz.Recordset.Fields("rate") = adoEvents.Recordset.Fields("rate")
adoEmpz.Recordset.Fields("sss") = adoEvents.Recordset.Fields("sss")
adoEmpz.Recordset.Fields("bonus") = adoEvents.Recordset.Fields("bonus")
adoEmpz.Recordset.Fields("month13") = adoEvents.Recordset.Fields("month13")
End If
adoEvents.Recordset.MoveNext
Loop
End If
If Salesman.Value = True Then
adoEvents.Recordset.MoveFirst
Do While Not adoEvents.Recordset.EOF
If adoEvents.Recordset.Fields("position") = "Salesman" Then
adoEmpz.Recordset.Fields("position") = "Salesman"
adoEmpz.Recordset.Fields("rate") = adoEvents.Recordset.Fields("rate")
adoEmpz.Recordset.Fields("sss") = adoEvents.Recordset.Fields("sss")
adoEmpz.Recordset.Fields("bonus") = adoEvents.Recordset.Fields("bonus")
adoEmpz.Recordset.Fields("month13") = adoEvents.Recordset.Fields("month13")
End If
adoEvents.Recordset.MoveNext
Loop
End If
If Helper.Value = True Then
adoEvents.Recordset.MoveFirst
Do While Not adoEvents.Recordset.EOF
If adoEvents.Recordset.Fields("position") = "Helper" Then
adoEmpz.Recordset.Fields("position") = "Helper"
adoEmpz.Recordset.Fields("rate") = adoEvents.Recordset.Fields("rate")

Page | 53

adoEmpz.Recordset.Fields("sss") = adoEvents.Recordset.Fields("sss")
adoEmpz.Recordset.Fields("bonus") = adoEvents.Recordset.Fields("bonus")
adoEmpz.Recordset.Fields("month13") = adoEvents.Recordset.Fields("month13")
End If
adoEvents.Recordset.MoveNext
Loop
End If
If Manager.Value = True Then
adoEvents.Recordset.MoveFirst
Do While Not adoEvents.Recordset.EOF
If adoEvents.Recordset.Fields("position") = "Manager" Then
adoEmpz.Recordset.Fields("position") = "Manager"
adoEmpz.Recordset.Fields("rate") = adoEvents.Recordset.Fields("rate")
adoEmpz.Recordset.Fields("sss") = adoEvents.Recordset.Fields("sss")
adoEmpz.Recordset.Fields("bonus") = adoEvents.Recordset.Fields("bonus")
adoEmpz.Recordset.Fields("month13") = adoEvents.Recordset.Fields("month13")
End If
adoEvents.Recordset.MoveNext
Loop
End If
If AsstManager.Value = True Then
adoEvents.Recordset.MoveFirst
Do While Not adoEvents.Recordset.EOF
If adoEvents.Recordset.Fields("position") = "Assistant Manager" Then
adoEmpz.Recordset.Fields("position") = "Assistant Manager"
adoEmpz.Recordset.Fields("rate") = adoEvents.Recordset.Fields("rate")
adoEmpz.Recordset.Fields("sss") = adoEvents.Recordset.Fields("sss")
adoEmpz.Recordset.Fields("bonus") = adoEvents.Recordset.Fields("bonus")
adoEmpz.Recordset.Fields("month13") = adoEvents.Recordset.Fields("month13")
End If
adoEvents.Recordset.MoveNext
Loop
End If
If Secretary.Value = True Then
adoEvents.Recordset.MoveFirst
Do While Not adoEvents.Recordset.EOF
If adoEvents.Recordset.Fields("position") = "Secretary" Then
adoEmpz.Recordset.Fields("position") = "Secretary"
adoEmpz.Recordset.Fields("rate") = adoEvents.Recordset.Fields("rate")
adoEmpz.Recordset.Fields("sss") = adoEvents.Recordset.Fields("sss")
adoEmpz.Recordset.Fields("bonus") = adoEvents.Recordset.Fields("bonus")
adoEmpz.Recordset.Fields("month13") = adoEvents.Recordset.Fields("month13")
End If
adoEvents.Recordset.MoveNext
Loop

Page | 54

End If
If OpManager.Value = True Then
adoEvents.Recordset.MoveFirst
Do While Not adoEvents.Recordset.EOF
If adoEvents.Recordset.Fields("position") = "Operation Manager" Then
adoEmpz.Recordset.Fields("position") = "Operation Manager"
adoEmpz.Recordset.Fields("rate") = adoEvents.Recordset.Fields("rate")
adoEmpz.Recordset.Fields("sss") = adoEvents.Recordset.Fields("sss")
adoEmpz.Recordset.Fields("bonus") = adoEvents.Recordset.Fields("bonus")
adoEmpz.Recordset.Fields("month13") = adoEvents.Recordset.Fields("month13")
End If
adoEvents.Recordset.MoveNext
Loop
End If
If PSupervisor.Value = True Then
adoEvents.Recordset.MoveFirst
Do While Not adoEvents.Recordset.EOF
If adoEvents.Recordset.Fields("position") = "Plant Supervisor" Then
adoEmpz.Recordset.Fields("position") = "Plant Supervisor"
adoEmpz.Recordset.Fields("rate") = adoEvents.Recordset.Fields("rate")
adoEmpz.Recordset.Fields("sss") = adoEvents.Recordset.Fields("sss")
adoEmpz.Recordset.Fields("bonus") = adoEvents.Recordset.Fields("bonus")
adoEmpz.Recordset.Fields("month13") = adoEvents.Recordset.Fields("month13")
End If
adoEvents.Recordset.MoveNext
Loop
End If
If warehouseman.Value = True Then
adoEvents.Recordset.MoveFirst
Do While Not adoEvents.Recordset.EOF
If adoEvents.Recordset.Fields("position") = "Warehouseman" Then
adoEmpz.Recordset.Fields("position") = "Warehouseman"
adoEmpz.Recordset.Fields("rate") = adoEvents.Recordset.Fields("rate")
adoEmpz.Recordset.Fields("sss") = adoEvents.Recordset.Fields("sss")
adoEmpz.Recordset.Fields("bonus") = adoEvents.Recordset.Fields("bonus")
adoEmpz.Recordset.Fields("month13") = adoEvents.Recordset.Fields("month13")
End If
adoEvents.Recordset.MoveNext
Loop
End If
If accountant.Value = True Then
adoEvents.Recordset.MoveFirst
Do While Not adoEvents.Recordset.EOF
If adoPost.Recordset.Fields("position") = "Accountant" Then
adoEmpz.Recordset.Fields("position") = "Accountant"

Page | 55

adoEmpz.Recordset.Fields("rate") = adoEvents.Recordset.Fields("rate")
adoEmpz.Recordset.Fields("sss") = adoEvents.Recordset.Fields("sss")
adoEmpz.Recordset.Fields("bonus") = adoEvents.Recordset.Fields("bonus")
adoEmpz.Recordset.Fields("month13") = adoEvents.Recordset.Fields("month13")
End If
adoEvents.Recordset.MoveNext
Loop
End If
'End If '3rd if
adoEmpz.Recordset.Update
adoEmpz.Refresh
AdoDeactivated.Refresh
DataEmployee.Refresh
frmEmployeeDetails.SetFocus
'Unload PostForm
'Unload payroll
Timer1.Enabled = True
DataEmployee.Enabled = True
If notok = True Then
MsgBox "Succesfully Save!", vbInformation
notok = False
Else
MsgBox "Succesfully Updated!", vbInformation
End If
Else
DataEmployee.Enabled = True
txtEmpty
LockTrue
cmdSave.Enabled = False
cmdEdit.Enabled = True
cmdAdd.Enabled = True
cmdCancel.Enabled = False
searchtxt.Enabled = True
cmdSearch.Enabled = True
Timer3.Enabled = True
Timer2.Enabled = True
DataDeactivated.Enabled = True
adoEmpz.Recordset.CancelBatch
adoEmpz.Refresh
adoEmpz.Refresh
Unload payroll
Timer1.Enabled = True
End If ' 2nd if

Page | 56

End If '1st if
cmdAdd.Enabled = True
cmdCancel.Enabled = False
cmdActivate.Enabled = True
cmdSave.Enabled = False
cmdEdit.Enabled = True
searchtxt.Enabled = True
cmdSearch.Enabled = True
cmdSave.Caption = "&Save"
DataEmployee.Enabled = True
DataDeactivated.Enabled = True
cmdActivate.Enabled = True
Timer1.Enabled = True
Timer3.Enabled = True
Timer2.Enabled = True
cmdActivate.BackColor = &H8000000F
LockTrue
End Sub
Private Sub cmdSearch_Click()
Timer2.Enabled = True
End Sub

Private Sub DataEmployee_ButtonClick(ByVal ColIndex As Integer)


Timer1.Enabled = False
Timer2.Enabled = False
End Sub
Private Sub DataEmployee_Click()
Timer1.Enabled = False
Timer2.Enabled = False
End Sub
Private Sub DataEmployee_DblClick()
Timer1.Enabled = False
Timer2.Enabled = False
End Sub
Private Sub DataEmployee_HeadClick(ByVal ColIndex As Integer)
Timer1.Enabled = False
Timer2.Enabled = False
End Sub
Private Sub DataEmployee_Scroll(cancel As Integer)
Timer1.Enabled = False
Timer2.Enabled = False
End Sub

Page | 57

Private Sub DataDeactivated_Click()


Timer1.Enabled = False
Timer2.Enabled = False
End Sub
Private Sub DataDeactivated_GotFocus()
Timer1.Enabled = False
Timer2.Enabled = False
End Sub
Private Sub DataDeactivated_LostFocus()
Timer1.Enabled = False
Timer2.Enabled = False
End Sub
Private Sub Form_Activate()
adoEmpz.Refresh
AdoDeactivated.Refresh
DataEmployee.Refresh
LockTrue
End Sub
Private Sub Form_Deactivate()
adoEmpz.Recordset.CancelBatch
Unload Me
End Sub
Private Sub Form_Load()
Me.Top = 1
Me.Left = 1
ok = False
gender.AddItem ("Male")
gender.AddItem ("Female")
status.AddItem ("Single")
status.AddItem ("Widowed")
status.AddItem ("Divorced")
cmdCancel.Enabled = False
cmdSave.Enabled = False
LockTrue
End Sub
Private Sub Form_LostFocus()
mi.SetFocus
adoEmpz.Recordset.CancelBatch
End Sub
Private Sub Form_Terminate()
adoEmpz.Recordset.CancelBatch
adoEmpz.Recordset.CancelBatch
End Sub

Page | 58

Private Sub Form_Unload(cancel As Integer)


adoEmpz.Recordset.CancelBatch
adoEmpz.Recordset.CancelBatch
End Sub
Private Sub Frame2_DragDrop(Source As Control, X As Single, Y As Single)
End Sub
Private Sub gender_click()
Timer1.Enabled = False
End Sub
Private Sub status_click()
Timer1.Enabled = False
End Sub
Private Sub searchtxt_click()
searchtxt.Text = ""
cmdEdit.Enabled = False
Timer1.Enabled = True
Timer2.Enabled = False
End Sub
Private Sub searchtxt_GotFocus()
cmdEdit.Enabled = False
Timer2.Enabled = False
Timer1.Enabled = True
End Sub
Private Sub searchtxt_LostFocus()
searchtxt.Text = ""
cmdEdit.Enabled = False
Timer1.Enabled = False
Timer2.Enabled = True
End Sub
Private Sub SSTab2_DblClick()
End Sub
Private Sub Timer1_Timer()
If Not searchtxt.Text = "" Then
adoEmpz.Recordset.Filter = "lname like '%" & searchtxt.Text & "%'"
Else
adoEmpz.Refresh
End If
End Sub
Private Sub Timer2_Timer()

Page | 59

DataDeactivated.Refresh
DataEmployee.Refresh
searchtxt.Text = ""
AdoDeactivated.Refresh
'If Not AdoDeactivated.Recordset.EOF = True Then
'If cmdActivate.BackColor = &H8000000F Then
'cmdActivate.BackColor = &HC0C0C0'
'Else
'cmdActivate.BackColor = &H8000000F
'End If
'End If
End Sub

Private Sub Timer3_Timer()


If Not AdoDeactivated.Recordset.EOF = True Then
cmdActivate.Enabled = True
Else
cmdActivate.Enabled = False
End If
If adoEmpz.Recordset.EOF Then
cmdEdit.Enabled = False
Else
cmdEdit.Enabled = True
End If
End Sub

Private Sub Timer4_Timer()


If Not adoEmpz.Recordset.EOF = True Then
cmdActivate.Enabled = True
Else
cmdActivate.Enabled = False
End If
If adoEmpz.Recordset.EOF Then
cmdEdit.Enabled = False
Else
cmdEdit.Enabled = True
End If
End Sub

Page | 60

Employee DTR

Codes
Dim newrec As Boolean
Private Sub cmdClose_Click()
AdoEmployeeDTR.Recordset.cancel
AdoEmployeeDTR.Recordset.CancelBatch adAffectAllChapters
Unload Me
End Sub
Private Sub cmdPrint_Click()
If Format(date, "dd") <= 18 Then
rprSummary.Show vbModal
MDIForm1.SetFocus
Else
MDIForm1.SetFocus
End If
End Sub
End Sub
Private Sub DataGrid4_ButtonClick(ByVal ColIndex As Integer)
Timer1.Enabled = False
Timer2.Enabled = False
End Sub
Private Sub DataGrid4_Click()
Timer1.Enabled = False
Timer2.Enabled = False
End Sub

Page | 61

Private Sub DataGrid4_DblClick()


Timer1.Enabled = False
Timer2.Enabled = False
End Sub
Private Sub DataGrid4_HeadClick(ByVal ColIndex As Integer)
Timer1.Enabled = False
Timer2.Enabled = False
End Sub
Private Sub DataGrid4_Scroll(cancel As Integer)
Timer1.Enabled = False
End Sub
Private Sub fname_Change()
End Sub
Private Sub Form_Deactivate()
Unload Me
End Sub
Private Sub Form_Load()
Me.Top = 1
Me.Left = 1
End Sub
Private Sub Frame2_DragDrop(Source As Control, X As Single, Y As Single)
End Sub
Private Sub Timer1_Timer()
If Not idnumbertxt.Text = "" Then
AdoEmployeeDTR.Recordset.Filter = "Idnumber like '%" & idnumbertxt.Text & "%'"
idnumbertxt.SetFocus
Else
DataGrid4.Refresh
AdoEmployeeDTR.Refresh
End If
End Sub

Private Sub Timer2_Timer()


DataGrid4.Refresh
idnumbertxt.Text = ""
End Sub
Private Sub idnumbertxt_click()
idnumbertxt.Text = ""
Timer1.Enabled = True

Page | 62

Timer2.Enabled = False
End Sub
Private Sub idnumbertxt_GotFocus()
Timer2.Enabled = False
Timer1.Enabled = True
End Sub
Private Sub idnumbertxt_LostFocus()
Timer1.Enabled = False
Timer2.Enabled = True
End Sub
Private Sub idnumbertxt_KeyPress(KeyAscii As Integer)
If (KeyAscii < 48 Or KeyAscii > 57) And KeyAscii <> 8 Then KeyAscii = 0
End Sub

Create Pay Slip

Codes
Private Sub cmdFinish_Click()
If MsgBox("To avoid miscalculation(s), it's highly recommended to double check first before proceeding.
Are you sure to proceed NOW?", vbOKCancel) = vbOK Then
Timer5.Enabled = False
Dim i, j As Integer
lolz = 1000
pb1.Visible = True
pb1.Min = 1
pb1.Max = 500
pb1.Value = 1

Page | 63

For j% = 1 To 500
pb1.Value = j%
j% = j% + 1
'If ok = False Then
If j% = 50 Then
Timer3.Enabled = False
adoEmpz.Refresh
adoLoan.Refresh
adoEmpz.Recordset.MoveFirst
Do While Not adoEmpz.Recordset.EOF
If Not adoEmpz.Recordset.Fields("bonus") = 0 Then
kkk = True
End If
adoEmpz.Recordset.MoveNext
Loop
If kkk = True Then
MsgBox "Employee Bonus reset!"
kkk = False
End If
adoEmpz.Recordset.MoveFirst
Do While Not adoEmpz.Recordset.EOF
If Not adoEmpz.Recordset.Fields("bonus") = 0 Then
adoEmpz.Recordset.Fields("bonus") = 0
adoEmpz.Recordset.Update
End If
adoEmpz.Recordset.MoveNext
Loop
adoPost.Recordset.MoveFirst
Do While Not adoPost.Recordset.EOF
If Not adoPost.Recordset.Fields("bonus") = 0 Then
adoPost.Recordset.Fields("bonus") = 0
adoPost.Recordset.Update
End If
adoPost.Recordset.MoveNext
Loop
End If
If j% = 80 Then
If MsgBox("Would you reset now all the employee Working Days in the record?", vbYesNo) = vbYes Then
If Not adoEmpz.Recordset.EOF Then
adoEmpz.Recordset.MoveFirst
Do While Not adoEmpz.Recordset.EOF
adoEmpz.Recordset.Fields("workingdays") = 0

Page | 64

adoEmpz.Recordset.Update
adoEmpz.Recordset.MoveNext
Loop
End If
End If
End If
If j% = 100 Then
Do While Not adoEmpz.Recordset.EOF
If Not adoEmpz.Recordset.Fields("overtime") = 0 Then
MsgBox "Employee " & adoEmpz.Recordset.Fields("list") & " Overtime(s) Reset!"
adoEmpz.Recordset.Fields("overtimerate") = 0
adoEmpz.Recordset.Fields("overtime") = 0
adoEmpz.Recordset.Update
End If
If Not adoEmpz.Recordset.Fields("cashadvance") = 0 Then
adoEmpz.Recordset.Fields("cashadvance") = 0
adoEmpz.Recordset.Update
MsgBox "Employee " & adoEmpz.Recordset.Fields("list") & " Cash Advance(s) Reset!"
End If
If Not adoEmpz.Recordset.Fields("lossdamages") = 0 Then
adoEmpz.Recordset.Fields("lossdamages") = 0
adoEmpz.Recordset.Update
MsgBox "Employee " & adoEmpz.Recordset.Fields("list") & " Loss tire/Damages(s) Reset!"
End If
adoEmpz.Recordset.MoveNext
Loop
End If
If j% = 150 Then
If Format(date, "dd") <= 18 Then
If Not adoLoan.Recordset.EOF Then
If MsgBox("Would you like to deduct the Salary Loan now?", vbYesNo) = vbYes Then
Do While Not adoLoan.Recordset.EOF
adoLoan.Recordset.Fields("loanremain")
=
adoLoan.Recordset.Fields("loanremain")
adoLoan.Recordset.Fields("loanded")
adoLoan.Recordset.MoveNext
Loop
adoLoan.Recordset.MoveFirst
Else
adoEmpz.Refresh
adoLoan.Refresh
End If
End If
End If

Page | 65

End If
adoEmpz.Refresh
adoEmpz.Recordset.MoveFirst
If j% = 250 Then
If Not adoLoan.Recordset.EOF Then
adoLoan.Recordset.MoveFirst

Do While Not adoLoan.Recordset.EOF


If adoLoan.Recordset.Fields("loanremain") <= 0 Then
MsgBox "Salary loan for " & adoLoan.Recordset.Fields("lname") & " has been closed",
vbInformation
Do While Not adoEmpz.Recordset.EOF
If adoLoan.Recordset.Fields("lname") = adoEmpz.Recordset.Fields("list") Then
adoEmpz.Recordset.Fields("loanremain") = 0
adoEmpz.Recordset.Fields("loanded") = 0
adoEmpz.Recordset.Fields("salaryloan") = 0
adoEmpz.Recordset.Update
adoEmpz.Recordset.UpdateBatch adAffectCurrent
End If
adoEmpz.Recordset.MoveNext
Loop
adoLoan.Recordset.delete adAffectCurrent
adoLoan.Refresh
adoEmpz.Refresh
End If
adoLoan.Recordset.MoveNext
Loop
End If
adoEmpz.Refresh
Timer2.Enabled = True
MsgBox "Process Completed! Proceeding to other task ....", vbInformation
End If
If j% = 500 Then
MsgBox "Done! Exiting . . .", vbInformation
End If
Next j%
pb1.Visible = False
adoEmpz.Refresh
Timer5.Enabled = True
Timer2.Enabled = True

Page | 66

Unload Me
End If
End Sub
Private Sub cmdPrintPay_Click()
If Format(date, "dd") <= 18 Then
prReports.Show vbModal
MDIForm1.SetFocus
Else
prReports2.Show vbModal
MDIForm1.SetFocus
End If
End Sub

Private Sub cmdSearch_Click()


searchtxt.Text = ""
Timer2.Enabled = True
adoEmpz.Refresh
DataPayed.Refresh
End Sub

Private Sub DataPayed_Click()


lolz = True
Timer1.Enabled = False
Timer2.Enabled = False
Timer3.Enabled = False
Timer5.Enabled = True
'disName.Text = DataPayed
End Sub
Private Sub DataPayed_DblClick()
Timer1.Enabled = False
Timer2.Enabled = False
Timer3.Enabled = False
Timer5.Enabled = True
End Sub
Private Sub DataPayed_GotFocus()
Timer1.Enabled = False
Timer2.Enabled = False
Timer3.Enabled = False
Timer5.Enabled = True
End Sub
Private Sub DataPayed_HeadClick(ByVal ColIndex As Integer)

Page | 67

Timer1.Enabled = False
Timer2.Enabled = False
Timer3.Enabled = False
Timer5.Enabled = True
End Sub
Private Sub DataPayed_LostFocus()
'Timer1.Enabled = True
'Timer2.Enabled = True
'Timer5.Enabled = False
End Sub
Private Sub DataPayed_Scroll(cancel As Integer)
Timer1.Enabled = False
Timer2.Enabled = False
Timer3.Enabled = False
End Sub
Private Sub Form_Activate()
Timer2.Enabled = True
If Not adoLoan.Recordset.EOF Then
adoLoan.Recordset.MoveFirst

Do While Not adoLoan.Recordset.EOF


If adoLoan.Recordset.Fields("loanremain") <= 0 Then
MsgBox "Salary loan for " & adoLoan.Recordset.Fields("lname") & " has been closed",
vbInformation
Do While Not adoEmpz.Recordset.EOF
If adoLoan.Recordset.Fields("lname") = adoEmpz.Recordset.Fields("list") Then
adoEmpz.Recordset.Fields("loanremain") = 0
adoEmpz.Recordset.Fields("loanded") = 0
adoEmpz.Recordset.Fields("salaryloan") = 0
adoEmpz.Recordset.Update
adoEmpz.Recordset.UpdateBatch adAffectCurrent
End If
adoEmpz.Recordset.MoveNext
Loop
adoLoan.Recordset.delete adAffectCurrent
adoLoan.Refresh
adoEmpz.Refresh
End If

adoLoan.Recordset.MoveNext
Loop

Page | 68

End If
End Sub
Private Sub Form_Deactivate()
adoEmpz.Refresh
Unload Me
End Sub
Private Sub Form_GotFocus()
Timer2.Enabled = True
End Sub
Private Sub Form_Load()
Me.Top = 1
Me.Left = 1
Timer2.Enabled = True
End Sub
Private Sub searchtxt_click()
searchtxt.Text = ""
Timer1.Enabled = True
Timer2.Enabled = False
End Sub
Private Sub searchtxt_GotFocus()
Timer1.Enabled = True
Timer2.Enabled = False
End Sub
Private Sub searchtxt_LostFocus()
Timer2.Enabled = True
Timer3.Enabled = True
Timer1.Enabled = False
End Sub
Private Sub sss_LostFocus()
Timer1.Enabled = True
If sss.Text = "" Then
sss.Text = 0
End If
ediTe.Value = 0
End Sub
Private Sub Timer1_Timer()
If Not searchtxt.Text = "" Then
If Not adoEmpz.Recordset.EOF Then
adoEmpz.Recordset.Filter = "lname like '%" & searchtxt.Text & "%'"
End If
End If
End Sub
Private Sub Timer2_Timer()

Page | 69

adoEmpz.Refresh
DataPayed.Refresh
End Sub
Private Sub Timer5_Timer()
If sss.Text = "" Then
sss.Text = 0
End If
If lostire.Text = "" Then
lostire.Text = 0
End If
If cashadvance.Text = "" Then
cashadvance.Text = 0
End If
If overtime.Text = "" Then
overtime.Text = 0
End If
If overtimeamount.Text = "" Then
overtimeamount.Text = 0
End If
If sss.Text = "" Then
sss.Text = 0
End If
If Not adoEmpz.Recordset.EOF Then
adoEmpz.Recordset.Fields("basicpay")
adoEmpz.Recordset.Fields("workingdays")
adoEmpz.Recordset.Fields("overtimetot")
adoEmpz.Recordset.Fields("overtimerate")
adoEmpz.Recordset.Fields("totalgross")
adoEmpz.Recordset.Fields("month13")
adoEmpz.Recordset.Fields("overtimetot")
adoEmpz.Recordset.Fields("totalded")
adoEmpz.Recordset.Fields("cashadvance")
If Format(date, "dd") <= 18 Then
adoEmpz.Recordset.Fields("totalded")
adoEmpz.Recordset.Fields("loanded")
Else
salaryloan.Enabled = False
End If

adoEmpz.Recordset.Fields("rate")

adoEmpz.Recordset.Fields("overtime")

adoEmpz.Recordset.Fields("basicpay")
adoEmpz.Recordset.Fields("bonus")

+
+

=
+
=

adoEmpz.Recordset.Fields("lossdamages")

adoEmpz.Recordset.Fields("totalded")

If Format(date, "dd") >= 19 Then


If ediTe.Value = 1 Then
sss.Enabled = True
sss.BackColor = &H80000005
End If
If ediTe.Value = 0 Then

Page | 70

sss.Enabled = False
sss.BackColor = &H80000018
End If
adoEmpz.Recordset.Fields("totalded")
adoEmpz.Recordset.Fields("sss")
Else
sss.Enabled = False
ediTe.Enabled = False
End If
adoEmpz.Recordset.Fields("net")
adoEmpz.Recordset.Fields("totalded")
'If lolz = True Then
adoEmpz.Recordset.Update
'End If
End If
End Sub

adoEmpz.Recordset.Fields("totalded")

adoEmpz.Recordset.Fields("totalgross")

Events

Codes
Dim newrec As Boolean
Private Sub account_DragDrop(Source As Control, X As Single, Y As Single)
End Sub
Private Sub cancel_Click()
adoEvents.Recordset.CancelBatch

Page | 71

adoEvents.Refresh
save.Enabled = False
edit.Enabled = True
newrec = False
cancel.Enabled = False
DataGrid3.Enabled = True
save.Caption = "&Save"
rate.Enabled = False
sss.Enabled = False
pagibig.Enabled = False
philhealth.Enabled = False
bonus.Enabled = False
month13.Enabled = False
Timer1.Enabled = True
End Sub
Private Sub cmdExit_Click()
adoEvents.Recordset.cancel
adoEvents.Recordset.CancelBatch adAffectAllChapters
Unload Me
End Sub
Private Sub DataGrid3_Click()
Timer1.Enabled = False
End Sub
Private Sub DataGrid3_Scroll(cancel As Integer)
Timer1.Enabled = False
End Sub
Private Sub edit_Click()
rate.Enabled = True
sss.Enabled = True
pagibig.Enabled = True
philhealth.Enabled = True
bonus.Enabled = True
month13.Enabled = True
newrec = False
save.Enabled = True
cancel.Enabled = True
edit.Enabled = False
save.Caption = "&Update"
rate.SetFocus
End Sub
Private Sub Form_Deactivate()

Page | 72

Unload Me
End Sub
Private Sub rate_Click()
Timer1.Enabled = False
End Sub
Private Sub sss_click()
Timer1.Enabled = False
End Sub
Private Sub pagibig_Click()
Timer1.Enabled = False
End Sub
Private Sub philhealth_Click()
Timer1.Enabled = False
End Sub
Private Sub bonus_Click()
Timer1.Enabled = False
End Sub
Private Sub month13_Click()
Timer1.Enabled = False
End Sub

Private Sub save_Click()


If MsgBox("Are you sure you want to save?", vbYesNo) = vbYes Then
adoEvents.Recordset.Update
save.Enabled = False
cancel.Enabled = False
edit.Enabled = True
MsgBox "Succesfully Save!", vbInformation
newrec = True
DataGrid3.Enabled = True
save.Caption = "Save"
Timer1.Enabled = True
'AccEnabledF
DataGrid3.Enabled = True
rate.Enabled = False
sss.Enabled = False
pagibig.Enabled = False
philhealth.Enabled = False
bonus.Enabled = False
month13.Enabled = False

Page | 73

Else
adoEvents.Recordset.CancelBatch
edit.Enabled = True
save.Caption = "Save"
cancel.Enabled = False
save.Enabled = False
adoEvents.Refresh
DataGrid3.Enabled = True
End If
ext:
rate.Enabled = False
sss.Enabled = False
pagibig.Enabled = False
philhealth.Enabled = False
bonus.Enabled = False
month13.Enabled = False

edit.Enabled = True
save.Caption = "Save"
cancel.Enabled = False
save.Enabled = False
adoEvents.Refresh
Timer1.Enabled = True
End Sub
Private Sub Form_Load()
Me.Top = 1
Me.Left = 1
save.Enabled = False
cancel.Enabled = False
rate.Enabled = False
sss.Enabled = False
pagibig.Enabled = False
philhealth.Enabled = False
bonus.Enabled = False
month13.Enabled = False
End Sub
Private Sub Timer1_Timer()
DataGrid3.Refresh
adoEvents.Refresh
End Sub

Page | 74

Freeze

Codes
Private Sub cmdUnfreeze_Click()
AdoFreeze.RecordSource = "select * from Account where Password = '" + txtFreeze.Text + "' "
AdoFreeze.Refresh
If AdoFreeze.Recordset.EOF Then
txtFreeze.Text = ""
txtFreeze.BackColor = &HC0C0FF
txtFreeze.SetFocus
Else
If AdoFreeze.Recordset.Fields("Type") = "Admin" Then
MDIForm1.Enabled = True
Unload Me
ElseIf AdoFreeze.Recordset.Fields("Type") = "HR" Then
MDIForm1.Enabled = True
Unload Me
ElseIf AdoFreeze.Recordset.Fields("Type") = "Payroll" Then
MDIForm1.Enabled = True
Unload Me
End If
End If
End Sub
Private Sub Form_Load()

Page | 75

MDIForm1.Enabled = False
End Sub
Private Sub txtFreeze_Change()
If txtFreeze.BackColor = &HC0C0FF Then txtFreeze.BackColor = &HFFFFFF
End Sub
Private Sub txtFreeze_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
cmdUnfreeze_Click
End If
End Sub

Back-Up

Codes
Private Sub mnuBackup_Click()
MsgBox "Are you sure you want to make a new backup?", vbOKCancel, "CONFIRM BACKUP"
Dim FsFile As New FileSystemObject
With dialogbackup
.FileName = ""
.Filter = "*.mdb"
.CancelError = False
.ShowSave
If .FileName <> "" Then
FsFile.CopyFile (App.Path & "\ETS.mdb"), .FileName & ".mdb"
MsgBox "Back-up Complete", vbInformation, Me.Caption
End If
End With
End Sub

Page | 76

Restore

Codes
Private Sub mnuRestore_Click()
Dim FsFile As New FileSystemObject
With dialogbackup
.FileName = ""
.Filter = "*.mdb"
.CancelError = False
.ShowOpen
If .FileName <> "" Then
MsgBox "Are you sure you want to restore this backup?", vbQuestion + vbOKCancel, "CONFIRM
RESTORE"
FsFile.CopyFile .FileName, App.Path & "\ETS.mdb"
MsgBox "Restoration Complete", vbInformation, Me.Caption
End If
End With
End Sub

Page | 77

About

Codes
Private Sub Label3_Click()
End Sub
Private Sub Timer1_Timer()
Static count As Integer
count = count + 1
If count = 1 Then
lblDabase = "Alday, Michael Kelvin M."

ElseIf count = 2 Then


lblDabase = "Arcalas, Jolina Danica J."

ElseIf count = 3 Then


lblDabase = "Brosas, Christian Rey M."

ElseIf count = 4 Then


lblDabase = "Logronio, Jaime P."

Page | 78

ElseIf count = 5 Then


Label4.ForeColor = &HFFFF&
Label4.Caption = "Lego!"
lblDabase.Visible = False
ElseIf count = 6 Then
Timer1.Enabled = False
End If
End Sub

Log-out

Codes
Private Sub mnuLogout_Click()
Unload Me
frmLogin.Show
End Sub

Page | 79

Page | 80

Vous aimerez peut-être aussi