100% found this document useful (1 vote)
1K views140 pages

Payroll Documentation

The document discusses payroll systems, including both manual and computerized systems. It provides background on the typical payroll process and describes the benefits of a proposed computerized payroll system for San Carlos Computer World, including more accurate payroll calculation and reduced workload. Examples are given of other organizations that have implemented computerized payroll systems, including local governments and the national government of the Philippines.
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
100% found this document useful (1 vote)
1K views140 pages

Payroll Documentation

The document discusses payroll systems, including both manual and computerized systems. It provides background on the typical payroll process and describes the benefits of a proposed computerized payroll system for San Carlos Computer World, including more accurate payroll calculation and reduced workload. Examples are given of other organizations that have implemented computerized payroll systems, including local governments and the national government of the Philippines.
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
You are on page 1/ 140

Perpetual Help College of Pangasinan

Malasiqui, Pangasinan

Chapter I

Introduction

Background of the Study

Payroll consists of the process by which a business pays

its employees for work performed during a specific period. A

payroll system allows businesses to follow a set series of

processes in order to make timely, correct payments in

compliance with government regulations. A payroll system may

be manual or computerized and handled in-house or outsourced

to another provider.

The payroll process typically includes calculating

employee salary, recording payroll transactions and

determining and paying payroll taxes. A company must have in

place a timekeeping system that accurately reflects the hours

put in by nonexempt employees as well as the regular salary

payments for exempt workers. Employers typically withhold

federal income tax from employee earnings; at the end of the

month, they must report all wages, bonuses and other

compensation paid. Companies also must withhold Social

Security and Medicare contributions from employees' wages and

pay a matching amount.

1
San Carlos Computer World Payroll System
Perpetual Help College of Pangasinan
Malasiqui, Pangasinan

As computer technology changes at such fast phase, many

business sectors try to cope up by upgrading computer system

constantly in order to stay competitive. The multi-function

ability of technology for its advance system is also an

important factor for a company to use software. It makes

efficient use of the advance technology and has ambition to

discover more. Computers have the great impact on the

profession of accounting. With the rapid growth of technology

today, there is no doubt that computer will become a common

asset in all profession.

The program also allows the monthly payroll schedule to

be calculated accurately. Just by having employees’ info like

name, days of work, wages etc. to enter in the database.

Therefore, payroll can be done with the guide of the program.

The system is good in for its specialty in the fields of

accounting. It is easy to use, effective and efficient in

organizing and calculating the payroll. In addition, this

study aims to develop a reliable and manageable computerized

payroll system for San Carlos Computer World for a better

manageable of a business. The Proposed Computerized Payroll

System will give a big relief of the employee and employers

as well.

2
San Carlos Computer World Payroll System
Perpetual Help College of Pangasinan
Malasiqui, Pangasinan

HISTORY

A strong commitment to quality and continuous innovation

in the field of Information, Computer Technology and 24/7

CCTV camera has elevated the company to become one of the

leading IT distributor/marketers in the Philippines. They

provide equal in product and services.

Barely eight (8) years of operation in San Carlos branch,

manage by Mr. Alfonso Balino with the help of four technicians

and one secretary. Their company is well known as the #1

selling (direct importer) carrying high quality made in Korea

product offering the lowest price in the market. The store is

located at #21 Roxas Blvd, San Carlos City, Pangasinan and

established on year 2011.

The company has provided its credibility in the line of

IT product and services. From its head office in Quezon City,

Manila and business operation expanded to the opening of other

outlet namely: Dagupan, Urdaneta, Lingayen, Baguio City,

Cabanatuan, Angeles, Pampanga, Novaliches, Bacoor,

Dasmariñas, and Tanza.

Today, the company is enjoying continued patronage and

loyalty from its clients and looking forward to sustain its

growth in the future.

3
San Carlos Computer World Payroll System
Perpetual Help College of Pangasinan
Malasiqui, Pangasinan

Local Literature

Cagayan de Oro City Hall Computerized Payroll System

The City Accounting Department has introduced an

upgraded computerized payroll system for permanent employees

in a bid to improve its service and maximizes resources. This

project, which was conceived two years ago, basically aims to

our services particularly in the processing of payrolls for

permanent employees," City Accountant Wilma Polley-Rugay told

payroll in-charge of the different departments and offices at

City Hall during a briefing and orientation on the concept of

the one-month payroll system held Friday last week at the

City Council session hall in Cagayan de Oro City. With the

added features of the new computerized payroll system.

According to Rugay that the preparation, processing and

payment of payroll system to permanent employees would be

hastened and fast-tracked. Rugay stressed that the adoption

of the one-month payroll system is also beneficial, not only

to the City Accounting Department, but also to the payroll-

in-charge as it would save time, energy and resources.

"Employees who handle payroll preparation and processing can

now attend to other office needs and concerns as the new

payroll system will lessen their

4
San Carlos Computer World Payroll System
Perpetual Help College of Pangasinan
Malasiqui, Pangasinan

workload," she added. Under the new payroll system,

preparation and processing of payroll, which reflects the

accrued amount payable every 15th and 30th day of the month,

is done only once. Unlike the time-consuming old payroll

system, preparation and processing of payroll is done twice

a month covering the first half and second half of the month.

It may be recalled that City Mayor Constantino G. Jaraula

ordered last week the adoption of the new computerized payroll

system which is expected to take effect starting the month of

October. (Cagayan de Oro City IO/PIA-MisOrOccCam i-Net)

Makati lone gov’t in Metro using archaic payroll system,

touted as the country’s thoroughly modern city, remains in

the dark ages as far as paying employee salaries goes. Other

local government units (LGUs) in Metropolitan Manila have

long adopted the automated teller machine (ATM) system, a

stark contrast to Makati City, where wages are still disbursed

in archaic pay envelopes.

The telephone inquiry revealed that 16 of the capital’s

17 LGUs have been using the digitized payroll system since

2003.Employees of Manila, Mandaluyong, Marikina, Pasig,

Quezon, San Juan, Las Piñas, Muntinlupa, Parañaque, Pasay,

Taguig, Caloocan, Malabon, Navotas, Valenzuela and the town

of Pateros

5
San Carlos Computer World Payroll System
Perpetual Help College of Pangasinan
Malasiqui, Pangasinan

have ATM cards to be able to draw their pay. In contrast,

Makati, country’s financial hub, has not yet updated its

payroll system for about 9,000 employees, according to a 2012

annual audit report by the Commission on Audit (COA).The COA

noted that drawbacks to Makati’s payroll system include the

high risk of loss or misapplication, loss of working hours

for employees, long queues at the teller’s booths, and the

tedious manual distribution of cash to 4,024 regular and 4,794

casual employees every payday. Makati has the third-largest

workforce with 7,411 regular and casual workers, according to

a separate annual financial report on LGUs by the COA in 2012.

Quezon City has the biggest number with 13,477 employees,

followed by Manila with 10,749.Caloocan has 1,658 employees,

Las Piñas–1,997, Malabon–1,614, Mandaluyong–4,412, Marikina–

2,485, Muntinlupa–4,457, Navotas–475, Parañaque–5,921,

Pasay–3,023, Pasig–5,964, San Juan–1,059, Taguig–973,

Valenzuela–7,673 and Pateros–189. Makati, also considered one

of the richest cities in the country, has the second-highest

income next to Quezon City. From 2007 to 2009, the city’s

average income was P8.51 billion, as shown by a National

Statistical Coordination Board (NSCB) data released in 2012.

The NSCB stated that Makati generated the largest

revenue in taxes during the same years with an average of

6
San Carlos Computer World Payroll System
Perpetual Help College of Pangasinan
Malasiqui, Pangasinan

P7.08 billion. Based from the Makati spokesman Joey Salgado

earlier said that the city government had been working on the

ATM system since the 1990s, but was being stalled by changes

in the personnel department.

National Digitized System

Last year, the Aquino administration began implementing

the National Payroll System (NPS), which enabled employees of

the national government to receive their salaries straight

from the Treasury through their bank accounts. President

Aquino directed the Department of Budget and Management to

integrate first all employees of the Department of Education

(DepEd) in the system, followed by the Philippine National

Police (PNP) and the Armed Forces of the Philippines (AFP).Of

about 1 million employees of the national government, DepEd’s

workforce accounts for the biggest chunk with about 579,000,

followed by the PNP with 146,000 people and 125,000 in the

AFP. Budget Secretary Florencio Abad said the NPS will

increase transparency and accountability in the bureaucracy,

adding that it will be a valuable instrument in eliminating

ghost employees and preventing other payroll-related

irregularities. The NPS will also ensure the timely

remittance of withholding taxes to the Bureau of Internal

revenue, and contributions to the Government Service

7
San Carlos Computer World Payroll System
Perpetual Help College of Pangasinan
Malasiqui, Pangasinan

Insurance System, Pag-Ibig Fund and PhilHealth. The NPS is a

component of the Government Human Resource Information

System, which is tasked to harmonize and unify all personnel

management operations in the bureaucracy, from recruitment

all the way to retirement. It is expected to be completed in

the second quarter this year.

2GO Group, Inc. is the only integrated transport

solutions provider in the Philippines today. Its principal

business units are engaged in the movement of people operating

under the brand names 2GO Travel, 2GO Distribution and 2GO

Supply Chain - 2GO Express, 2GO Logistics and 2GO Freight.

2GO's array of services are geared towards cargo movements

includes containerization, RoRo services, logistics and

supply chain solutions. Process DTR of employees (by batch),

generates, validates and transfer batch Timekeeping Element

Entries (overtime, night premium, lop, under time and

tardiness in OTL Virtus System. Process Report (DTR, BEE

Summary, and TK Summary Report), validates all TK elements

through above reports. Prepares and upload all validated

manually applied overtime through data loader. Records all

advised deductions from finance, benefits and gaffed

including government loans, company loans and others. Submits

request on the system to process the assigned payroll group.

8
San Carlos Computer World Payroll System
Perpetual Help College of Pangasinan
Malasiqui, Pangasinan

Produce Pre-payment and reports of processed payroll

transaction such as Payroll Register, Bank Advise, and

Carbonized Pay slip for validation and as reference for

inquiries. Validates process payroll by comparing headcount,

basic earnings, deductions and net pay for the purpose of

establishing resemblances and differences. Requests for

funding of payroll to treasury thru email. Transmits and

process approval of Payroll thru BDO Online Internet Banking

System and/or thru bank diskette. Prepares and submits bank

advice for the rejected payroll transactions to BDO thru fax

or messenger. Produce costing process in Virtus

system. Validates the report by comparing total with Payroll

Register vs. Costing Summary Report, examines report by

verifying valid combination of accounting flex field Submits

transfer to GL on the system, advice finance thru email and

confirm that payroll transaction has been successfully posted

in the General Ledger (GL).

The preparation of reports for Company Loans such as

Cash Advance, Health Plans, Coop/Cesla, Slamoe, Bank Loans

based on Payroll Register. Prepares and submits RPS for

approval and forwards to finance for funding and check

preparation. Prepares other reports such as LWOP Report for

broadcast of HR Helpdesk and OT Tardy Report for submission

9
San Carlos Computer World Payroll System
Perpetual Help College of Pangasinan
Malasiqui, Pangasinan

to HR Partners. Initiate DTR Access of new hired employees by

defining hiring date in OTL (Oracle Time and Labor) based on

received SOS from PIS Staff. Classify DTR location and

required work schedule. Updates 201 file of new hire employees

by encoding SL/VL Plan, basic salary and account number in

preparation for payroll.

Computerized Payroll System of Department of Health (DOH)

The Computerized Payroll System is a window based

program especially designed to facilitate and simplify the

monthly preparation of general payroll and related reports

such as Standard computerized payroll system for use in all

DOH offices, Allows faster and more accurate computation of

monthly gross income, deductions and net salary, Faster and

less-resource-consuming generation of General Payroll and

other payroll related reports, Security and integrity of

payroll data and information. The Features of computerized

payroll system of DOH are Graphical User Interface,

Interactive and menu-driven program, Systematic maintenance

and retrieval of employee records, Flexible as it provides

options to include additional fields for other compensation

and deductions unique to an office or unit, Automatic

computation of monthly net income, GSIS, PAG-IBIG,

Withholding Tax and other deductions, Y2K compliant, Fast and

10
San Carlos Computer World Payroll System
Perpetual Help College of Pangasinan
Malasiqui, Pangasinan

easy generation of the General Payroll and all other payroll

related reports which include Monthly reports like GSIS and

PAG-IBIG remittances, Denominations Report and Leave Credits

Report and annual Year-end Tax Reports, Password security to

ensure the integrity of data. General payroll reports such as

Payroll Summary sheet, Pay slip, Leave Credits Report,

Withholding Tax Statement (W-2), BIR Remittance Reports, GSIS

Remittance Reports, PAG-IBIG Remittance Reports, Other User-

defined Reports (PERA, ACA, PNB, etc..)

Foreign Literature

A Payroll System designed to produce payroll checks with

appropriate withholdings, benefits, allowances, and

deductions for employees in multiple companies, departments,

and/or sub-departments. It has been designed to handle up to

1,000,000 employees in 100 companies, 1,000 departments in

each company. Some of the features and benefits of the Payroll

System are multiple cost centers for payroll reporting, will

handle special non-taxable benefits for ministers, flexible

withholding capability, ability to split payroll expense

between different cost centers, complete governmental

reporting; FICA, FUTA, SUTA, Workman's Compensation, W-2's,

and 1099's, Payroll check reversal, One check capability,

Salaried, hourly, and contract employees in the same payroll

11
San Carlos Computer World Payroll System
Perpetual Help College of Pangasinan
Malasiqui, Pangasinan

run, Combined processing for weekly, bi-weekly, semi-monthly,

or monthly, Taxable and non-taxable benefits and deductions,

Multiple hourly rates for each employee, General ledger

interface, Check list UFD file for check reconciliation,

Extensive personnel information for each employee, Accrual of

sick, vacation, and holiday hours, Flexible federal, state,

and local taxation, Multiple company, department, and sub-

department capability, Flexible benefit and deduction

capability, Easy federal, state, and local tax table

maintenance, Split income over multiple companies,

departments, sub-departments, Payroll accrual/reversal

capabilities, Time card data entry function, Special message

function for printing on check stub.

Canadian Payroll System control over employee earnings

and benefits, special payroll situations and government

reporting, ensuring that your company's payroll requirements

and personnel policies are accurate to the penny. You can

enter or import timecards, enter after-the-fact pay cheques,

run automatic calculations or even combine all three methods

to get your pay data into the system and your pay cheques

deployed on time. Payroll handles all pay frequencies;

multiple work states; unlimited earnings, deductions,

12
San Carlos Computer World Payroll System
Perpetual Help College of Pangasinan
Malasiqui, Pangasinan

benefits and taxes; and other pay factors such as expense

reimbursements, accruals and advances.

The payroll system supports the monthly remuneration for

government employees. The current payroll system is a

mainframe system on UNIX servers developed in house in 1985

using COBOL programming. The payroll is batch processed on a

monthly basis at the Department of Treasury. There are 20

data entry PCs. Clerks enter the data in the payroll

processing system. Payroll reports are then printed out and

verified by employers, after which amendments are made as

required. The payroll system will eventually be phased out by

the Personnel Control and Information Systems (PCIS)

described below. At present data must be batched, recorded on

tape and then migrated to the PCIS. This extra step is

necessary because the new system is not linked to the

budgeting system. A link between the PCIS and the budgeting

system is needed to ensure that salary expenditure does not

exceed budgeted amounts and it is understood that such a link

is planned. This is a short-term situation during the process

of system integration and the complete transfer of data. The

project team recognizes that a loss of data between the two

systems could jeopardize the entire existing payroll system.

13
San Carlos Computer World Payroll System
Perpetual Help College of Pangasinan
Malasiqui, Pangasinan

Statement of the Problem

The researcher’s interest to conduct a study has led

them to understand the payroll system of San Carlos Computer

World present problems:

1. How to minimize the time needed by the administration

with regards with the computation of payroll to their

employees?

2. How does the employee receive an accurate computation

when it comes with their salary?

3. How to make the employees record systematic, consistent

and more organize?

4. How does the company assure the security of the records?

Objectives of the Study

This study aimed to help the San Carlos Computer World

to have an efficient and effective way of monitoring their

employee’s time keeping and payroll system to give a higher

quality of service.

1. By using computerized payroll system, the process of

generating payroll, collecting and retrieving records of

the employees by the administrator would be faster and

also saves a lot of time.

14
San Carlos Computer World Payroll System
Perpetual Help College of Pangasinan
Malasiqui, Pangasinan

2. The computerized payroll system has a feature of

printing the employees pay slip will show and provide

the complete details and information about their salary.

3. The employee’s record will be stored in database so that

the overlapping, misplacing and losing of records will

be avoided.

4. The computerized payroll system have the capability on

securing and maintaining the records of the employees

because the database that is used in the system is

encrypted. Only the administrator knows the database

password so that there’s no unauthorized person can

access/view it.

15
San Carlos Computer World Payroll System
Perpetual Help College of Pangasinan
Malasiqui, Pangasinan

Scope and Delimitation

This system for San Carlos Computer World is 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

company’s time keeping and payroll into Visual Basic Program.

The system also covers the payroll processing and reporting

which includes the calculation of salary. The system will have

a report consist of summary of timesheet, summary of payroll

computation, summary of withholding tax, SSS, Phil Health and Pag-

IBIG contributions. The computation of their salary is per day and

given by the end of the month. No other currencies are computed in

the system but Philippine Peso only. The proposed system cannot be

accessed online and it focuses only on the employee’s time keeping

and payroll system of the San Carlos Computer World. The

necessary required remittance form given by the SSS, PAG-

IBIG, PHILHEALTH will be remitted manually. This proposed

system is only applicable and can only be used by the management

of San Carlos Computer World.

16
San Carlos Computer World Payroll System
Perpetual Help College of Pangasinan
Malasiqui, Pangasinan

Definition of terms

A. Account. A record of debit and credit entries to cover

transaction involving a particular person or concern.

B. Admin. Someone who can make changes on a computer system.

Administrators can change, the information that the user

sent. They are the ones capable to control the system.

C. Biometric. relating to or involving the application of

statistical analysis to biological data.

D. Computer. An electronic machine that can store and work

with large amounts of information.

E. Database. A collection of information that is organized

and used on a computer.

F. Enhancement. An instance of notable progress in the

development of knowledge, technology, or skill.

G. Information Technology. The technology involving the

development, maintenance, and use of computer systems,

software, and networks for the processing and

distribution of data.

H. Management. The act or skill of controlling and making

decisions about a business, department, sports team,

etc.

17
San Carlos Computer World Payroll System
Perpetual Help College of Pangasinan
Malasiqui, Pangasinan

I. Modern. Relating to the present time or the recent past:

Happening, existing, or developing at a time near the

present time.

J. Monitoring. A device for observing a biological

condition or function.

K. Record. To store (something, such as sounds, music,

images, etc.) on tape or on a disk so that it can be

heard or seen later: to produce a recording of

(something).

L. Human Resource. The people that staff and operate an

organization, as contrasted with the financial and

material resources of an organization.

M. Security. the state of being free from danger or threats.

N. System. A group of devices or artificial objects or an

organization forming a network especially for

distributing something or a serving common purpose.

18
San Carlos Computer World Payroll System
Perpetual Help College of Pangasinan
Malasiqui, Pangasinan

Chapter II

DESIGN AND METHODOLOGY

Methodology

In conducting the study, the researchers have used the

following software development methodology and data gathering

techniques.

Figure 1. Waterfall Model

Waterfall approach was first SDLC Model to be used widely

in Software Engineering to ensure success of the project. In

The Waterfall approach, the whole process of software

19
San Carlos Computer World Payroll System
Perpetual Help College of Pangasinan
Malasiqui, Pangasinan

development is divided into separate phases. In this

Waterfall model, typically, the outcome of one phase acts as

the input for the next phase sequentially.

The following illustration is a representation of the

different phases of the Waterfall Model.

The sequential phases in Waterfall model are the following:

Requirement Gathering and analysis. All possible requirements

of the system to be developed are captured in this phase and

documented in a requirement specification document.

System Design. The requirement specifications from first

phase are studied in this phase and the system design is

prepared. This system design helps in specifying hardware and

system requirements and helps in defining the overall system

architecture.

Implementation. With inputs from the system design, the

system is first developed in small programs called units,

which are integrated in the next phase. Each unit is developed

and tested for its functionality, which is referred to as

Unit Testing.

Integration and Testing. All the units developed in the

implementation phase are integrated into a system after

20
San Carlos Computer World Payroll System
Perpetual Help College of Pangasinan
Malasiqui, Pangasinan

testing of each unit. Post integration the entire system is

tested for any faults and failures.

Deployment of system. Once the functional and non-functional

testing is done; the product is deployed in the customer

environment or released into the market.

Maintenance. There are some issues which come up in the client

environment. To fix those issues, patches are released. Also

to enhance the product some better versions are released.

Maintenance is done to deliver these changes in the customer

environment.

All these phases are cascaded to each other in which

progress is seen as flowing steadily downwards (like a

waterfall) through the phases. The next phase is started only

after the defined set of goals are achieved for previous phase

and it is signed off, so the name Waterfall Model. In this

model, phases do not overlap.

21
San Carlos Computer World Payroll System
Perpetual Help College of Pangasinan
Malasiqui, Pangasinan

Data Gathering Techniques

The following data gathering techniques were used by researchers

to collect information needed for this research study.

Using Available Information

Data gathering using available information is a large

amount of data that has collected by others, although it may

not necessarily have been analyzed or published. Locating

these sources and retrieving the information is a good

starting point in any data collection effort.

The researchers acquired data though the internet and the

available data in the books.

Observation

By the means of observation, the researchers get

information of the flow of the current system used by the

respondents. Studying what will be their reactions in terms

of appraising the system they’ve made used for a long time.

The researchers tried to observe the Computer World San

Carlos Branch on how they process the payroll of the

employees. And use the manual way of using paper to list the

pay slip of the employees.

22
San Carlos Computer World Payroll System
Perpetual Help College of Pangasinan
Malasiqui, Pangasinan

Interview

Interview is a data-collection technique that involves

oral questioning of respondents, either individually or as a

group.

The researchers went to the Shop (Computer World San Carlos

Branch) as group for the initial interview with the Head of the Shop,

they asked him if they are willing to have a payroll system

to make their work faster and without hesitation they agreed.

The researchers make some questions about how they manage the

payroll of the employees by just using this manual system.

Focus Group Discussions (FGD)

A focus group discussion allows a group of 8-12

information to freely discuss a certain subject with the

guidance of a facilitator or reporter.

Every group has their own research different topics and

different systems but in this way we work with the other group

for us to make our research more successful. Every group

discusses about their research talk about what can them do

more if their still lack off or something to improve. Every

group shared their insight and gave their opinions and

suggestions. In this processit gives more every group a

potential to make their study successful.

23
San Carlos Computer World Payroll System
Perpetual Help College of Pangasinan
Malasiqui, Pangasinan

Chapter III

Discussion of Findings

The Existing System

The San Carlos Computer World still use the manual way

of using paper to list down the payroll of the employees. It

take so much of time to compute salary of all employees. It

also takes a lot of time to make pay slip ready. They will

gather all the data from their biometric device to see the

daily time record of the employees. They will print all the

data and manually compute the salary of the employees based

on their daily time record. They will organized those pay

slip of the employees so that it is easy for them to find

their own payroll. Due to manual process, it turn it to delays

of the salary distribution. This is a big problem to manage

when salary is not generated in time.

The monitoring process of information of the employees was

writing the ID number in their record list so that they can

easily find the specific record that they looking for. The

employee’s information such as name, address, birthdate,

position and others are put in the record. Recording

information of the employees was manually do by the

administrator.

24
San Carlos Computer World Payroll System
Perpetual Help College of Pangasinan
Malasiqui, Pangasinan

The Proposed System

The proposed system is design to provide a systematic

system for the payroll of the employees. The system will

provide a form that will calculates the amount that the

employer owes to his employees. The form allows admin to add

the information that will be stored to a database. The system

involves everything that has to do with the payment of

employees and filing of employment taxes, SSS, Pag-Ibig, Phil

Health contribution. This includes keeping track of hours,

calculating wages, withholding taxes and other deductions.

25
San Carlos Computer World Payroll System
Perpetual Help College of Pangasinan
Malasiqui, Pangasinan

Chapter IV

SUMMARY, CONCLUSION AND RECOMMENDATIONS

Summary

Payroll consists of the process by which a business pays

its employees for work performed during a specific period. A

payroll system may be manual or computerized and handled in-

house or outsourced to another provider. The payroll process

typically includes calculating employee salary, recording

payroll transactions and determining and paying payroll

taxes.

The San Carlos Computer World has no computerized

payroll system. The staff of Computer World is using forms to

record the information and payroll of the employee. This study

intended to develop a computerized payroll system that can be

reliable to the staff. Methodology saves time, increases

productivity, and improves the quality of service.

Methodologist serves as the data analysis that you can consult

in times of system problems.

26
San Carlos Computer World Payroll System
Perpetual Help College of Pangasinan
Malasiqui, Pangasinan

Summary of Findings

The San Carlos Computer World still use the manual way

of using paper to list down the payroll of the employees. It

take so much of time to compute salary of all employees. It

also takes a lot of time to make pay slip ready. Due to manual

process, it turn it to delays of the salary distribution.

This is a big problem to manage when salary is not generated

in time.

The computerized payroll system will save a lot of time

in computing salary, and easy to use. The system will provide

a form that will calculates the amount that the employer owes

to his employees. There are many kinds of payroll system

software, different features, functions and elements but the

cost is very high according to their software system features.

Conclusion

Therefore the researcher conclude that the computerized

payroll system for San Carlos Computer World has been designed

to achieve maximum efficiency and reduce the time taken to

handle the payroll of the employees. It is designed to replace

an existing manual record system thereby reducing time taken

for calculations and for storing data.

27
San Carlos Computer World Payroll System
Perpetual Help College of Pangasinan
Malasiqui, Pangasinan

The system is strong enough to withstand regressive

daily operations under conditions where the database is

maintained and cleared over a certain time. The

implementation of the system in the San Carlos Computer World

will considerably reduce data entry, time and also provide

readily calculated reports.

Recommendations

Based on the findings and conclusion presented, the

researchers believe that the computerized payroll system of

San Carlos Computer World generates fast and efficient

operations and services. Therefore, the researchers recommend

the following necessary consideration for the proper

implementation of the system. The manual system must be

converted to computerized system. System must be implemented

to solve the problem encountered in their manual process.

28
San Carlos Computer World Payroll System
Perpetual Help College of Pangasinan
Malasiqui, Pangasinan

To be able to use or install the system, they must be

follow/reach the minimum requirements of higher.

Software and Hardware Requirements

Hardware Requirements

System Unit

Minimum of 80 GB HDD space

Pentium based processor

512 MB of RAM or higher

Monitor

Keyboard

Mouse

Printer

Power Supply

Software Requirements

Operating System (Windows XP, Windows 7, Windows 10)

Visual Basic 6.0

Microsoft Access 2013 or higher

Microsoft Word

29
San Carlos Computer World Payroll System
Perpetual Help College of Pangasinan
Malasiqui, Pangasinan

Appendices

References

Online Resources

 https://www.adp.ph/campaigns/payroll-

outsourcing/?gclid=CjwKCAjw7MzkBRAGEiwAkOXexL-

Cc6YorTzE7ayluRx0rR0lWd5s53Q7Y9rmWj_6UqTd4Aneeo9KtBoCH

FsQAvD_BwE

 https://www.slideshare.net/acelcarl23/thesis-about-

computerized-payroll-system-for-barangay-hall-dita

 https://www.scribd.com/doc/26941747/Chapter-i-

Introduction-1-1-Background-of-The

 https://www.studymode.com/subjects/background-of-

study-for-payroll-system-page1.html

 https://www.academia.edu/13793760/Chapter_2_Related_Li

terature_and_Studies_2.1_Foreign_Literature_2.1.1_Reco

rds_Management

 https://studylib.net/doc/10194609/payroll-system---

bestlink-college-of-the-philippines

 https://www.papercamp.com/group/local-studies-about-

payroll-system/page-0

 https://www.bartleby.com/essay/Payroll-System-Related-

Studies-P348929KRYZA

30
San Carlos Computer World Payroll System
Perpetual Help College of Pangasinan
Malasiqui, Pangasinan

Book Resources

 Copernicus P.Pepito (2011) Introduction To Visual

Basic 2000 Programming (Series 2). National Book Store

 Wayne S. Freeze (2005) Visual Basic 6 Complete.

National Book Store

 System Analysis and Design (Revised Edition by James


Smith)
 How to Make A Methodology? (1st Edition) Allan Paul

31
San Carlos Computer World Payroll System
Perpetual Help College of Pangasinan
Malasiqui, Pangasinan

Data Flow Diagram

Data Flow Diagram 1

Figure 2. Data Flow Diagram 1

32
San Carlos Computer World Payroll System
Perpetual Help College of Pangasinan
Malasiqui, Pangasinan

Data Flow Diagram 2

Figure 3. Data Flow Diagram 2

33
San Carlos Computer World Payroll System
Perpetual Help College of Pangasinan
Malasiqui, Pangasinan

Screen Shots of the System

Figure 4. Log in Form allows the user to enter their


username and password to determine if the user authorize or
not.

Dim rs As New ADODB.Recordset


Dim passattemp As Integer
Private Sub cmdCancel_Click ()
End
End Sub
Private Sub cmdLogin_Click ()
On Error GoTo err
If txtUsername.Text = "" Then txtUsername.SetFocus: Exit
Sub
If txtPassword.Text = "" Then txtPassword.SetFocus: Exit
Sub
With rs
Dim strSql As String
strSql = "Select * from tblUser Where
USER_NAME='" & txtUsername.Text & "'"
.Open strSql, cn, adOpenStatic,
adLockOptimistic

34
San Carlos Computer World Payroll System
Perpetual Help College of Pangasinan
Malasiqui, Pangasinan

If .RecordCount >= 1 Then


If .Fields ("Password") = txtPassword.Text
Then
currentemmsuser =
cWords(Me.txtUsername.Text)
With frm_Main
.StatusBar.Panels(2).Text =
currentemmsuser
End With
Unload Me
frmSplash.Show
Else
passattemp = passattemp + 1
If passattemp = 3 Then
MsgBox "You are not an authorized
user", vbInformation + vbCritical, "Log In Error"
End
Else
MsgBox "Password incorrect. Please
check the CAPS LOCK" & vbCrLf & " Attempt left " & 3 -
passattemp & "", vbExclamation, "Log In Error"
txtPassword.Text = ""
txtPassword.SetFocus
End If
End If
Else
MsgBox "This user does not exist",
vbCritical, "Log In Error"
txtUsername.Text = ""
txtUsername.SetFocus
End If

35
San Carlos Computer World Payroll System
Perpetual Help College of Pangasinan
Malasiqui, Pangasinan

.Close
End With
Set rs = Nothing
Exit Sub
err:
MsgBox err.Description, vbCritical
End Sub

Figure 5.Splash Form starts to appear when you start the


system.

Option Explicit

Private Sub Form_Load()

Shape1.Width = 0

Timer1.Enabled = True

End Sub

Private Sub Timer1_Timer()

Timer1.Interval = Rnd * 70

Shape1.Width = Shape1.Width + 80

36
San Carlos Computer World Payroll System
Perpetual Help College of Pangasinan
Malasiqui, Pangasinan

Select Case Shape1.Width

Case 0 To 1300

Label1.Caption = "Initializing Application. . ."

Case 1301 To 3000

Label1.Caption = "Checking Database. . ."

Case 3001 To 5000

Label1.Caption = "Connecting Database. . ."

Case 5001 To 6900

Label1.Caption = "Loading Forms. . ."

Case 6901 To 7000

Label1.Caption = "Finishing. . ."

End Select

If Shape1.Width = Shape2.Width Then

Timer1.Enabled = False

frm_Main.Show

Unload Me

End If

End Sub

37
San Carlos Computer World Payroll System
Perpetual Help College of Pangasinan
Malasiqui, Pangasinan

Figure 6. Main Form will appear when the user finish to


log-in.

Dim xLogOff As Boolean

Private Sub MDIForm_Load()

xLogOff = False

End Sub

Private Sub MDIForm_Unload(Cancel As Integer)

Dim strMess

If xLogOff = False Then

strMess = "You are about to close the Payroll System."


& vbCrLf & vbCrLf & "Are you sure?"

If MsgBox(strMess, vbQuestion + vbYesNo, "Exit


Confirmation") = vbYes Then

38
San Carlos Computer World Payroll System
Perpetual Help College of Pangasinan
Malasiqui, Pangasinan

End

Else

Cancel = 1

End If

ElseIf xLogOff = True Then

frmLogin.Show

Unload Me

End If

End Sub

Private Sub mnuAbout_Click()

frm_About.Show 1

End Sub

Private Sub mnuBackup_Click()

frm_Backup.Show 1

End Sub

Private Sub mnuCPayroll_Click()

frm_Payroll.Show 1

End Sub

Private Sub mnuEmpDTR_Click()

frm_Payroll_dtr.Show 1

End Sub

Private Sub mnuEmpInfo_Click()

frm_emp_Info.Show 1

End Sub

39
San Carlos Computer World Payroll System
Perpetual Help College of Pangasinan
Malasiqui, Pangasinan

Private Sub mnuExit_Click()

Unload Me

End Sub

Private Sub mnuLogOut_Click()

xLogOff = True

Unload Me

End Sub

Private Sub mnuNewEmp_Click()

frm_New_emp.Show 1

End Sub

Private Sub mnuPayslip_Click()

frm_Payslip.Show 1

End Sub

Private Sub mnuRestore_Click()

frmRestore.Show 1

End Sub

Private Sub mnuUserLogin_Click()

frm_Sys_Users.Show 1

End Sub

40
San Carlos Computer World Payroll System
Perpetual Help College of Pangasinan
Malasiqui, Pangasinan

Figure 7. Employee Registration form allows the admin to


fill-up the information of the employee.

Private cbo_empstat As New CAutoCompleteComboBox

Private cbo_gender As New CAutoCompleteComboBox

Private cbo_stat As New CAutoCompleteComboBox

Dim rs As New ADODB.Recordset

Private Sub cboEmpStat_KeyPress(KeyAscii As Integer)

Select Case KeyAscii

Case vbKeyReturn

SendKeys vbTab

End Select

End Sub

Private Sub cboGender_KeyPress(KeyAscii As Integer)

41
San Carlos Computer World Payroll System
Perpetual Help College of Pangasinan
Malasiqui, Pangasinan

Select Case KeyAscii

Case vbKeyReturn

SendKeys vbTab

End Select

End Sub

Private Sub cboStat_KeyPress(KeyAscii As Integer)

Select Case KeyAscii

Case vbKeyReturn

SendKeys vbTab

End Select

End Sub

Private Sub cmdAdd_Click()

InitData

sEnable

cmdAdd.Enabled = False

cmdCancel.Enabled = True

cmdSave.Enabled = True

cmdBrowse.Enabled = True

End Sub

Private Sub cmdBrowse_Click()

Photo.OpenPhotoFile

End Sub

Private Sub cmdCancel_Click()

sDisable

cmdSave.Enabled = False

42
San Carlos Computer World Payroll System
Perpetual Help College of Pangasinan
Malasiqui, Pangasinan

cmdCancel.Enabled = False

cmdBrowse.Enabled = False

cmdAdd.Enabled = True

cmdAdd.SetFocus

End Sub

Private Sub cmdClose_Click()

Unload Me

End Sub

Private Sub sEnable()

Me.txtFName.BackColor = vbWhite

Me.txtFName.Locked = False

Me.txtFName.Text = ""

Me.txtLName.BackColor = vbWhite

Me.txtLName.Locked = False

Me.txtLName.Text = ""

Me.txtMI.BackColor = vbWhite

Me.txtMI.Locked = False

Me.txtMI.Text = ""

Me.txtAddress.BackColor = vbWhite

Me.txtAddress.Locked = False

Me.txtAddress.Text = ""

43
San Carlos Computer World Payroll System
Perpetual Help College of Pangasinan
Malasiqui, Pangasinan

Me.txtSpouseName.BackColor = vbWhite

Me.txtSpouseName.Locked = False

Me.txtSpouseName.Text = ""

Me.txtContactNo.BackColor = vbWhite

Me.txtContactNo.Locked = False

Me.txtContactNo.Text = ""

Me.txtEmailAd.BackColor = vbWhite

Me.txtEmailAd.Locked = False

Me.txtEmailAd.Text = ""

Me.txtEducBack.BackColor = vbWhite

Me.txtEducBack.Locked = False

Me.txtEducBack.Text = ""

Me.txtSSSNo.BackColor = vbWhite

Me.txtSSSNo.Locked = False

Me.txtSSSNo.Text = ""

Me.txtPhilHealthNo.BackColor = vbWhite

Me.txtPhilHealthNo.Locked = False

Me.txtPhilHealthNo.Text = ""

Me.txtPagIbigNo.BackColor = vbWhite

44
San Carlos Computer World Payroll System
Perpetual Help College of Pangasinan
Malasiqui, Pangasinan

Me.txtPagIbigNo.Locked = False

Me.txtPagIbigNo.Text = ""

Me.txtBasicRate.BackColor = vbWhite

Me.txtBasicRate.Locked = False

Me.txtBasicRate.Text = "0.00"

Me.txtDept.BackColor = vbWhite

Me.txtDept.Locked = False

Me.txtDept.Text = ""

Me.txtPosition.BackColor = vbWhite

Me.txtPosition.Locked = False

Me.txtPosition.Text = ""

Me.cboEmpStat.BackColor = vbWhite

Me.cboEmpStat.Locked = False

Me.cboEmpStat.Text = ""

Me.cboGender.BackColor = vbWhite

Me.cboGender.Locked = False

Me.cboGender.Text = ""

Me.cboStat.BackColor = vbWhite

Me.cboStat.Locked = False

Me.cboStat.Text = ""

45
San Carlos Computer World Payroll System
Perpetual Help College of Pangasinan
Malasiqui, Pangasinan

Me.txtFName.SetFocus

End Sub

Private Sub sDisable()

Me.txtFName.BackColor = &H8000000B

Me.txtFName.Locked = True

Me.txtLName.BackColor = &H8000000B

Me.txtLName.Locked = True

Me.txtMI.BackColor = &H8000000B

Me.txtMI.Locked = True

Me.txtAddress.BackColor = &H8000000B

Me.txtAddress.Locked = True

Me.txtSpouseName.BackColor = &H8000000B

Me.txtSpouseName.Locked = True

Me.txtContactNo.BackColor = &H8000000B

Me.txtContactNo.Locked = True

Me.txtEmailAd.BackColor = &H8000000B

Me.txtEmailAd.Locked = True

Me.txtEducBack.BackColor = &H8000000B

Me.txtEducBack.Locked = True

Me.txtSSSNo.BackColor = &H8000000B

Me.txtSSSNo.Locked = True

Me.txtPhilHealthNo.BackColor = &H8000000B

Me.txtPhilHealthNo.Locked = True

Me.txtPagIbigNo.BackColor = &H8000000B

Me.txtPagIbigNo.Locked = True

46
San Carlos Computer World Payroll System
Perpetual Help College of Pangasinan
Malasiqui, Pangasinan

Me.txtBasicRate.BackColor = &H8000000B

Me.txtBasicRate.Locked = True

Me.txtDept.BackColor = &H8000000B

Me.txtDept.Locked = True

Me.txtPosition.BackColor = &H8000000B

Me.txtPosition.Locked = True

Me.cboEmpStat.BackColor = &H8000000B

Me.cboEmpStat.Locked = True

Me.cboGender.BackColor = &H8000000B

Me.cboGender.Locked = True

Me.cboStat.BackColor = &H8000000B

Me.cboStat.Locked = True

Me.txtFName.SetFocus

End Sub

Private Sub cmdSave_Click()

On Error GoTo err:

If rs.State = adStateOpen Then rs.Close

rs.Open "Select * from tblEmp", cn, adOpenKeyset,


adLockPessimistic

If Me.txtFName.Text = "" Then MsgBox "Please enter


First Name.", vbInformation, "Information":
Me.txtFName.SetFocus: Exit Sub

If Me.txtMI.Text = "" Then MsgBox "Please enter Middle


Initial.", vbInformation, "Information": Me.txtMI.SetFocus:
Exit Sub

47
San Carlos Computer World Payroll System
Perpetual Help College of Pangasinan
Malasiqui, Pangasinan

If Me.txtLName.Text = "" Then MsgBox "Please enter Last


Name.", vbInformation, "Information": Me.txtLName.SetFocus:
Exit Sub

If Me.cboGender.Text = "" Then MsgBox "Please Select


Gender.", vbInformation, "Information":
Me.cboGender.SetFocus: Exit Sub

If Me.cboStat.Text = "" Then MsgBox "Please Select


Status.", vbInformation, "Information":
Me.cboStat.SetFocus: Exit Sub

If Me.txtAddress.Text = "" Then MsgBox "Please enter


Employee's Address.", vbInformation, "Information":
Me.txtAddress.SetFocus: Exit Sub

If Me.txtSpouseName.Text = "" Then MsgBox "Please enter


Employee's Spouse Name.", vbInformation, "Information":
Me.txtSpouseName.SetFocus: Exit Sub

If Me.txtContactNo.Text = "" Then MsgBox "Please enter


Employee's Contact No.", vbInformation, "Information":
Me.txtContactNo.SetFocus: Exit Sub

If Me.txtEmailAd.Text = "" Then MsgBox "Please enter


Employee's Email Ad.", vbInformation, "Information":
Me.txtEmailAd.SetFocus: Exit Sub

If Me.txtEducBack.Text = "" Then MsgBox "Please enter


Employee's Educational Background.", vbInformation,
"Information": Me.txtEducBack.SetFocus: Exit Sub

If Me.txtSSSNo.Text = "" Then MsgBox "Please enter


Employee's SSS No.", vbInformation, "Information":
Me.txtSSSNo.SetFocus: Exit Sub

If Me.txtPhilHealthNo.Text = "" Then MsgBox "Please


enter Employee's PhilHealth No.", vbInformation,
"Information": Me.txtPhilHealthNo.SetFocus: Exit Sub

If Me.txtPagIbigNo.Text = "" Then MsgBox "Please enter


Employee's PagIbig No.", vbInformation, "Information":
Me.txtPagIbigNo.SetFocus: Exit Sub

48
San Carlos Computer World Payroll System
Perpetual Help College of Pangasinan
Malasiqui, Pangasinan

If Me.txtDept.Text = "" Then MsgBox "Please enter


Department.", vbInformation, "Information":
Me.txtDept.SetFocus: Exit Sub

If Me.txtPosition.Text = "" Then MsgBox "Please enter


Employee's Position.", vbInformation, "Information":
Me.txtPosition.SetFocus: Exit Sub

If Me.cboEmpStat.Text = "" Then MsgBox "Please Select


Employee's Status.", vbInformation, "Information":
Me.cboEmpStat.SetFocus: Exit Sub

If Me.txtBasicRate.Text = "" Then MsgBox "Please enter


Employee's Basic Salary Rate.", vbInformation,
"Information": Me.txtBasicRate.SetFocus: Exit Sub

With rs

.AddNew

.Fields("EM_ID").Value = Me.txtIDNo.Text

.Fields("NAME").Value = Me.txtFName.Text & " " &


Me.txtMI.Text & ". " & Me.txtLName.Text

.Fields("Gender").Value = Me.cboGender.Text

.Fields("Status").Value = Me.cboStat.Text

.Fields("Address").Value = Me.txtAddress.Text

.Fields("Date of Birth").Value =
Me.dtpDateofBirth.Value

.Fields("Spouse Name").Value =
Me.txtSpouseName.Text

.Fields("Contact Number").Value =
Me.txtContactNo.Text

.Fields("Email Address").Value = Me.txtEmailAd.Text

.Fields("Educational Background").Value =
Me.txtEducBack.Text

.Fields("SSS Number").Value = Me.txtSSSNo.Text

49
San Carlos Computer World Payroll System
Perpetual Help College of Pangasinan
Malasiqui, Pangasinan

.Fields("PhilHealth Number").Value =
Me.txtPhilHealthNo.Text

.Fields("Pag-Ibig Number").Value =
Me.txtPagIbigNo.Text

.Fields("DEPT").Value = Me.txtDept.Text

.Fields("POSITION").Value = Me.txtPosition.Text

.Fields("Emp_Stat").Value = Me.cboEmpStat.Text

.Fields("Basic_Rate").Value = Me.txtBasicRate.Text

.Fields("Date_Employed").Value = Me.dtpHired.Value

Me.Photo.SavePhoto .Fields("emp_Photo")

.Update

End With

sDisable

cmdSave.Enabled = False

cmdCancel.Enabled = False

cmdBrowse.Enabled = False

cmdAdd.Enabled = True

cmdAdd.SetFocus

MsgBox "Data entry successfully save.", vbInformation

Exit Sub

err:

MsgBox err.Description, vbCritical, "Error"

Set rs = Nothing

End Sub

Private Sub dtpDateofBirth_KeyPress(KeyAscii As Integer)

Select Case KeyAscii

50
San Carlos Computer World Payroll System
Perpetual Help College of Pangasinan
Malasiqui, Pangasinan

Case vbKeyReturn

SendKeys vbTab

End Select

End Sub

Private Sub dtpHired_KeyPress(KeyAscii As Integer)

Select Case KeyAscii

Case vbKeyReturn

SendKeys vbTab

End Select

End Sub

Private Sub Form_Load()

cbo_stat.Init Me.cboStat

cbo_empstat.Init Me.cboEmpStat

cbo_gender.Init Me.cboGender

End Sub

Public Sub InitData()

On Error GoTo err:

If rs.State = adStateOpen Then rs.Close

rs.Open "Select * from tblEmp", cn, adOpenKeyset,


adLockPessimistic

If rs.EOF = False Then

rs.MoveLast

Me.txtIDNo.Text = CDbl(rs.Fields("EM_ID").Value) +
1

Else

51
San Carlos Computer World Payroll System
Perpetual Help College of Pangasinan
Malasiqui, Pangasinan

Me.txtIDNo.Text = 111110

End If

Exit Sub

err:

MsgBox err.Description, vbCritical, "Error"

Set rs = Nothing

End Sub

Private Sub Picture2_Click()

End Sub

Private Sub Text8__KeyPress(KeyAscii As Integer)

Select Case KeyAscii

Case vbKeyReturn

SendKeys vbTab

End Select

End Sub

Private Sub Text8_Change()

End Sub

Private Sub Text4_KeyPress(KeyAscii As Integer)

Select Case KeyAscii

Case vbKeyReturn

SendKeys vbTab

End Select

End Sub

Private Sub txtAddress_KeyPress(KeyAscii As Integer)

Select Case KeyAscii

52
San Carlos Computer World Payroll System
Perpetual Help College of Pangasinan
Malasiqui, Pangasinan

Case vbKeyReturn

SendKeys vbTab

End Select

End Sub

Private Sub txtBasicRate_GotFocus()

hl_Text txtBasicRate

End Sub

Private Sub txtBasicRate_KeyPress(KeyAscii As Integer)

Select Case KeyAscii

Case vbKeyBack

Case vbKeyDelete

Case vbKeyReturn

SendKeys vbTab

Case 48 To 57

Case Else

KeyAscii = 0

End Select

End Sub

Private Sub txtBasicRate_LostFocus()

If Me.txtBasicRate.Text = vbNullString Then


Me.txtBasicRate.Text = FormatNumber(0, 2)

Me.txtBasicRate.Text = FormatNumber(Me.txtBasicRate.Text,
2)

End Sub

Private Sub txtContactNo_GotFocus()

hl_Text txtContactNo

53
San Carlos Computer World Payroll System
Perpetual Help College of Pangasinan
Malasiqui, Pangasinan

End Sub

Private Sub txtContactNo_KeyPress(KeyAscii As Integer)

If (KeyAscii >= vbKey0 And KeyAscii <= vbKey9) Or KeyAscii


= vbKeyBack Then

Else

KeyAscii = 0

End If

Select Case KeyAscii

Case vbKeyReturn

SendKeys vbTab

End Select

End Sub

Private Sub txtDept_KeyPress(KeyAscii As Integer)

Select Case KeyAscii

Case vbKeyReturn

SendKeys vbTab

End Select

End Sub

Private Sub txtEducBack_KeyPress(KeyAscii As Integer)

Select Case KeyAscii

Case vbKeyReturn

SendKeys vbTab

End Select

End Sub

54
San Carlos Computer World Payroll System
Perpetual Help College of Pangasinan
Malasiqui, Pangasinan

Private Sub txtEmailAd_KeyPress(KeyAscii As Integer)

Select Case KeyAscii

Case vbKeyReturn

SendKeys vbTab

End Select

End Sub

Private Sub txtFName_KeyPress(KeyAscii As Integer)

Select Case KeyAscii

Case vbKeyReturn

SendKeys vbTab

End Select

End Sub

Private Sub txtLName_KeyPress(KeyAscii As Integer)

Select Case KeyAscii

Case vbKeyReturn

SendKeys vbTab

End Select

End Sub

Private Sub txtMI_KeyPress(KeyAscii As Integer)

Select Case KeyAscii

Case vbKeyReturn

SendKeys vbTab

End Select

End Sub

55
San Carlos Computer World Payroll System
Perpetual Help College of Pangasinan
Malasiqui, Pangasinan

Private Sub txtPagIbigNo_GotFocus()

hl_Text txtPagIbigNo

End Sub

Private Sub txtPagIbigNo_KeyPress(KeyAscii As Integer)

If (KeyAscii >= vbKey0 And KeyAscii <= vbKey9) Or KeyAscii


= vbKeyBack Then

Else

KeyAscii = 0

End If

Select Case KeyAscii

Case vbKeyReturn

SendKeys vbTab

End Select

End Sub

Private Sub txtPhilHealthNo_GotFocus()

hl_Text txtPhilHealthNo

End Sub

Private Sub txtPhilHealthNo_KeyPress(KeyAscii As Integer)

If (KeyAscii >= vbKey0 And KeyAscii <= vbKey9) Or KeyAscii


= vbKeyBack Then

Else

KeyAscii = 0

End If

Select Case KeyAscii

Case vbKeyReturn

56
San Carlos Computer World Payroll System
Perpetual Help College of Pangasinan
Malasiqui, Pangasinan

SendKeys vbTab

End Select

End Sub

Private Sub txtPosition_KeyPress(KeyAscii As Integer)

Select Case KeyAscii

Case vbKeyReturn

SendKeys vbTab

End Select

End Sub

Private Sub txtSpouseName_KeyPress(KeyAscii As Integer)

Select Case KeyAscii

Case vbKeyReturn

SendKeys vbTab

End Select

End Sub

Private Sub txtSSSNo_GotFocus()

hl_Text txtSSSNo

End Sub

Private Sub txtSSSNo_KeyPress(KeyAscii As Integer)

If (KeyAscii >= vbKey0 And KeyAscii <= vbKey9) Or KeyAscii


= vbKeyBack Then

Else

KeyAscii = 0

End If

Select Case KeyAscii

57
San Carlos Computer World Payroll System
Perpetual Help College of Pangasinan
Malasiqui, Pangasinan

Case vbKeyReturn

SendKeys vbTab

End Select

End Sub

Figure 8. Create Payroll form allows the admin to create


the payroll of the employee.

Dim cbo_id As New CAutoCompleteComboBox

Dim rs As New ADODB.Recordset

Private Sub cboEmpID_Change()

58
San Carlos Computer World Payroll System
Perpetual Help College of Pangasinan
Malasiqui, Pangasinan

On Error GoTo err:

If Me.cboEmpID.Text = vbNullString Then Exit Sub

If rs.State = adStateOpen Then rs.Close

rs.Open "Select * from tblEmp where EM_ID = " &


Me.cboEmpID.Text & ";", cn, adOpenKeyset, adLockPessimistic

Do While rs.EOF = False

Me.lblName.Caption = " " & rs.Fields("NAME").Value

Me.lblDept.Caption = " " & rs.Fields("DEPT").Value

Me.lblPosition.Caption = " " &


rs.Fields("POSITION").Value

Me.lblRate.Caption =
FormatNumber(CCur(rs.Fields("Basic_Rate").Value), 2)

Me.lblStatus.Caption = " " &


rs.Fields("Emp_Stat").Value

Me.lblPerDay.Caption =
FormatNumber(CCur(Me.lblRate.Caption / 30), 2)

Me.lblNetPay.Caption =
FormatNumber(CCur(Me.lblRate.Caption), 2)

rs.MoveNext

Loop

Exit Sub

err:

MsgBox err.Description, vbCritical, "Error"

Set rs = Nothing

End Sub

Private Sub cboEmpID_KeyPress(KeyAscii As Integer)

Select Case KeyAscii

59
San Carlos Computer World Payroll System
Perpetual Help College of Pangasinan
Malasiqui, Pangasinan

Case vbKeyReturn

cboEmpID_Change

If Me.lblName.Caption = " " Or Me.lblName.Caption =


"" Then MsgBox "Invalid Employee ID Number. Please try
again", vbInformation, "Information": Exit Sub

SendKeys vbTab

End Select

End Sub

Private Sub cmdCosePic_Click()

Unload Me

End Sub

Private Sub cmdPrintPayslip_Click()

frm_Payslip.Show 1

End Sub

Private Sub cmdSave_Click()

Dim strMess

On Error GoTo err:

strMess = "Saving this data will not allow you to re-


edit this transaction." & vbCrLf & vbCrLf & "Are you sure
you want to save this now?"

If MsgBox(strMess, vbQuestion + vbYesNo) = vbYes Then

If rs.State = adStateOpen Then rs.Close

rs.Open "Select * from tblPayroll", cn,


adOpenKeyset, adLockPessimistic

With rs

.AddNew

60
San Carlos Computer World Payroll System
Perpetual Help College of Pangasinan
Malasiqui, Pangasinan

.Fields("EM_ID").Value = Me.cboEmpID.Text

.Fields("EM_Name").Value = Me.lblName.Caption

.Fields("Monthly_Rate").Value =
Me.lblRate.Caption

.Fields("dDate").Value = Me.DTPicker1.Value

.Fields("SSS").Value = Me.txtsss.Text

.Fields("SSS Loan").Value = Me.txtSSSL.Text

.Fields("PhilHealth Loan").Value =
Me.txtSSSL.Text

.Fields("Pag-Ibig Loan").Value = Me.txtPIL.Text

.Fields("xBonus").Value = Me.txtBonus.Text

.Fields("xOT").Value = Me.txtOverTime.Text

.Fields("PH").Value = Me.txtph.Text

.Fields("InTax").Value = Me.txttax.Text

.Fields("PagIbig").Value = Me.txtPagIbig.Text

.Fields("absences").Value = Me.txtAbsences.Text

.Fields("Advances").Value = Me.txtAdvances.Text

.Fields("TAD").Value = Me.lbltemp.Caption

.Fields("TD").Value = Me.lblDeduct.Caption

.Fields("NetPay").Value = Me.lblNetPay.Caption

.Update

MsgBox "Data successfully save.",


vbInformation, "Information"

End With

Init_Display_Data

sText

61
San Carlos Computer World Payroll System
Perpetual Help College of Pangasinan
Malasiqui, Pangasinan

Me.cboEmpID.SetFocus

End If

Exit Sub

err:

MsgBox err.Description, vbCritical, "Error"

Set rs = Nothing

End Sub

Private Sub DTPicker1_Change()

DTPicker1_Click

End Sub

Private Sub DTPicker1_Click()

Me.txtMonth.Text = MonthName(Month(Me.DTPicker1.Value))

Me.txtYear.Text = Year(Me.DTPicker1.Value)

Init_Display_Data

End Sub

Private Sub Form_Load()

DTPicker1.Value = Now

DTPicker1_Click

cbo_id.Init cboEmpID

init_ID_Data

Init_Display_Data

End Sub

Private Sub init_ID_Data()

On Error GoTo err:

62
San Carlos Computer World Payroll System
Perpetual Help College of Pangasinan
Malasiqui, Pangasinan

If rs.State = adStateOpen Then rs.Close

rs.Open "Select * from tblEmp", cn, adOpenKeyset,


adLockPessimistic

Do While rs.EOF = False

cboEmpID.AddItem rs.Fields("EM_ID").Value

rs.MoveNext

Loop

Exit Sub

err:

MsgBox err.Description, vbCritical, "Error"

Set rs = Nothing

End Sub

Private Sub lblDeduct_Change()

If Me.lblDeduct.Caption = vbNullString Then

Me.lblDeduct.Caption = FormatNumber(0, 2)

End If

On Error GoTo err

Me.lblNetPay.Caption =
FormatNumber(CCur(Me.lblRate.Caption) +
CCur(Me.lbltemp.Caption) - CCur(Me.lblDeduct.Caption), 2)

Exit Sub

err:

Me.lblDeduct.Caption = FormatNumber(0, 2)

End Sub

Private Sub lblRate_Change()

If Me.lblRate.Caption = vbNullString Then

63
San Carlos Computer World Payroll System
Perpetual Help College of Pangasinan
Malasiqui, Pangasinan

Me.lblRate.Caption = FormatNumber(0, 2)

End If

End Sub

Private Sub lbltemp_Change()

If Me.lbltemp.Caption = vbNullString Then

Me.lbltemp.Caption = FormatNumber(0, 2)

End If

On Error GoTo err:

Me.lblNetPay.Caption =
FormatNumber(CCur(Me.lblRate.Caption) +
CCur(Me.lbltemp.Caption) - CCur(Me.lblDeduct.Caption), 2)

Exit Sub

err:

Me.lbltemp.Caption = FormatNumber(0, 2)

End Sub

Private Sub txtAbsences_Change()

If Me.txtAbsences.Text = vbNullString Then

Me.txtAbsences.Text = FormatNumber(0, 2)

End If

On Error GoTo err

Me.lblDeduct.Caption =
FormatNumber(CCur(Me.txtAdvances.Text) +
CCur(Me.txtAbsences.Text) _

+ CCur(Me.txtsss.Text) + CCur(Me.txtSSSL.Text) +
CCur(Me.txtPHL.Text) + CCur(Me.txtPIL.Text) +
CCur(Me.txttax.Text) + CCur(Me.txtph.Text) +
CCur(Me.txtPagIbig.Text), 2)

64
San Carlos Computer World Payroll System
Perpetual Help College of Pangasinan
Malasiqui, Pangasinan

'Me.lblNetPay = FormatNumber(CCur(Me.lblRate) -
(CCur(Me.lblDeduct.Caption)), 2)

Exit Sub

err:

Me.txtAbsences.Text = FormatNumber(0, 2)

End Sub

Private Sub txtAdvances_Change()

If Me.txtAdvances.Text = vbNullString Then

Me.txtAdvances.Text = FormatNumber(0, 2)

End If

On Error GoTo err:

Me.lblDeduct.Caption =
FormatNumber(CCur(Me.txtAdvances.Text) +
CCur(Me.txtAbsences.Text) _

+ CCur(Me.txtsss.Text) + CCur(Me.txtSSSL.Text) +
CCur(Me.txtPHL.Text) + CCur(Me.txtPIL.Text) +
CCur(Me.txttax.Text) + CCur(Me.txtph.Text) +
CCur(Me.txtPagIbig.Text), 2)

Exit Sub

err:

Me.txtAdvances.Text = FormatNumber(0, 2)

End Sub

Private Sub txtAdvances_GotFocus()

hl_Text txtAdvances

End Sub

Private Sub txtAdvances_KeyPress(KeyAscii As Integer)

Select Case KeyAscii

65
San Carlos Computer World Payroll System
Perpetual Help College of Pangasinan
Malasiqui, Pangasinan

Case vbKeyBack

Case vbKeyDelete

Case vbKeyReturn

txtAdvances_Change

SendKeys vbTab

Case 48 To 57

Case Else

KeyAscii = 0

End Select

End Sub

Private Sub txtAdvances_LostFocus()

On Error GoTo err:

Me.txtAdvances.Text = FormatNumber(Me.txtAdvances.Text,
2)

Exit Sub

err:

Me.txtAdvances.Text = FormatNumber(0, 2)

End Sub

Private Sub txtBonus_Change()

If Me.txtBonus.Text = vbNullString Then

Me.txtBonus.Text = FormatNumber(0, 2)

End If

On Error GoTo err:

Me.lbltemp.Caption =
FormatNumber(CCur(Me.txtBonus.Text) +
CCur(Me.txtOverTime.Text), 2)

66
San Carlos Computer World Payroll System
Perpetual Help College of Pangasinan
Malasiqui, Pangasinan

Exit Sub

err:

Me.txtBonus.Text = FormatNumber(0, 2)

End Sub

Private Sub txtBonus_GotFocus()

hl_Text txtBonus

End Sub

Private Sub txtBonus_KeyPress(KeyAscii As Integer)

Select Case KeyAscii

Case vbKeyBack

Case vbKeyDelete

Case vbKeyReturn

SendKeys vbTab

Case 48 To 57

Case Else

KeyAscii = 0

End Select

End Sub

Private Sub txtBonus_LostFocus()

On Error GoTo err:

Me.txtBonus.Text = FormatNumber(Me.txtBonus.Text, 2)

Exit Sub

err:

Me.txtBonus.Text = FormatNumber(0, 2)

End Sub

67
San Carlos Computer World Payroll System
Perpetual Help College of Pangasinan
Malasiqui, Pangasinan

Private Sub txtNumDays_Change()

If Me.txtNumDays.Text = vbNullString Then

Me.txtNumDays.Text = FormatNumber(0, 0)

End If

On Error GoTo err:

Me.txtAbsences.Text = Me.txtNumDays.Text *
Me.lblPerDay.Caption

Exit Sub

err:

Me.txtNumDays.Text = FormatNumber(0, 0)

End Sub

Private Sub txtNumDays_GotFocus()

hl_Text txtNumDays

End Sub

Private Sub txtNumDays_KeyPress(KeyAscii As Integer)

Select Case KeyAscii

Case vbKeyBack

Case vbKeyDelete

Case vbKeyReturn

SendKeys vbTab

Case 48 To 57

Case Else

KeyAscii = 0

End Select

End Sub

68
San Carlos Computer World Payroll System
Perpetual Help College of Pangasinan
Malasiqui, Pangasinan

Private Sub txtPagIbig_Change()

If Me.txtPagIbig.Text = vbNullString Then

Me.txtPagIbig.Text = FormatNumber(0, 2)

End If

On Error GoTo err:

Me.lblDeduct.Caption =
FormatNumber(CCur(Me.txtAdvances.Text) +
CCur(Me.txtAbsences.Text) _

+ CCur(Me.txtsss.Text) + CCur(Me.txtSSSL.Text) +
CCur(Me.txtPHL.Text) + CCur(Me.txtPIL.Text) +
CCur(Me.txttax.Text) + CCur(Me.txtph.Text) +
CCur(Me.txtPagIbig.Text), 2)

Exit Sub

err:

Me.txtPagIbig.Text = FormatNumber(0, 2)

End Sub

Private Sub txtPagIbig_GotFocus()

hl_Text txtPagIbig

End Sub

Private Sub txtPagIbig_KeyPress(KeyAscii As Integer)

Select Case KeyAscii

Case vbKeyBack

Case vbKeyDelete

Case vbKeyReturn

txtPagIbig_Change

SendKeys vbTab

Case 48 To 57

69
San Carlos Computer World Payroll System
Perpetual Help College of Pangasinan
Malasiqui, Pangasinan

Case Else

KeyAscii = 0

End Select

End Sub

Private Sub txtPagIbig_LostFocus()

On Error GoTo err:

Me.txtPagIbig.Text = FormatNumber(Me.txtPagIbig.Text,
2)

Exit Sub

err:

Me.txtPagIbig.Text = FormatNumber(0, 2)

End Sub

Private Sub txtOverTime_Change()

If Me.txtOverTime.Text = vbNullString Then

Me.txtOverTime.Text = FormatNumber(0, 2)

End If

On Error GoTo err:

Me.lbltemp.Caption =
FormatNumber(CCur(Me.txtBonus.Text) +
CCur(Me.txtOverTime.Text), 2)

Exit Sub

err:

Me.txtOverTime.Text = FormatNumber(0, 2)

End Sub

Private Sub txtOverTime_GotFocus()

hl_Text txtOverTime

70
San Carlos Computer World Payroll System
Perpetual Help College of Pangasinan
Malasiqui, Pangasinan

End Sub

Private Sub txtOverTime_KeyPress(KeyAscii As Integer)

Select Case KeyAscii

Case vbKeyBack

Case vbKeyDelete

Case vbKeyReturn

SendKeys vbTab

Case 48 To 57

Case Else

KeyAscii = 0

End Select

End Sub

Private Sub txtOverTime_LostFocus()

On Error GoTo err:

Me.txtOverTime.Text = FormatNumber(Me.txtOverTime.Text,
2)

Exit Sub

err:

Me.txtOverTime.Text = FormatNumber(0, 2)

End Sub

Private Sub txtph_Change()

If Me.txtph.Text = vbNullString Then

Me.txtph.Text = FormatNumber(0, 2)

End If

On Error GoTo err:

71
San Carlos Computer World Payroll System
Perpetual Help College of Pangasinan
Malasiqui, Pangasinan

Me.lblDeduct.Caption =
FormatNumber(CCur(Me.txtAdvances.Text) +
CCur(Me.txtAbsences.Text) _

+ CCur(Me.txtsss.Text) + CCur(Me.txtSSSL.Text) +
CCur(Me.txtPHL.Text) + CCur(Me.txtPIL.Text) +
CCur(Me.txttax.Text) + CCur(Me.txtph.Text) +
CCur(Me.txtPagIbig.Text), 2)

Exit Sub

err:

Me.txtph.Text = FormatNumber(0, 2)

End Sub

Private Sub txtph_GotFocus()

hl_Text txtph

End Sub

Private Sub txtph_KeyPress(KeyAscii As Integer)

Select Case KeyAscii

Case vbKeyBack

Case vbKeyDelete

Case vbKeyReturn

txtph_Change

SendKeys vbTab

Case 48 To 57

Case Else

KeyAscii = 0

End Select

End Sub

72
San Carlos Computer World Payroll System
Perpetual Help College of Pangasinan
Malasiqui, Pangasinan

Private Sub txtph_LostFocus()

On Error GoTo err:

Me.txtph.Text = FormatNumber(Me.txtph.Text, 2)

Exit Sub

err:

Me.txtph.Text = FormatNumber(0, 2)

End Sub

Private Sub txtPHL_Change()

If Me.txtsss.Text = vbNullString Then

Me.txtsss.Text = FormatNumber(0, 2)

End If

On Error GoTo err:

Me.lblDeduct.Caption =
FormatNumber(CCur(Me.txtAdvances.Text) +
CCur(Me.txtAbsences.Text) _

+ CCur(Me.txtsss.Text) + CCur(Me.txtSSSL.Text) +
CCur(Me.txtPHL.Text) + CCur(Me.txtPIL.Text) +
CCur(Me.txttax.Text) + CCur(Me.txtph.Text) +
CCur(Me.txtPagIbig.Text), 2)

Exit Sub

err:

Me.txtsss.Text = FormatNumber(0, 2)

End Sub

Private Sub txtPHL_GotFocus()

hl_Text txtPHL

End Sub

Private Sub txtPHL_KeyPress(KeyAscii As Integer)

73
San Carlos Computer World Payroll System
Perpetual Help College of Pangasinan
Malasiqui, Pangasinan

Select Case KeyAscii

Case vbKeyBack

Case vbKeyDelete

Case vbKeyReturn

txtsss_Change

SendKeys vbTab

Case 48 To 57

Case Else

KeyAscii = 0

End Select

End Sub

Private Sub txtPHL_LostFocus()

On Error GoTo err:

Me.txtPHL.Text = FormatNumber(Me.txtPHL.Text, 2)

Exit Sub

err:

Me.txtPHL.Text = FormatNumber(0, 2)

End Sub

Private Sub txtPIL_Change()

If Me.txtPIL.Text = vbNullString Then

Me.txtPIL.Text = FormatNumber(0, 2)

End If

On Error GoTo err:

Me.lblDeduct.Caption =
FormatNumber(CCur(Me.txtAdvances.Text) +
CCur(Me.txtAbsences.Text) _

74
San Carlos Computer World Payroll System
Perpetual Help College of Pangasinan
Malasiqui, Pangasinan

+ CCur(Me.txtsss.Text) + CCur(Me.txtSSSL.Text) +
CCur(Me.txtPHL.Text) + CCur(Me.txtPIL.Text) +
CCur(Me.txttax.Text) + CCur(Me.txtph.Text) +
CCur(Me.txtPagIbig.Text), 2)

Exit Sub

err:

Me.txtPIL.Text = FormatNumber(0, 2)

End Sub

Private Sub txtPIL_GotFocus()

hl_Text txtPIL

End Sub

Private Sub txtPIL_KeyPress(KeyAscii As Integer)

Select Case KeyAscii

Case vbKeyBack

Case vbKeyDelete

Case vbKeyReturn

txtsss_Change

SendKeys vbTab

Case 48 To 57

Case Else

KeyAscii = 0

End Select

End Sub

Private Sub txtPIL_LostFocus()

On Error GoTo err:

75
San Carlos Computer World Payroll System
Perpetual Help College of Pangasinan
Malasiqui, Pangasinan

Me.txtPIL.Text = FormatNumber(Me.txtPIL.Text, 2)

Exit Sub

err:

Me.txtPIL.Text = FormatNumber(0, 2)

End Sub

Private Sub txtsss_Change()

If Me.txtsss.Text = vbNullString Then

Me.txtsss.Text = FormatNumber(0, 2)

End If

On Error GoTo err:

Me.lblDeduct.Caption =
FormatNumber(CCur(Me.txtAdvances.Text) +
CCur(Me.txtAbsences.Text) _

+ CCur(Me.txtsss.Text) + CCur(Me.txtSSSL.Text) +
CCur(Me.txtPHL.Text) + CCur(Me.txtPIL.Text) +
CCur(Me.txttax.Text) + CCur(Me.txtph.Text) +
CCur(Me.txtPagIbig.Text), 2)

Exit Sub

err:

Me.txtsss.Text = FormatNumber(0, 2)

End Sub

Private Sub txtsss_GotFocus()

hl_Text txtsss

End Sub

Private Sub txtsss_KeyPress(KeyAscii As Integer)

Select Case KeyAscii

Case vbKeyBack

76
San Carlos Computer World Payroll System
Perpetual Help College of Pangasinan
Malasiqui, Pangasinan

Case vbKeyDelete

Case vbKeyReturn

txtsss_Change

SendKeys vbTab

Case 48 To 57

Case Else

KeyAscii = 0

End Select

End Sub

Private Sub txtsss_LostFocus()

On Error GoTo err:

Me.txtsss.Text = FormatNumber(Me.txtsss.Text, 2)

Exit Sub

err:

Me.txtsss.Text = FormatNumber(0, 2)

End Sub

Private Sub txtSSSL_Change()

If Me.txtSSSL.Text = vbNullString Then

Me.txtSSSL.Text = FormatNumber(0, 2)

End If

On Error GoTo err:

Me.lblDeduct.Caption =
FormatNumber(CCur(Me.txtAdvances.Text) +
CCur(Me.txtAbsences.Text) _

+ CCur(Me.txtsss.Text) + CCur(Me.txtSSSL.Text) +
CCur(Me.txtPHL.Text) + CCur(Me.txtPIL.Text) +

77
San Carlos Computer World Payroll System
Perpetual Help College of Pangasinan
Malasiqui, Pangasinan

CCur(Me.txttax.Text) + CCur(Me.txtph.Text) +
CCur(Me.txtPagIbig.Text), 2)

Exit Sub

err:

Me.txtSSSL.Text = FormatNumber(0, 2)

End Sub

Private Sub txtSSSL_GotFocus()

hl_Text txtSSSL

End Sub

Private Sub txtSSSL_KeyPress(KeyAscii As Integer)

Select Case KeyAscii

Case vbKeyBack

Case vbKeyDelete

Case vbKeyReturn

txtsss_Change

SendKeys vbTab

Case 48 To 57

Case Else

KeyAscii = 0

End Select

End Sub

Private Sub txtSSSL_LostFocus()

On Error GoTo err:

Me.txtSSSL.Text = FormatNumber(Me.txtSSSL.Text, 2)

78
San Carlos Computer World Payroll System
Perpetual Help College of Pangasinan
Malasiqui, Pangasinan

Exit Sub

err:

Me.txtSSSL.Text = FormatNumber(0, 2)

End Sub

Private Sub txttax_Change()

If Me.txttax.Text = vbNullString Then

Me.txttax.Text = FormatNumber(0, 2)

End If

On Error GoTo err:

Me.lblDeduct.Caption =
FormatNumber(CCur(Me.txtAdvances.Text) +
CCur(Me.txtAbsences.Text) _

+ CCur(Me.txtsss.Text) + CCur(Me.txtSSSL.Text) +
CCur(Me.txtPHL.Text) + CCur(Me.txtPIL.Text) +
CCur(Me.txttax.Text) + CCur(Me.txtph.Text) +
CCur(Me.txtPagIbig.Text), 2)

Exit Sub

err:

Me.txttax.Text = FormatNumber(0, 2)

End Sub

Private Sub Init_Display_Data()

On Error GoTo err:

If rs.State = adStateOpen Then rs.Close

Me.lvwInfo.ListItems.Clear

rs.Open "Select * from tblPayroll where


Month(dDate)='" & Month(Me.DTPicker1.Value) & "' And
Year(dDate)='" & Year(Me.DTPicker1.Value) & "' ORDER BY
tblPayroll.EM_ID;", cn, adOpenKeyset, adLockPessimistic

79
San Carlos Computer World Payroll System
Perpetual Help College of Pangasinan
Malasiqui, Pangasinan

Do While rs.EOF = False

Me.lvwInfo.ListItems.Add , ,
rs.Fields("EM_ID").Value

Me.lvwInfo.ListItems(Me.lvwInfo.ListItems.Count).SubItems(1
) = rs.Fields("EM_Name").Value

Me.lvwInfo.ListItems(Me.lvwInfo.ListItems.Count).SubItems(2
) = rs.Fields("Monthly_Rate").Value

Me.lvwInfo.ListItems(Me.lvwInfo.ListItems.Count).SubItems(3
) = rs.Fields("dDate").Value

Me.lvwInfo.ListItems(Me.lvwInfo.ListItems.Count).SubItems(4
) = rs.Fields("SSS").Value

Me.lvwInfo.ListItems(Me.lvwInfo.ListItems.Count).SubItems(5
) = rs.Fields("PH").Value

Me.lvwInfo.ListItems(Me.lvwInfo.ListItems.Count).SubItems(6
) = rs.Fields("InTax").Value

Me.lvwInfo.ListItems(Me.lvwInfo.ListItems.Count).SubItems(7
) = rs.Fields("SSS Loan").Value

Me.lvwInfo.ListItems(Me.lvwInfo.ListItems.Count).SubItems(8
) = rs.Fields("PhilHealth Loan").Value

Me.lvwInfo.ListItems(Me.lvwInfo.ListItems.Count).SubItems(9
) = rs.Fields("Pag-Ibig Loan").Value

Me.lvwInfo.ListItems(Me.lvwInfo.ListItems.Count).SubItems(1
0) = rs.Fields("PagIbig").Value

80
San Carlos Computer World Payroll System
Perpetual Help College of Pangasinan
Malasiqui, Pangasinan

Me.lvwInfo.ListItems(Me.lvwInfo.ListItems.Count).SubItems(1
1) = rs.Fields("absences").Value

Me.lvwInfo.ListItems(Me.lvwInfo.ListItems.Count).SubItems(1
2) = rs.Fields("Advances").Value

Me.lvwInfo.ListItems(Me.lvwInfo.ListItems.Count).SubItems(1
3) = rs.Fields("TAD").Value

Me.lvwInfo.ListItems(Me.lvwInfo.ListItems.Count).SubItems(1
4) = rs.Fields("TD").Value

Me.lvwInfo.ListItems(Me.lvwInfo.ListItems.Count).SubItems(1
5) = rs.Fields("NetPay").Value

rs.MoveNext

Loop

Exit Sub

err:

MsgBox err.Description, vbCritical, "Error"

Set rs = Nothing

End Sub

Private Sub txttax_GotFocus()

hl_Text txttax

End Sub

Private Sub txttax_KeyPress(KeyAscii As Integer)

Select Case KeyAscii

Case vbKeyBack

Case vbKeyDelete

81
San Carlos Computer World Payroll System
Perpetual Help College of Pangasinan
Malasiqui, Pangasinan

Case vbKeyReturn

txttax_Change

SendKeys vbTab

Case 48 To 57 Case Else

KeyAscii = 0

End Select

End Sub

Private Sub txttax_LostFocus()

On Error GoTo err:

Me.txttax.Text = FormatNumber(Me.txttax.Text, 2)

Exit Sub

err:

Me.txttax.Text = FormatNumber(0, 2)

End Sub

Private Sub sText()

Me.txtAbsences.Text = "0.00"

Me.txtAdvances.Text = "0.00"

Me.txtBonus.Text = "0.00"

Me.txtNumDays.Text = "0"

Me.txtOverTime.Text = "0.00"

Me.txtsss.Text = "0.00"

Me.txttax.Text = "0.00"

Me.txtph.Text = "0.00"

Me.txtPagIbig.Text = "0.00"

Me.txtSSSL.Text = "0.00"

82
San Carlos Computer World Payroll System
Perpetual Help College of Pangasinan
Malasiqui, Pangasinan

Me.txtPHL.Text = "0.00"

Me.txtPIL.Text = "0.00"

End Sub

Figure 9. Employee’s Information form allows the admin to


see the information of the employee.

Dim rs As New ADODB.Recordset


Private Sub cmdClose_Click()
Unload Me
End Sub
Private Sub cmdDelete_Click()
On Error GoTo eh
Dim intYN
intYN = MsgBox("You are about to delete a record." &
vbCrLf & _

83
San Carlos Computer World Payroll System
Perpetual Help College of Pangasinan
Malasiqui, Pangasinan

"If you click Yes, you won't be able to undo this


delete operation." & _
vbCrLf & vbCrLf & _
"Are you sure you want to delete this record?",
vbQuestion + vbYesNo, "Confirm Delete")

If intYN = vbNo Then Exit Sub


cn.Execute "DELETE FROM tblEmp WHERE EM_ID = " &
Me.lvlEmpInfo.SelectedItem.Text
Init_Data
MsgBox "Record deleted.", vbInformation
Exit Sub
eh:
MsgBox err.Description, vbCritical
End Sub
Private Sub cmdEdit_Click()
On Error GoTo err:
If rs.State = adStateOpen Then rs.Close
rs.Open "Select * from tblEmp where EM_ID=" &
Me.lvlEmpInfo.SelectedItem.Text & ";", cn, adOpenKeyset,
adLockPessimistic
Do While rs.EOF = False
With frm_Edit_emp
.txtIDNo.Text = rs.Fields("EM_ID").Value
.txtFName = rs.Fields("NAME").Value
.cboGender.Text = rs.Fields("Gender").Value
.cboStat.Text = rs.Fields("Status").Value
.txtAddress.Text = rs.Fields("Address").Value
.dtpDateofBirth.Value = rs.Fields("Date of
Birth").Value

84
San Carlos Computer World Payroll System
Perpetual Help College of Pangasinan
Malasiqui, Pangasinan

.txtContactNo.Text = rs.Fields("Contact Number").Value


.txtEmailAd.Text = rs.Fields("Email Address").Value
.txtSSSNo.Text = rs.Fields("SSS Number").Value
.txtPhilHealthNo.Text = rs.Fields("PhilHealth
Number").Value
.txtPagIbigNo.Text = rs.Fields("Pag-Ibig Number").Value
.txtDept.Text = rs.Fields("DEPT").Value
.txtPosition.Text = rs.Fields("POSITION").Value
.cboEmpStat.Text = rs.Fields("Emp_Stat").Value
.txtBasicRate.Text = rs.Fields("Basic_Rate").Value
.dtpHired.Value = rs.Fields("Date_Employed").Value
.Photo.LoadPhoto rs.Fields("emp_photo")
End With
rs.MoveNext
Loop
frm_Edit_emp.Show 1
Exit Sub
err:
MsgBox err.Description, vbCritical, "Error"
Set rs = Nothing
End Sub
Private Sub cmdPrintAll_Click()
On Error GoTo err:
If rs.State = adStateOpen Then rs.Close
rs.Open "Select * from tblEmp", cn, adOpenKeyset,
adLockPessimistic
Set drtSel_emp_info.DataSource = rs
drtSel_emp_info.Show 1
Exit Sub

85
San Carlos Computer World Payroll System
Perpetual Help College of Pangasinan
Malasiqui, Pangasinan

err:
MsgBox err.Description, vbCritical, "Error"
Set rs = Nothing
End Sub
Private Sub cmdPrintSel_Click()
On Error GoTo err:
If rs.State = adStateOpen Then rs.Close
rs.Open "Select * from tblEmp where EM_ID=" &
Me.lvlEmpInfo.SelectedItem.Text & ";", cn, adOpenKeyset,
adLockPessimistic
Set drtSel_emp_info.DataSource = rs
drtSel_emp_info.Show 1
Exit Sub
err:
MsgBox err.Description, vbCritical, "Error"
Set rs = Nothing
End Sub
Private Sub Command1_Click()
End Sub
Private Sub Form_Load()
Init_Data
If Me.lvlEmpInfo.ListItems.Count = 0 Then
Me.cmdPrintAll.Enabled = False
End If
End Sub
Public Sub Init_Data()
On Error GoTo err:
If rs.State = adStateOpen Then rs.Close
Me.lvlEmpInfo.ListItems.Clear

86
San Carlos Computer World Payroll System
Perpetual Help College of Pangasinan
Malasiqui, Pangasinan

rs.Open "Select * from tblEmp", cn, adOpenKeyset,


adLockPessimistic
Do While rs.EOF = False
Me.lvlEmpInfo.ListItems.Add , ,
rs.Fields("EM_ID").Value

Me.lvlEmpInfo.ListItems(Me.lvlEmpInfo.ListItems.Count).SubI
tems(1) = rs.Fields("NAME").Value

Me.lvlEmpInfo.ListItems(Me.lvlEmpInfo.ListItems.Count).SubI
tems(2) = rs.Fields("Gender").Value

Me.lvlEmpInfo.ListItems(Me.lvlEmpInfo.ListItems.Count).SubI
tems(3) = rs.Fields("Status").Value

Me.lvlEmpInfo.ListItems(Me.lvlEmpInfo.ListItems.Count).SubI
tems(4) = rs.Fields("Address").Value

Me.lvlEmpInfo.ListItems(Me.lvlEmpInfo.ListItems.Count).SubI
tems(5) = rs.Fields("DEPT").Value

Me.lvlEmpInfo.ListItems(Me.lvlEmpInfo.ListItems.Count).SubI
tems(6) = rs.Fields("POSITION").Value

Me.lvlEmpInfo.ListItems(Me.lvlEmpInfo.ListItems.Count).SubI
tems(7) = rs.Fields("Emp_Stat").Value

Me.lvlEmpInfo.ListItems(Me.lvlEmpInfo.ListItems.Count).SubI
tems(8) = rs.Fields("Basic_Rate").Value

Me.lvlEmpInfo.ListItems(Me.lvlEmpInfo.ListItems.Count).SubI
tems(9) = rs.Fields("Date_Employed").Value

Me.lvlEmpInfo.ListItems(Me.lvlEmpInfo.ListItems.Count).SubI
tems(10) = rs.Fields("Contact Number").Value

87
San Carlos Computer World Payroll System
Perpetual Help College of Pangasinan
Malasiqui, Pangasinan

Me.lvlEmpInfo.ListItems(Me.lvlEmpInfo.ListItems.Count).SubI
tems(11) = rs.Fields("Date of Birth").Value

Me.lvlEmpInfo.ListItems(Me.lvlEmpInfo.ListItems.Count).SubI
tems(12) = rs.Fields("Spouse Name").Value

Me.lvlEmpInfo.ListItems(Me.lvlEmpInfo.ListItems.Count).SubI
tems(13) = rs.Fields("Email Address").Value

Me.lvlEmpInfo.ListItems(Me.lvlEmpInfo.ListItems.Count).SubI
tems(14) = rs.Fields("Educational Background").Value

Me.lvlEmpInfo.ListItems(Me.lvlEmpInfo.ListItems.Count).SubI
tems(15) = rs.Fields("SSS Number").Value

Me.lvlEmpInfo.ListItems(Me.lvlEmpInfo.ListItems.Count).SubI
tems(16) = rs.Fields("PhilHealth Number").Value

Me.lvlEmpInfo.ListItems(Me.lvlEmpInfo.ListItems.Count).SubI
tems(17) = rs.Fields("Pag-Ibig Number").Value
rs.MoveNext
Loop
If Me.lvlEmpInfo.ListItems.Count = 0 Then
Me.cmdDelete.Enabled = False
Me.cmdEdit.Enabled = False
Me.cmdPrintSel.Enabled = False
Me.cmdPrintAll.Enabled = False
Else
Me.cmdPrintAll.Enabled = True
End If
Exit Sub
err:

88
San Carlos Computer World Payroll System
Perpetual Help College of Pangasinan
Malasiqui, Pangasinan

MsgBox err.Description, vbCritical, "Error"


Set rs = Nothing
End Sub

Private Sub lvlEmpInfo_ItemClick(ByVal Item As


MSComctlLib.ListItem)
If Me.lvlEmpInfo.ListItems.Count <> 0 Then
Me.cmdDelete.Enabled = True
Me.cmdEdit.Enabled = True
Me.cmdPrintSel.Enabled = True
End If
End Sub

Figure 10. Edit Employee form allows the admin to edit the
information of the employee.

89
San Carlos Computer World Payroll System
Perpetual Help College of Pangasinan
Malasiqui, Pangasinan

Private cbo_empstat As New CAutoCompleteComboBox

Private cbo_gender As New CAutoCompleteComboBox

Private cbo_stat As New CAutoCompleteComboBox

Dim rs As New ADODB.Recordset

Private Sub cboEmpStat_KeyPress(KeyAscii As Integer)

Select Case KeyAscii

Case vbKeyReturn

SendKeys vbTab

End Select

End Sub

Private Sub cboGender_KeyPress(KeyAscii As Integer)

Select Case KeyAscii

Case vbKeyReturn

SendKeys vbTab

End Select

End Sub

Private Sub cboStat_KeyPress(KeyAscii As Integer)

Select Case KeyAscii

Case vbKeyReturn

SendKeys vbTab

End Select

End Sub

Private Sub cmdBrowse_Click()

Photo.OpenPhotoFile

90
San Carlos Computer World Payroll System
Perpetual Help College of Pangasinan
Malasiqui, Pangasinan

End Sub

Private Sub cmdCancel_Click()

sDisable

cmdSave.Enabled = False

cmdCancel.Enabled = False

cmdBrowse.Enabled = False

'cmdAdd.Enabled = True

'cmdAdd.SetFocus

End Sub

Private Sub cmdClose_Click()

Unload Me

End Sub

Private Sub sEnable()

Me.txtFName.BackColor = vbWhite

Me.txtFName.Locked = False

Me.txtFName.Text = ""

Me.txtAddress.BackColor = vbWhite

Me.txtAddress.Locked = False

Me.txtAddress.Text = ""

Me.txtContactNo.BackColor = vbWhite

Me.txtContactNo.Locked = False

Me.txtContactNo.Text = ""

91
San Carlos Computer World Payroll System
Perpetual Help College of Pangasinan
Malasiqui, Pangasinan

Me.txtEmailAd.BackColor = vbWhite

Me.txtEmailAd.Locked = False

Me.txtEmailAd.Text = ""

Me.txtSSSNo.BackColor = vbWhite

Me.txtSSSNo.Locked = False

Me.txtSSSNo.Text = ""

Me.txtPhilHealthNo.BackColor = vbWhite

Me.txtPhilHealthNo.Locked = False

Me.txtPhilHealthNo.Text = ""

Me.txtPagIbigNo.BackColor = vbWhite

Me.txtPagIbigNo.Locked = False

Me.txtPagIbigNo.Text = ""

Me.txtBasicRate.BackColor = vbWhite

Me.txtBasicRate.Locked = False

Me.txtBasicRate.Text = "0.00"

Me.txtDept.BackColor = vbWhite

Me.txtDept.Locked = False

Me.txtDept.Text = ""

Me.txtPosition.BackColor = vbWhite

92
San Carlos Computer World Payroll System
Perpetual Help College of Pangasinan
Malasiqui, Pangasinan

Me.txtPosition.Locked = False

Me.txtPosition.Text = ""

Me.cboEmpStat.BackColor = vbWhite

Me.cboEmpStat.Locked = False

Me.cboEmpStat.Text = ""

Me.cboGender.BackColor = vbWhite

Me.cboGender.Locked = False

Me.cboGender.Text = ""

Me.cboStat.BackColor = vbWhite

Me.cboStat.Locked = False

Me.cboStat.Text = ""

Me.txtFName.SetFocus

End Sub

Private Sub sDisable()

Me.txtFName.BackColor = &H8000000B

Me.txtFName.Locked = True

Me.txtAddress.BackColor = &H8000000B

Me.txtAddress.Locked = True

Me.txtContactNo.BackColor = &H8000000B

Me.txtContactNo.Locked = True

Me.txtEmailAd.BackColor = &H8000000B

93
San Carlos Computer World Payroll System
Perpetual Help College of Pangasinan
Malasiqui, Pangasinan

Me.txtEmailAd.Locked = True

Me.txtSSSNo.BackColor = &H8000000B

Me.txtSSSNo.Locked = True

Me.txtPhilHealthNo.BackColor = &H8000000B

Me.txtPhilHealthNo.Locked = True

Me.txtPagIbigNo.BackColor = &H8000000B

Me.txtPagIbigNo.Locked = True

Me.txtBasicRate.BackColor = &H8000000B

Me.txtBasicRate.Locked = True

Me.txtDept.BackColor = &H8000000B

Me.txtDept.Locked = True

Me.txtPosition.BackColor = &H8000000B

Me.txtPosition.Locked = True

Me.cboEmpStat.BackColor = &H8000000B

Me.cboEmpStat.Locked = True

Me.cboGender.BackColor = &H8000000B

Me.cboGender.Locked = True

Me.cboStat.BackColor = &H8000000B

Me.cboStat.Locked = True

Me.txtFName.SetFocus

End Sub

Private Sub cmdSave_Click()

On Error GoTo err:

If rs.State = adStateOpen Then rs.Close

94
San Carlos Computer World Payroll System
Perpetual Help College of Pangasinan
Malasiqui, Pangasinan

rs.Open "Select * from tblEmp where EM_ID = " &


Me.txtIDNo.Text, cn, adOpenKeyset, adLockPessimistic

If Me.txtFName.Text = "" Then MsgBox "Please enter


First Name.", vbInformation, "Information":
Me.txtFName.SetFocus: Exit Sub

If Me.cboGender.Text = "" Then MsgBox "Please Select


Gender.", vbInformation, "Information":
Me.cboGender.SetFocus: Exit Sub

If Me.cboStat.Text = "" Then MsgBox "Please Select


Status.", vbInformation, "Information":
Me.cboStat.SetFocus: Exit Sub

If Me.txtAddress.Text = "" Then MsgBox "Please enter


Employee's Address.", vbInformation, "Information":
Me.txtAddress.SetFocus: Exit Sub

If Me.txtContactNo.Text = "" Then MsgBox "Please enter


Employee's Contact No.", vbInformation, "Information":
Me.txtContactNo.SetFocus: Exit Sub

If Me.txtEmailAd.Text = "" Then MsgBox "Please enter


Employee's Email Ad.", vbInformation, "Information":
Me.txtEmailAd.SetFocus: Exit Sub

If Me.txtSSSNo.Text = "" Then MsgBox "Please enter


Employee's SSS #.", vbInformation, "Information":
Me.txtSSSNo.SetFocus: Exit Sub

If Me.txtPhilHealthNo.Text = "" Then MsgBox "Please


enter Employee's PhilHealth #.", vbInformation,
"Information": Me.txtPhilHealthNo.SetFocus: Exit Sub

If Me.txtPagIbigNo.Text = "" Then MsgBox "Please enter


Employee's PagIbig #.", vbInformation, "Information":
Me.txtPagIbigNo.SetFocus: Exit Sub

If Me.txtDept.Text = "" Then MsgBox "Please enter


Department.", vbInformation, "Information":
Me.txtDept.SetFocus: Exit Sub

95
San Carlos Computer World Payroll System
Perpetual Help College of Pangasinan
Malasiqui, Pangasinan

If Me.txtPosition.Text = "" Then MsgBox "Please enter


Employee's Position.", vbInformation, "Information":
Me.txtPosition.SetFocus: Exit Sub

If Me.cboEmpStat.Text = "" Then MsgBox "Please Select


Employee's Status.", vbInformation, "Information":
Me.cboEmpStat.SetFocus: Exit Sub

If Me.txtBasicRate.Text = "" Then MsgBox "Please enter


Employee's Basic Salary Rate.", vbInformation,
"Information": Me.txtBasicRate.SetFocus: Exit Sub

With rs

'AddNew

.Fields("EM_ID").Value = Me.txtIDNo.Text

.Fields("NAME").Value = Me.txtFName.Text

.Fields("Gender").Value = Me.cboGender.Text

.Fields("Status").Value = Me.cboStat.Text

.Fields("Address").Value = Me.txtAddress.Text

.Fields("Date of Birth").Value =
Me.dtpDateofBirth.Value

.Fields("Contact Number").Value =
Me.txtContactNo.Text

.Fields("Email Address").Value = Me.txtEmailAd.Text

.Fields("SSS Number").Value = Me.txtSSSNo.Text

.Fields("PhilHealth Number").Value

Me.txtPhilHealthNo.Text

.Fields("Pag-Ibig Number").Value =
Me.txtPagIbigNo.Text

.Fields("DEPT").Value = Me.txtDept.Text

.Fields("POSITION").Value = Me.txtPosition.Text

96
San Carlos Computer World Payroll System
Perpetual Help College of Pangasinan
Malasiqui, Pangasinan

.Fields("Emp_Stat").Value = Me.cboEmpStat.Text

.Fields("Basic_Rate").Value = Me.txtBasicRate.Text

.Fields("Date_Employed").Value = Me.dtpHired.Value

Me.Photo.SavePhoto .Fields("emp_Photo")

.Update

End With

sDisable

cmdSave.Enabled = False

cmdCancel.Enabled = False

cmdBrowse.Enabled = False

MsgBox "Data entry successfully updated.",


vbInformation

UpdateInfo

Exit Sub

err:

MsgBox err.Description, vbCritical, "Error"

Set rs = Nothing

End Sub

Private Sub dtpDateofBirth_KeyPress(KeyAscii As Integer)

Select Case KeyAscii

Case vbKeyReturn

SendKeys vbTab

End Select

End Sub

Private Sub dtpHired_KeyPress(KeyAscii As Integer)

97
San Carlos Computer World Payroll System
Perpetual Help College of Pangasinan
Malasiqui, Pangasinan

Select Case KeyAscii

Case vbKeyReturn

SendKeys vbTab

End Select

End Sub

Private Sub Form_Load()

cbo_stat.Init Me.cboStat

cbo_empstat.Init Me.cboEmpStat

cbo_gender.Init Me.cboGender

End Sub

Private Sub txtAddress_KeyPress(KeyAscii As Integer)

Select Case KeyAscii

Case vbKeyReturn

SendKeys vbTab

End Select

End Sub

Private Sub txtBasicRate_GotFocus()

hl_Text txtBasicRate

End Sub

Private Sub txtBasicRate_KeyPress(KeyAscii As Integer)

Select Case KeyAscii

Case vbKeyBack

Case vbKeyDelete

Case vbKeyReturn

SendKeys vbTab

98
San Carlos Computer World Payroll System
Perpetual Help College of Pangasinan
Malasiqui, Pangasinan

Case 48 To 57

Case Else

KeyAscii = 0

End Select

End Sub

Private Sub txtBasicRate_LostFocus()

If Me.txtBasicRate.Text = vbNullString Then


Me.txtBasicRate.Text = FormatNumber(0, 2)

Me.txtBasicRate.Text = FormatNumber(Me.txtBasicRate.Text,
2)

End Sub

Private Sub txtContactNo_GotFocus()

hl_Text txtContactNo

End Sub

Private Sub txtContactNo_KeyPress(KeyAscii As Integer)

If (KeyAscii >= vbKey0 And KeyAscii <= vbKey9) Or KeyAscii


= vbKeyBack Then

Else

KeyAscii = 0

End If

Select Case KeyAscii

Case vbKeyReturn

SendKeys vbTab

End Select

End Sub

Private Sub txtDept_KeyPress(KeyAscii As Integer)

99
San Carlos Computer World Payroll System
Perpetual Help College of Pangasinan
Malasiqui, Pangasinan

Select Case KeyAscii

Case vbKeyReturn

SendKeys vbTab

End Select

End Sub

Private Sub txtEmailAd_KeyPress(KeyAscii As Integer)

Select Case KeyAscii

Case vbKeyReturn

SendKeys vbTab

End Select

End Sub

Private Sub txtFName_KeyPress(KeyAscii As Integer)

Select Case KeyAscii

Case vbKeyReturn

SendKeys vbTab

End Select

End Sub

Private Sub txtLName_KeyPress(KeyAscii As Integer)

Select Case KeyAscii

Case vbKeyReturn

SendKeys vbTab

End Select

End Sub

Private Sub txtMI_KeyPress(KeyAscii As Integer)

Select Case KeyAscii

100
San Carlos Computer World Payroll System
Perpetual Help College of Pangasinan
Malasiqui, Pangasinan

Case vbKeyReturn

SendKeys vbTab

End Select

End Sub

Private Sub txtPagIbigNo_GotFocus()

hl_Text txtPagIbigNo

End Sub

Private Sub txtPagIbigNo_KeyPress(KeyAscii As Integer)

If (KeyAscii >= vbKey0 And KeyAscii <= vbKey9) Or KeyAscii


= vbKeyBack Then

Else

KeyAscii = 0

End If

Select Case KeyAscii

Case vbKeyReturn

SendKeys vbTab

End Select

End Sub

Private Sub txtPhilHealthNo_GotFocus()

hl_Text txtPhilHealthNo

End Sub

Private Sub txtPhilHealthNo_KeyPress(KeyAscii As Integer)

If (KeyAscii >= vbKey0 And KeyAscii <= vbKey9) Or KeyAscii


= vbKeyBack Then

Else

KeyAscii = 0

101
San Carlos Computer World Payroll System
Perpetual Help College of Pangasinan
Malasiqui, Pangasinan

End If

Select Case KeyAscii

Case vbKeyReturn

SendKeys vbTab

End Select

End Sub

Private Sub txtPosition_KeyPress(KeyAscii As Integer)

Select Case KeyAscii

Case vbKeyReturn

SendKeys vbTab

End Select

End Sub

Private Sub UpdateInfo()

With frm_emp_Info

.Init_Data

End With

End Sub

Private Sub txtSSSNo_GotFocus()

hl_Text txtSSSNo

End Sub

Private Sub txtSSSNo_KeyPress(KeyAscii As Integer)

If (KeyAscii >= vbKey0 And KeyAscii <= vbKey9) Or KeyAscii


= vbKeyBack Then

Else

KeyAscii = 0

102
San Carlos Computer World Payroll System
Perpetual Help College of Pangasinan
Malasiqui, Pangasinan

End If

Select Case KeyAscii

Case vbKeyReturn

SendKeys vbTab

End Select

End Sub

Figure 11. Create Pay slip form allows the admin to show
and print the pay slip of the employee.

Dim rs As New ADODB.Recordset

Private Sub cmdClose_Click()

Unload Me

End Sub

Private Sub cmdPrintAll_Click()

103
San Carlos Computer World Payroll System
Perpetual Help College of Pangasinan
Malasiqui, Pangasinan

On Error GoTo err:

If rs.State = adStateOpen Then rs.Close

rs.Open "Select * from tblPayroll where Month(dDate)='"


& Month(Me.dtPick.Value) & "' And Year(dDate)='" &
Year(Me.dtPick.Value) & "'ORDER BY tblPayroll.EM_ID;", cn,
adOpenKeyset, adLockPessimistic

Set drtSel.DataSource = rs

drtSel.Show 1

Exit Sub

err:

MsgBox err.Description, vbCritical, "Error"

Set rs = Nothing

End Sub

Private Sub dtPick_Change()

Init_Data

End Sub

Private Sub dtPick_Click()

Init_Data

End Sub

Private Sub Form_Load()

dtPick.Value = Now

Init_Data

If Me.lvwInfo.ListItems.Count = 0 Then

Me.cmdPrintAll.Enabled = False

End If

End Sub

104
San Carlos Computer World Payroll System
Perpetual Help College of Pangasinan
Malasiqui, Pangasinan

Private Sub Init_Data()

On Error GoTo err:

If rs.State = adStateOpen Then rs.Close

Me.lvwInfo.ListItems.Clear

rs.Open "Select * from tblPayroll where


Month(dDate)='" & Month(Me.dtPick.Value) & "' And
Year(dDate)='" & Year(Me.dtPick.Value) & "' ORDER BY
tblPayroll.EM_ID;", cn, adOpenKeyset, adLockPessimistic

Do While rs.EOF = False

Me.lvwInfo.ListItems.Add , ,
rs.Fields("EM_ID").Value

Me.lvwInfo.ListItems(Me.lvwInfo.ListItems.Count).SubItems(1
) = rs.Fields("EM_Name").Value

Me.lvwInfo.ListItems(Me.lvwInfo.ListItems.Count).SubItems(2
) = rs.Fields("Monthly_Rate").Value

Me.lvwInfo.ListItems(Me.lvwInfo.ListItems.Count).SubItems(3
) = rs.Fields("dDate").Value

Me.lvwInfo.ListItems(Me.lvwInfo.ListItems.Count).SubItems(4
) = rs.Fields("SSS").Value

Me.lvwInfo.ListItems(Me.lvwInfo.ListItems.Count).SubItems(5
) = rs.Fields("PH").Value

Me.lvwInfo.ListItems(Me.lvwInfo.ListItems.Count).SubItems(6
) = rs.Fields("InTax").Value

Me.lvwInfo.ListItems(Me.lvwInfo.ListItems.Count).SubItems(7
) = rs.Fields("SSS Loan").Value

105
San Carlos Computer World Payroll System
Perpetual Help College of Pangasinan
Malasiqui, Pangasinan

Me.lvwInfo.ListItems(Me.lvwInfo.ListItems.Count).SubItems(8
) = rs.Fields("PhilHealth Loan").Value

Me.lvwInfo.ListItems(Me.lvwInfo.ListItems.Count).SubItems(9
) = rs.Fields("Pag-Ibig Loan").Value

Me.lvwInfo.ListItems(Me.lvwInfo.ListItems.Count).SubItems(1
0) = rs.Fields("PagIbig").Value

Me.lvwInfo.ListItems(Me.lvwInfo.ListItems.Count).SubItems(1
1) = rs.Fields("absences").Value

Me.lvwInfo.ListItems(Me.lvwInfo.ListItems.Count).SubItems(1
2) = rs.Fields("Advances").Value

Me.lvwInfo.ListItems(Me.lvwInfo.ListItems.Count).SubItems(1
3) = rs.Fields("TAD").Value
Me.lvwInfo.ListItems(Me.lvwInfo.ListItems.Count).SubItems(1
4) = rs.Fields("TD").Value
Me.lvwInfo.ListItems(Me.lvwInfo.ListItems.Count).SubItems(1
5) = rs.Fields("NetPay").Value

rs.MoveNext

Loop

Exit Sub

err:

MsgBox err.Description, vbCritical, "Error"

Set rs = Nothing

End Sub

106
San Carlos Computer World Payroll System
Perpetual Help College of Pangasinan
Malasiqui, Pangasinan

Figure 12. Daily Time Record form allows the admin to show
the daily time record of the employee.

Dim rs As New ADODB.Recordset

Dim vViewAll As Boolean

Dim cbo_name As New CAutoCompleteComboBox

Private Sub cboName_Change()

vName

End Sub

Private Sub cboName_Click()

vName

End Sub

Private Sub cmdClose_Click()

107
San Carlos Computer World Payroll System
Perpetual Help College of Pangasinan
Malasiqui, Pangasinan

Unload Me

End Sub

Private Sub vName()

On Error GoTo err:

If rs.State = adStateOpen Then rs.Close

Me.lvlDtr.ListItems.Clear

rs.Open "SELECT tblTimeLog.IN_AM, tblTimeLog.OUT_AM,


tblTimeLog.IN_PM, tblTimeLog.OUT_PM,
tblTimeLog.GRAND_TOTAL, tblTimeLog.Date_log, tblTimeLog.ID,
tblTimeLog.EM_Name FROM tblTimeLog Where EM_Name = '" &
Me.cboName.Text & "'GROUP BY tblTimeLog.IN_AM,
tblTimeLog.OUT_AM, tblTimeLog.IN_PM, tblTimeLog.OUT_PM,
tblTimeLog.GRAND_TOTAL, tblTimeLog.Date_log, tblTimeLog.ID,
tblTimeLog.EM_Name HAVING tblTimeLog.Date_log Between #" &
Me.DTPicker1.Value & "# AND #" & Me.DTPicker2.Value & "#;",
cn, adOpenKeyset, adLockPessimistic

Do While rs.EOF = False

Me.lvlDtr.ListItems.Add , ,
rs.Fields("ID").Value

Me.lvlDtr.ListItems(Me.lvlDtr.ListItems.Count).SubItems(1)
= rs.Fields("EM_Name").Value

Me.lvlDtr.ListItems(Me.lvlDtr.ListItems.Count).SubItems(2)
= rs.Fields("Date_log").Value

Me.lvlDtr.ListItems(Me.lvlDtr.ListItems.Count).SubItems(3)
= rs.Fields("IN_AM").Value

Me.lvlDtr.ListItems(Me.lvlDtr.ListItems.Count).SubItems(4)
= rs.Fields("OUT_AM").Value

108
San Carlos Computer World Payroll System
Perpetual Help College of Pangasinan
Malasiqui, Pangasinan

Me.lvlDtr.ListItems(Me.lvlDtr.ListItems.Count).SubItems(5)
= rs.Fields("IN_PM").Value

Me.lvlDtr.ListItems(Me.lvlDtr.ListItems.Count).SubItems(6)
= rs.Fields("OUT_PM").Value

Me.lvlDtr.ListItems(Me.lvlDtr.ListItems.Count).SubItems(7)
= rs.Fields("GRAND_TOTAL").Value

rs.MoveNext

Loop

Exit Sub

err:

MsgBox err.Description, vbCritical, "Error"

Set rs = Nothing

End Sub

Private Sub cmdPrintAll_Click()

On Error GoTo err:

If rs.State = adStateOpen Then rs.Close

If vViewAll = True Then

rs.Open "SELECT * from tblTimeLog where


Date_log Between #" & Me.DTPicker1.Value & "# AND #" &
Me.DTPicker2.Value & "#;", cn, adOpenKeyset,
adLockPessimistic

Else

rs.Open "SELECT * from tblTimeLog where ID=" &


Me.lvlDtr.SelectedItem.Text & "And Date_log Between #" &
Me.DTPicker1.Value & "# AND #" & Me.DTPicker2.Value & "#;",
cn, adOpenKeyset, adLockPessimistic

End If

109
San Carlos Computer World Payroll System
Perpetual Help College of Pangasinan
Malasiqui, Pangasinan

Set drtSel_DTR.DataSource = rs

drtSel_DTR.BottomMargin = 0

drtSel_DTR.LeftMargin = 0

drtSel_DTR.RightMargin = 0

drtSel_DTR.TopMargin = 0

drtSel_DTR.Show 1

Exit Sub

err:

MsgBox err.Description, vbCritical

End Sub

Private Sub cmdPrintSel_Click()

On Error GoTo err:

If rs.State = adStateOpen Then rs.Close

rs.Open "SELECT * from tblTimeLog where ID=" &


Me.lvlDtr.SelectedItem.Text & "And DATE_LOG = #" &
Me.lvlDtr.ListItems(Me.lvlDtr.SelectedItem.Index).SubItems(
2) & "#", cn, adOpenKeyset, adLockPessimistic

Set drtSel_DTR.DataSource = rs

drtSel_DTR.BottomMargin = 0

drtSel_DTR.LeftMargin = 0

drtSel_DTR.RightMargin = 0

drtSel_DTR.TopMargin = 0

drtSel_DTR.Show 1

Me.cmdPrintSel.Enabled = False

Exit Sub

110
San Carlos Computer World Payroll System
Perpetual Help College of Pangasinan
Malasiqui, Pangasinan

err:

MsgBox err.Description, vbCritical, "Error"

Set rs = Nothing

End Sub

Private Sub DTPicker1_Change()

If vViewAll = False Then

vName

Else

vAll

End If

End Sub

Private Sub DTPicker1_Click()

If vViewAll = False Then

vName

Else

vAll

End If

End Sub

Private Sub DTPicker2_Change()

If vViewAll = False Then

vName

Else

vAll

End If

End Sub

111
San Carlos Computer World Payroll System
Perpetual Help College of Pangasinan
Malasiqui, Pangasinan

Private Sub DTPicker2_Click()

If vViewAll = False Then

vName

Else

vAll

End If

End Sub

Private Sub Form_Load()

Me.DTPicker1.Value = FormatDateTime(Now, vbShortDate)

Me.DTPicker2.Value = FormatDateTime(Now, vbShortDate)

cbo_name.Init cboName

init_name

End Sub

Private Sub lvlDtr_ItemClick(ByVal Item As


MSComctlLib.ListItem)

If Me.lvlDtr.ListItems.Count <> 0 Then


Me.cmdPrintSel.Enabled = True

End Sub

Private Sub OptAll_Click()

If Me.OptAll.Value = True Then

Me.cboName.Enabled = True

vViewAll = True

End If

End Sub

112
San Carlos Computer World Payroll System
Perpetual Help College of Pangasinan
Malasiqui, Pangasinan

Private Sub OptByName_Click()

If Me.OptByName.Value = True Then

Me.cboName.Enabled = True

vViewAll = True

End If

End Sub

Private Sub init_name()

On Error GoTo err:

If rs.State = adStateOpen Then rs.Close

rs.Open "Select tblTimeLog.EM_Name from tblTimeLog


Group by tblTimeLog.EM_Name", cn, adOpenKeyset,
adLockPessimistic

Do While rs.EOF = False

Me.cboName.AddItem rs.Fields("EM_Name").Value

rs.MoveNext

Loop

Exit Sub

err:

MsgBox err.Description, vbCritical, "Error"

Set rs = Nothing

End Sub

Private Sub vAll()

On Error GoTo err:

If rs.State = adStateOpen Then rs.Close

Me.lvlDtr.ListItems.Clear

113
San Carlos Computer World Payroll System
Perpetual Help College of Pangasinan
Malasiqui, Pangasinan

rs.Open "SELECT * from tblTimeLog where Date_log


Between #" & Me.DTPicker1.Value & "# AND #" &
Me.DTPicker2.Value & "#;", cn, adOpenKeyset,
adLockPessimistic

Do While rs.EOF = False

Me.lvlDtr.ListItems.Add , ,
rs.Fields("ID").Value

Me.lvlDtr.ListItems(Me.lvlDtr.ListItems.Count).SubItems(1)
= rs.Fields("EM_Name").Value

Me.lvlDtr.ListItems(Me.lvlDtr.ListItems.Count).SubItems(2)
= rs.Fields("Date_log").Value

Me.lvlDtr.ListItems(Me.lvlDtr.ListItems.Count).SubItems(3)
= rs.Fields("IN_AM").Value

Me.lvlDtr.ListItems(Me.lvlDtr.ListItems.Count).SubItems(4)
= rs.Fields("OUT_AM").Value

Me.lvlDtr.ListItems(Me.lvlDtr.ListItems.Count).SubItems(5)
= rs.Fields("IN_PM").Value
Me.lvlDtr.ListItems(Me.lvlDtr.ListItems.Count).SubItems(6)
= rs.Fields("OUT_PM").Value
Me.lvlDtr.ListItems(Me.lvlDtr.ListItems.Count).SubItems(7)
= rs.Fields("GRAND_TOTAL").Value

rs.MoveNext

Loop

Exit Sub

err:

MsgBox err.Description, vbCritical, "Error"

Set rs = Nothing End Sub

114
San Carlos Computer World Payroll System
Perpetual Help College of Pangasinan
Malasiqui, Pangasinan

Figure 13. System User form allows the admin to add an


account.

Option Explicit

Dim boolSave As Boolean

Dim rsUsers As ADODB.Recordset

Private Sub cmdAdd_Click()

txtName.Text = ""

txtPass.Text = ""

txtConfirm.Text = ""

Me.Picture2.Enabled = True

txtName.BackColor = vbWhite

txtPass.BackColor = vbWhite

txtConfirm.BackColor = vbWhite

cmdSave.Enabled = True

115
San Carlos Computer World Payroll System
Perpetual Help College of Pangasinan
Malasiqui, Pangasinan

cmdEdit.Enabled = False

cmdAdd.Enabled = False

cmdCancel.Enabled = True

cmdDelete.Enabled = False

'lstUsers.Enabled = False

txtName.SetFocus

boolSave = True

End Sub

Private Sub cmdCancel_Click()

Me.Picture2.Enabled = False

txtName.BackColor = &HE0E0E0

txtPass.BackColor = &HE0E0E0

txtConfirm.BackColor = &HE0E0E0

cmdSave.Enabled = False

cmdEdit.Enabled = True

cmdAdd.Enabled = True

cmdDelete.Enabled = True

cmdCancel.Enabled = False

If Me.lvwUser.ListItems.Count = 0 Then

cmdEdit.Enabled = False

cmdDelete.Enabled = False

End If

Me.lvwUser.SetFocus

End Sub

Private Sub cmdClose_Click()

116
San Carlos Computer World Payroll System
Perpetual Help College of Pangasinan
Malasiqui, Pangasinan

Unload Me

End Sub

Private Sub cmdDelete_Click()

On Error GoTo eh

Dim intYN

intYN = MsgBox("You are about to delete a record." &


vbCrLf & _

"If you click Yes, you won't be able to undo this


delete operation." & _

vbCrLf & vbCrLf & _

"Are you sure you want to delete this record?",


vbQuestion + vbYesNo, "Confirm Delete")

If intYN = vbNo Then Exit Sub

cn.Execute "DELETE FROM tblUser WHERE ID = " &


Me.lvwUser.SelectedItem.Text

Call GetUsers

txtName.Text = ""

txtPass.Text = ""

txtConfirm.Text = ""

MsgBox "Record deleted.", vbInformation

Exit Sub

eh:

MsgBox err.Description, vbCritical

End Sub

Private Sub cmdEdit_Click()

txtName.BackColor = vbWhite

txtPass.BackColor = vbWhite

117
San Carlos Computer World Payroll System
Perpetual Help College of Pangasinan
Malasiqui, Pangasinan

txtConfirm.BackColor = vbWhite

Me.Picture2.Enabled = True

cmdSave.Enabled = True

cmdEdit.Enabled = False

cmdAdd.Enabled = False

cmdCancel.Enabled = True

cmdDelete.Enabled = False

txtName.SetFocus

boolSave = False

End Sub

Private Sub cmdSave_Click()

On Error GoTo eh

If txtName.Text = vbNullString Then

MsgBox "Please enter user name.", vbExclamation

txtName.SetFocus

Exit Sub

End If

If txtPass.Text = vbNullString Then

MsgBox "Please enter user name.", vbExclamation

txtPass.SetFocus

Exit Sub

End If

If txtConfirm.Text = vbNullString Then

MsgBox "Please enter user name.", vbExclamation

txtConfirm.SetFocus

118
San Carlos Computer World Payroll System
Perpetual Help College of Pangasinan
Malasiqui, Pangasinan

Exit Sub

End If

If txtPass.Text <> txtConfirm.Text Then

MsgBox "Password does not match!", vbExclamation

txtConfirm.SetFocus

Exit Sub

End If

Dim rsSave As ADODB.Recordset

Set rsSave = New ADODB.Recordset

With rsSave

If boolSave = True Then

If .State = adStateOpen Then .Close

.Open "SELECT * FROM tblUser WHERE ID = 0;",


cn, adOpenKeyset, adLockOptimistic

.AddNew

.Fields("USER_NAME") = txtName.Text

.Fields("Password") = txtPass.Text

.Update

MsgBox "New record saved.", vbInformation

ElseIf boolSave = False Then

.Open "SELECT * FROM tblUser WHERE ID = " &


Me.lvwUser.SelectedItem.Text, cn, adOpenKeyset,
adLockOptimistic

.Fields("USER_NAME") = txtName.Text

.Fields("Password") = txtPass.Text

.Update

119
San Carlos Computer World Payroll System
Perpetual Help College of Pangasinan
Malasiqui, Pangasinan

MsgBox "Record updated.", vbInformation

End If

GetUsers

End With

Me.Picture2.Enabled = False

txtName.BackColor = &HE0E0E0

txtPass.BackColor = &HE0E0E0

txtConfirm.BackColor = &HE0E0E0

cmdSave.Enabled = False

cmdEdit.Enabled = True

cmdAdd.Enabled = True

cmdCancel.Enabled = False

cmdDelete.Enabled = True

txtName.Text = ""

txtPass.Text = ""

txtConfirm.Text = ""

Exit Sub

eh:

MsgBox err.Description, vbCritical

End Sub

Private Sub Form_Load()

Me.Picture2.BackColor = &HCECECE

Call GetUsers

If Me.lvwUser.ListItems.Count = 0 Then

120
San Carlos Computer World Payroll System
Perpetual Help College of Pangasinan
Malasiqui, Pangasinan

Me.lvwUser.ListItems.Clear

cmdDelete.Enabled = False

cmdEdit.Enabled = False

Else

Me.lvwUser.ListItems.Item(1).Selected = True

End If

End Sub

Public Sub GetUsers()

Set rsUsers = New ADODB.Recordset

With rsUsers

If .State = adStateOpen Then .Close

.Open "SELECT * FROM tblUser ORDER BY USER_NAME;",


cn, adOpenKeyset, adLockOptimistic

If rsUsers.EOF = True Then

Me.lvwUser.ListItems.Clear

Exit Sub

End If

Me.lvwUser.ListItems.Clear

Do While .EOF = False

Me.lvwUser.ListItems.Add , , .Fields("id")

Me.lvwUser.ListItems(Me.lvwUser.ListItems.Count).SubItems(1
) = .Fields("USER_NAME")

Me.lvwUser.ListItems(Me.lvwUser.ListItems.Count).SubItems(2
) = .Fields("Password")

.MoveNext

121
San Carlos Computer World Payroll System
Perpetual Help College of Pangasinan
Malasiqui, Pangasinan

Loop

End With

Exit Sub

eh:

MsgBox err.Description, vbCritical

End Sub

Private Sub lvwUser_ItemClick(ByVal Item As


MSComctlLib.ListItem)

On Error GoTo eh

Set rsUsers = New ADODB.Recordset

With rsUsers

If .State = adStateOpen Then .Close

.Open "SELECT * FROM tblUser where ID = " &


Me.lvwUser.SelectedItem.Text, cn, adOpenKeyset,
adLockOptimistic

Me.txtName.Text = .Fields("USER_NAME")

Me.txtPass.Text = .Fields("Password")

Me.txtConfirm.Text = .Fields("Password")

End With

Exit Sub

eh:

MsgBox err.Description, vbCritical

End Sub

Private Sub txtConfirm_GotFocus()

hl_Text txtConfirm

122
San Carlos Computer World Payroll System
Perpetual Help College of Pangasinan
Malasiqui, Pangasinan

End Sub

Private Sub txtConfirm_KeyPress(KeyAscii As Integer)

Select Case KeyAscii

Case vbKeyReturn

SendKeys vbTab

End Select

End Sub

Private Sub txtName_GotFocus()

hl_Text txtName

End Sub

End Select

End Sub

Private Sub txtPass_GotFocus()

hl_Text txtPass

End Sub

Private Sub txtPass_KeyPress(KeyAscii As Integer)

Select Case KeyAscii

Case vbKeyReturn

SendKeys vbTab

End Select

End Sub

123
San Carlos Computer World Payroll System
Perpetual Help College of Pangasinan
Malasiqui, Pangasinan

Figure 14. Back up Database form allows the admin to back


up all the data.

Public WithEvents clsBKU As clsHuffman

Private Sub cmdBackup_Click()

cmdBackup.Enabled = False

Me.cmdClose.Enabled = False

lblCBK.Caption = "Creating Database Backup..."

BackUpDB

End Sub

Private Sub cmdClose_Click()

Unload Me

End Sub

Private Sub clsBKU_Progress(Procent As Integer)

Prog.Value = Procent

End Sub

Private Sub Form_Unload(Cancel As Integer)

Set clsBKU = Nothing

End Sub

124
San Carlos Computer World Payroll System
Perpetual Help College of Pangasinan
Malasiqui, Pangasinan

Public Sub BackUpDB()

On Error GoTo err:

Dim FSO As New FileSystemObject

Dim sDBFN As String

Dim sDBTmpFN As String

If FSO.FolderExists(App.Path & "/Backup") = False Then

FSO.CreateFolder App.Path & "/Backup"

End If

sDBFN = App.Path & "/Backup/" & Format$(Date,


"yyyymmdd") & ".bak"

sDBTmpFN = sDBFN & Now - DateValue(Now) & GetTickCount

If FSO.FileExists(sDBTmpFN) = True Then

FSO.DeleteFile sDBTmpFN

End If

Prog.Visible = True

lblCBK.Visible = True

DoEvents

Set frm_Backup.clsBKU = New clsHuffman

frm_Backup.clsBKU.EncodeFile DBPathFileName, sDBTmpFN

If FSO.FileExists(sDBFN) = True Then

FSO.DeleteFile sDBFN

End If

FSO.MoveFile sDBTmpFN, sDBFN

Set FSO = Nothing

lblCBK.Caption = "Backup Complete"

125
San Carlos Computer World Payroll System
Perpetual Help College of Pangasinan
Malasiqui, Pangasinan

Me.cmdClose.Enabled = True

Exit Sub

err:

MsgBox err.Description, vbCritical

End Sub

Private Sub Prog_MouseDown(Button As Integer, Shift As


Integer, X As Single, Y As Single)

End Sub

Figure 15. Restore Database form allows the admin to


restore all the data.

Option Explicit

Dim BFPath As String

Private WithEvents clsHuf As clsHuffman

Private Sub clsHuf_Progress(Procent As Integer)

progCopy.Value = Procent

126
San Carlos Computer World Payroll System
Perpetual Help College of Pangasinan
Malasiqui, Pangasinan

End Sub

Private Sub cmdCancel_Click()

Unload Me

End Sub

Private Sub cmdDelete_Click()

Dim FSO As New FileSystemObject

Dim li As ListItem

If listBF.ListItems.Count < 1 Then

MsgBox "There is no Backup File to delete.",


vbExclamation

Unload Me

GoTo ReleaseAndExit

End If

If MsgBox("Deleting file cannot be undo. Do you want


continue deleting Backup File/s", vbQuestion + vbOKCancel +
vbDefaultButton2) = vbOK Then

On Error GoTo errh:

For Each li In listBF.ListItems

If li.Selected = True Then

FSO.DeleteFile BFPath & "\" & li.Text, True

End If

Next

End If

RefreshBF

ReleaseAndExit:

Set FSO = Nothing

127
San Carlos Computer World Payroll System
Perpetual Help College of Pangasinan
Malasiqui, Pangasinan

Set li = Nothing

Exit Sub

errh:

Resume ReleaseAndExit

End Sub

Private Sub cmdGetBF_Click()

bgBF.Visible = False

bgStep(1).Visible = False

bgStep(0).Visible = True

End Sub

Private Sub cmdNext1_Click()

If listBF.ListItems.Count < 1 Then

MsgBox "There is no Backup File to restore.",


vbExclamation

Unload Me

GoTo ReleaseAndExit

End If

txtBF.Text = BFPath & "\" & listBF.SelectedItem.Text

lblBFCaption = "Backup File to restore: " &


listBF.SelectedItem.Text & vbNewLine & _

"Size: " &


listBF.SelectedItem.SubItems(1) & vbNewLine & _

"Last Modified: " &


listBF.SelectedItem.SubItems(2)

bgStep(0).Visible = False

bgBF.Visible = True

bgStep(1).Visible = True

128
San Carlos Computer World Payroll System
Perpetual Help College of Pangasinan
Malasiqui, Pangasinan

ReleaseAndExit:

End Sub

Private Sub cmdStart_Click()

Dim stmpFP As String

Dim FSO As New FileSystemObject

If listBF.ListItems.Count < 1 Then

MsgBox "There is no Backup File to restore.",


vbExclamation

GoTo ReleaseAndExit

End If

If Not FSO.FileExists(txtBF.Text) Then

MsgBox "Please enter valid backup file name",


vbExclamation

GoTo ReleaseAndExit

End If

cmdCancel.Enabled = False

lblStartMsg.Visible = False

progCopy.Visible = True

cmdStart.Enabled = False

Set clsHuf = New clsHuffman

stmpFP = FSO.GetSpecialFolder(2).Name &


"DIMS1tmpCF.tmp"

On Error GoTo errh

If FSO.FileExists(stmpFP) = True Then

FSO.DeleteFile stmpFP

End If

129
San Carlos Computer World Payroll System
Perpetual Help College of Pangasinan
Malasiqui, Pangasinan

clsHuf.DecodeFile txtBF.Text, stmpFP

progCopy.Visible = False

lblStartMsg.Caption = "Copying File, please wait..."

lblStartMsg.Visible = True

DoEvents

If MsgBox("Do you want to overwrite the current


Database file wth this newly restored file?", vbQuestion +
vbOKCancel) = vbOK Then

Mod_Con.cn.Close

If FSO.FileExists(Mod_Con.DBPathFileName) = True
Then

FSO.DeleteFile Mod_Con.DBPathFileName

End If

FSO.MoveFile stmpFP, Mod_Con.DBPathFileName

If Mod_Con.ConnectToServer = True Then

MsgBox "The backup file was successfully


restored and it is now ready to use.", vbInformation

End If

Unload Me

Else

lblStartMsg.Caption = "Click 'Start' button to


continue restoring file."

lblStartMsg.Visible = True

progCopy.Visible = False

End If

ReleaseAndExit:

130
San Carlos Computer World Payroll System
Perpetual Help College of Pangasinan
Malasiqui, Pangasinan

Set FSO = Nothing

progCopy.Visible = False

progCopy.Visible = False

cmdCancel.Enabled = True

cmdStart.Enabled = True

Exit Sub

errh:

Resume ReleaseAndExit

End Sub

Private Sub RefreshBF()

Dim FSO As New FileSystemObject

Dim FFolder As Folder

Dim FFile As File

listBF.ListItems.Clear

BFPath = App.Path & "\Backup"

If FSO.FolderExists(BFPath) = False Then

MsgBox "There is no Backup File to restore.",


vbExclamation

Unload Me

GoTo ReleaseAndExit

End If

Set FFolder = FSO.GetFolder(BFPath)

For Each FFile In FFolder.Files

listBF.ListItems.Add , , FFile.Name, 1, 1

With listBF.ListItems.Item(listBF.ListItems.Count)

131
San Carlos Computer World Payroll System
Perpetual Help College of Pangasinan
Malasiqui, Pangasinan

.SubItems(1) = FormatNumber(FFile.Size /
1048576, 1) & " MB"

.SubItems(2) = Format$(FFile.DateLastModified,
"MMM - dd - yyyy")

End With

Next

If listBF.ListItems.Count > 0 Then

cmdNext1.Enabled = True

cmdDelete.Enabled = True

Else

MsgBox "There is no Backup File to restore.",


vbExclamation

GoTo ReleaseAndExit

End If

ReleaseAndExit:

Set FFile = Nothing

Set FSO = Nothing

Set FFolder = Nothing

End Sub

Private Sub Form_Load()

RefreshBF

End Sub

Private Sub Form_Unload(Cancel As Integer)

Set clsHuf = Nothing

End Sub

132
San Carlos Computer World Payroll System
Perpetual Help College of Pangasinan
Malasiqui, Pangasinan

Figure 16. About form allows the admin to see the system
information of the computer

Option Explicit

Const READ_CONTROL = &H20000

Const KEY_QUERY_VALUE = &H1

Const KEY_SET_VALUE = &H2

Const KEY_CREATE_SUB_KEY = &H4

Const KEY_ENUMERATE_SUB_KEYS = &H8

Const KEY_NOTIFY = &H10

Const KEY_CREATE_LINK = &H20

Const KEY_ALL_ACCESS = KEY_QUERY_VALUE + KEY_SET_VALUE + _

KEY_CREATE_SUB_KEY +
KEY_ENUMERATE_SUB_KEYS + _

133
San Carlos Computer World Payroll System
Perpetual Help College of Pangasinan
Malasiqui, Pangasinan

KEY_NOTIFY + KEY_CREATE_LINK +
READ_CONTROL

Const HKEY_LOCAL_MACHINE = &H80000002

Const ERROR_SUCCESS = 0

Const REG_SZ = 1

Const REG_DWORD = 4

Const gREGKEYSYSINFOLOC = "SOFTWARE\Microsoft\Shared Tools


Location"

Const gREGVALSYSINFOLOC = "MSINFO"

Const gREGKEYSYSINFO = "SOFTWARE\Microsoft\Shared


Tools\MSINFO"

Const gREGVALSYSINFO = "PATH"

Private Declare Function RegOpenKeyEx Lib "advapi32" Alias


"RegOpenKeyExA" (ByVal hKey As Long, ByVal lpSubKey As
String, ByVal ulOptions As Long, ByVal samDesired As Long,
ByRef phkResult As Long) As Long

Private Declare Function RegQueryValueEx Lib "advapi32"


Alias "RegQueryValueExA" (ByVal hKey As Long, ByVal
lpValueName As String, ByVal lpReserved As Long, ByRef
lpType As Long, ByVal lpData As String, ByRef lpcbData As
Long) As Long

Private Declare Function RegCloseKey Lib "advapi32" (ByVal


hKey As Long) As Long

Private Sub cmdSysInfo_Click()

Call StartSysInfo

End Sub

Private Sub cmdOK_Click()

Unload Me

End Sub

134
San Carlos Computer World Payroll System
Perpetual Help College of Pangasinan
Malasiqui, Pangasinan

Public Sub StartSysInfo()

On Error GoTo SysInfoErr

Dim rc As Long

Dim SysInfoPath As String

If GetKeyValue(HKEY_LOCAL_MACHINE, gREGKEYSYSINFO,
gREGVALSYSINFO, SysInfoPath) Then

ElseIf GetKeyValue(HKEY_LOCAL_MACHINE,
gREGKEYSYSINFOLOC, gREGVALSYSINFOLOC, SysInfoPath) Then

If (Dir(SysInfoPath & "\MSINFO32.EXE") <> "") Then

SysInfoPath = SysInfoPath & "\MSINFO32.EXE"

Else

GoTo SysInfoErr

End If

Else

GoTo SysInfoErr

End If

Call Shell(SysInfoPath, vbNormalFocus)

Exit Sub

SysInfoErr:

MsgBox "System Information Is Unavailable At This


Time", vbOKOnly

End Sub

135
San Carlos Computer World Payroll System
Perpetual Help College of Pangasinan
Malasiqui, Pangasinan

Public Function GetKeyValue(KeyRoot As Long, KeyName As


String, SubKeyRef As String, ByRef KeyVal As String) As
Boolean

Dim i As Long

Dim rc As Long

Dim hKey As Long

Dim hDepth As Long

Dim KeyValType As Long

Dim tmpVal As String

Dim KeyValSize As Long

rc = RegOpenKeyEx(KeyRoot, KeyName, 0, KEY_ALL_ACCESS,


hKey)

If (rc <> ERROR_SUCCESS) Then GoTo GetKeyError

tmpVal = String$(1024, 0)

KeyValSize = 1024

rc = RegQueryValueEx(hKey, SubKeyRef, 0, _

KeyValType, tmpVal, KeyValSize)

If (rc <> ERROR_SUCCESS) Then GoTo GetKeyError

If (Asc(Mid(tmpVal, KeyValSize, 1)) = 0) Then

tmpVal = Left(tmpVal, KeyValSize - 1)

Else

tmpVal = Left(tmpVal, KeyValSize)

End If

Select Case KeyValType

Case REG_SZ

KeyVal = tmpVal

136
San Carlos Computer World Payroll System
Perpetual Help College of Pangasinan
Malasiqui, Pangasinan

Case REG_DWORD

For i = Len(tmpVal) To 1 Step -1

KeyVal = KeyVal + Hex(Asc(Mid(tmpVal, i, 1)))

Next

KeyVal = Format$("&h" + KeyVal)

End Select

GetKeyValue = True

rc = RegCloseKey(hKey)

Exit Function

GetKeyError:

KeyVal = ""

GetKeyValue = False

rc = RegCloseKey(hKey)

End Function

137
San Carlos Computer World Payroll System
Perpetual Help College of Pangasinan
Malasiqui, Pangasinan

Figure 17. Print Employee Information form allows the admin


to print the employee’s information.

Figure 18. Print Daily Time Record form allows the admin to
print the employee’s daily time record.

138
San Carlos Computer World Payroll System
Perpetual Help College of Pangasinan
Malasiqui, Pangasinan

Figure 19.Print Pay slip form allows the admin to print the
employee’s pay slip record.

139
San Carlos Computer World Payroll System
Perpetual Help College of Pangasinan
Malasiqui, Pangasinan

Pictures of the Company

Figure 20.Outside the San Carlos Computer World.

Figure 21.Inside the San Carlos Computer World.

140
San Carlos Computer World Payroll System

You might also like