0% found this document useful (0 votes)
287 views

Employee Management System: Background Study

The document describes an employee management system project that aims to make maintaining employee records easier and more efficient. The existing manual system of writing records in a register was time-consuming for tasks like adding, deleting or editing records. The new proposed computerized system would use Visual Basic as the front-end interface and MS Access as the back-end database to allow easy, fast and flexible management of employee data through features like adding, deleting and editing records with a click of a button. The system would also allow easy retrieval of information to improve work efficiency.

Uploaded by

deepak_143
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
287 views

Employee Management System: Background Study

The document describes an employee management system project that aims to make maintaining employee records easier and more efficient. The existing manual system of writing records in a register was time-consuming for tasks like adding, deleting or editing records. The new proposed computerized system would use Visual Basic as the front-end interface and MS Access as the back-end database to allow easy, fast and flexible management of employee data through features like adding, deleting and editing records with a click of a button. The system would also allow easy retrieval of information to improve work efficiency.

Uploaded by

deepak_143
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 71

Employee Management System

INTRODUCTION
Background study-
This Project is based on the employee management system of any company or
shop. the owner of the shop is maintain record of employees and workers on daily basis
and this project will help him to maintain the record of an employee in a easily and a
quickly manner, with the help of these software records were updated, edited, added,
deleted very easily.

The organization profile-


The main work of this organization is maintaining the records of employees and
the work of maintaining records is done on the register.

Study of the existing system-


The method of maintaining the record in the organization is by writing all details in
register but in these they find some difficulty to add new records, delete any existing
record or for editing (or) doing any changes in records. If they want to do any of the
above tasks, they are writing the whole things again and it will take time also.

Project overview-
The project is highly flexible and is well efficient for managing all information
about the employee. The key focus is: well management of data and easy retrieval of
information. The speed and accuracy should be maintained in a proper way. Changes can
be done very easily using the facility and flexibility in V.B. 6.0 and access 2007. The
software can be developed in a neat and simple manner hence it reduces operator’s
work.

Page 1
Employee Management System
Objective of the project-
The main goal of this project is to make the record of employee’s easier & quicker.

 It is situated for all level of peoples.


 It provides proper details about the entire employee & their posts.
 User friendly environment makes the data handling more easily.
 It easily provides an environment where the user can get information
about all the employees/workers.

Page 2
Employee Management System

PROBLEM ANALYSIS
Study of the proposed system:
This system consists of different table which contains the record of employees & it
is commented through VB which is the front end. In VB we have seen the information
about the employee. You can also provided the different buttons like, add, delete, edit,
exit etc, which helps you to edit any data & make your work easier.

Problem definition:
In the old system the main task of editing is not done easily & it will also take time.
But in the proposed system the main assumptions are, the system should already
contains all the hardware’s & software’s as well as the person who use this product
should familiar with win 98 or win xp or any operating system.

Solution strategies:
The main solution of the problem is to provide suitable & user friendly
environment to a user so that the user can maintain the detail of employee in a very easy
manner.

Page 3
Employee Management System

SYSTEM REQUIREMENT

Hardware Requirement
The configuration given below is the Hardware handled for the system development.
Processor : PENTIUM III or Above
Primary Memory (RAM) : 64 MB or Above
Secondary Memory (Hard disk) : 20 GB or Above
Monitor : COLOR, 15inch or above
Display card : SVGA
Mouse : Any Company
Cabinet : Mini tower ATX

Software Requirement
Operating System : Windows 98 or above
Front End tool : Visual Basic 6.0
Back End tool : MS-Access

Page 4
Employee Management System

SOFTWARE JUSTIFICATION

Front End tool


Visual Basic 6.0
Microsoft Visual Basic 6.0 is the powerful programming language to develop
application for windows. Windows is the operating system, which runs based on
messages and with rich user interface. Here are little details about how windows works
and programming model using Visual Basic.

How Windows Works


WINDOWS, EVENTS AND MESSAGES
Windows involves three key concepts: windows, events and messages. Think of a
window as a rectangular region with its own boundaries. For example, Explorer window in
Windows, a Document window within word processing program, or a dialog box that
pops up to remind you of an appointment. A command button is also a window. Icons,
text boxes, option buttons and menu are all windows.

The Microsoft Windows operating system manages all of these many windows by
assigning each one a unique id number (window handle or hWnd). The system continually
monitors each of these windows for signs of activity or events. Events can occur through
user actions such as a mouse click or a key press, through programmatic control, or even
as a result of another window’s actions.

Each time an event occurs, it causes a message to be sent to the operating system.
The system processes the message and broadcasts it to the other windows. Each window
can then take the appropriate action based on its own instructions for dealing with that
particular message (for example, repainting itself when it has been uncovered by another
window).

Page 5
Employee Management System
Dealing with all of the possible combinations of windows, events and messages could be
very difficult. Many of the messages are handled automatically by Visual Basic; others are
exposed as event procedures for our convenience. This allows us to quickly create
powerful applications without having to deal with unnecessary details.

UNDERSTANDING THE EVENT-DRIVEN MODEL


In traditional or “procedural” applications, the application itself controls which
portions of code execute and in what sequence. Execution starts with the first line of
code and follows a predefined path through the application, calling procedures as
needed.

In an event-driven application, the code doesn’t follow a predetermined path – it


executes different code sections in response to events. Events can be triggered by the
user’s actions, by messages from the system or other applications, or even from the
application itself. The sequence of these events determines the sequence in which the
code executes, thus the path through the application’s code differs each time the
program runs.

Because we can’t predict the sequence of events, our code must make certain
assumptions about the “state of the world” when it executes. When we make
assumptions (for example, that an entry field must contain a value before running a
procedure to process that value), we should structure our application in such a way as to
make sure that the assumption will always be valid (for example, disabling the command
button that starts the procedure until the entry field contains a value).

Our code can also trigger events during execution. For example, programmatically
changing the text in a text box cause the text box’s Change event to execute. If you
assumed that this event would only be triggered by user information, you might see

Page 6
Employee Management System
unexpected results. That’s why it is very important to understand the event-driven model
and keep it in mind when we design the application.

INTERACTIVE DEVELOPMENT
The traditional application development process can be broken into three distinct
steps: code writing, compiling the code, and testing code. Unlike traditional languages,
Visual Basic uses an interactive approach to development, blurring the distinction
between the three steps.

With most languages, if we make a mistake in writing the code, the compiler
catches the error when we start to compile the application. We must then find and fix
the error and begin the compile cycle again, repeating the process for each error found.
Visual Basic interprets the code as we enter it, catching and highlighting most syntax or
spelling errors on the fly. It’s almost like having an expert watching over our shoulder as
we write the code.

In addition to catching errors on the fl, Visual Basic also partially compiles the
code as it is entered. When the code is ready to run and test the application, there is only
a brief delay to finish compiling. If the compiler finds an error, it is highlighted in the
code. We can fix the error and continue compiling without having to start over.
Because of the interactive nature of Visual Basic, we can’t test the effects of the code as
we work rather than waiting to compile later.

USER INTERFACE ELEMENTS


Visual Basic provides us a lot of User Interface elements, which are easier to
create and use. For example Forms, Menus, dialog boxes and supporting controls such as
Check Box, List Box, Edit Box, Etc.

Page 7
Employee Management System
DATA BASE CONNECTIVITY
Visual Basic supports a lot for data base connectivity; we can use ODBC to connect
with different databases like Oracle, Sybase, Etc. And we have use DAO (Data Access
Objects) mainly used for Microsoft’s jet data base engine. We can use ADO and RDO to
access databases, the following explains about ADO and RDO.

ACTIVE X DATA OBJECTS (ADO)


Active X Data objects (ADO) enable client applications to access and manipulate
data from a database server through an OLE DB provider. Its primary benefits are ease of
use, high speed, low memory overhead, and a small disk footprint. ADO supports key
features for building client/server and Web-based applications.
ADO also features Remote Data Service (RDS), by which we an move data from a server to
a client application or Web page, manipulate the data on the client, and return updates to
the server in a single round trip.

REMOTE DATA OBJECTS (RDO)


RDO is a popular way to build efficient data access to relational ODBC databases.
With RDO, we can create simple cursor less result sets, or more complex batch or client-
side cursors. We can limit the number or rows returned and monitor all of the messages
and errors generated by the remote data source without compromising the executing
query.

One of the important features in RDO that is not available in DAO is the ability to
handle queries and stored procedures that return multiple result sets. This feature is
commonly used whenever required to load multiple controls (such as combo boxes) with
data from multiple tables. This feature eliminates the redundant processing and network
traffic overhead of using many separate queries.

Page 8
Employee Management System
DYNAMIC LINK LIBRARIES (DLL)
Dynamic Link Libraries (DLL) is linked dynamically as the program executes. Unlike
Static Link Libraries, these libraries provide us a lot of advantages. DLLs are executables,
which can be linked when required. And the main advantage is more than one
application can use the same DLLs. In Visual Basic we can create and use DLLs.

ACTIVE X CONTROLS
An ActiveX control is an execution to the Visual Basic Toolbox. We can use Active
X controls just like any of the standard built-in controls, such as the Check Box control.
When we add is Active X control to a program, it becomes part of the development and
run-time environment and provides new functionality for the application.

Active X controls leverage our capabilities as a Visual Basic programmer by


retaining some familiar properties, events, and methods, such as the Name property,
which behave, as we would expect. Then, however, the Active X controls feature
methods and properties that greatly increase our flexibility and capability as a Visual Basic
Programmer. We can create Active X control more easily in Visual Basic.
Back End Tool
MS-Access
On a program of software that can help us to access data and perform operations
it is called a “Data Base Management System”. The DBMS whose design is based on the
Relational Theory is called “The Relational Database Management System” or RDBMS.

MS-Access is a RDBMS, offers capabilities of both Relational and Object Oriented


database systems. It supports very large databases that could contain hundreds of
terabytes of information. The records are represented in a flat two dimensional table with
rows and columns. Each column has an unique name. All elements in each column are of
same kind.

Page 9
Employee Management System
MS-Access provides access too many concurrent users to the order of thousands
managing large amount of data could present administrative and performance
challenges.

MS-Access is the default backend for Visual Basic. Creating tables and making data
entries in MS-Access are made easier. It has the advantage of querying. It is faster in
retrieving data. The data can also be external to the database. It has enriched data types.

Page
10
Employee Management System

SYSTEM ANALYSIS AND DESIGN


Defining a System
Collections of components, which are interconnected, and work together to
realize some objective, form a system. There are three major components in every
system, namely input, processing and output.

Input Output

Processing

Systems Life Cycle


The sequencing of various activities required for developing and maintaining
systems in an ordered form is referred as Systems Life Cycle. It helps in establishing a
system project plan as it gives overall list of process and sub-processes required for
developing any system. Here, the systems life cycle will be discussed with reference to
the development of Employee Management System.
Broadly, following are the different activities to be considered while defining the systems
development cycle for the said project:
 Problem Definition
 Systems analysis
 Study of existing system
 Drawbacks of the existing system
 Proposed system
 Systems Requirement study
 Data flow analysis
 Feasibility study
 Systems design
 Input Design (Database & Forms)

Page
11
Employee Management System
 Updation
 Query /Report Design
 Administration
 Testing
 Implementation
 Maintenance

System Analysis
System analysis is a logical process; the objective of this phase is not actually to
solve the problem but to determine what must be done to solve the problem. The basic
objective of the analysis stage is to develop the logical model of the system using tools
such as the data flow diagram and elementary data description of the elementary
algorithm. The logical model is Subject to review by both the management and the user
who agree that the model does in fact reflect what should be done to solve the problem.
System analysis is not a precise science. It is in fact more of an art, aided by scientific
approach to find definition and recording data, gathering traditional structures is only one
part of the system analysis, the next step is to examine the data, assess the situation and
looking at the alternatives.

Analysis and development of the actual solution


A complete understanding of the requirement for the new system is very
important for the successful development of a software product. Requirement
Specification is the foundation in the process of software development .All further
developments like system analysis; designing and coding will depend on how accurate
and well documented the Requirement Specification is.

Requirement specification appears to be a relatively simple task, but appearance is often


deceiving. There is always a chance of wrong specification because of communication
gap between the user and the Developer. Requirement Specification begins with a clear

Page
12
Employee Management System
statement of the problem and the task to be performed. Then the requirement is
described in a technical manner in precise statements. After the initial specification
reports are received, they are analyzed and redefined through customer interaction.

Feasibility Study
The main objective of the feasibility study is to treat the technical, Operational,
logical and economic feasibility of developing the computerized system. All systems are
feasible, given unlimited resources and infinite time. It is both necessary and prudent to
evaluate the feasibility of the project at System study phase itself. The feasibility study to
be conduced for this project Involves.
1. Technical Feasibility
2. Operational Feasibility
3. Economic Feasibility
4. Logical Feasibility

Technical Feasibility
Technical feasibility includes Risk Resources availability and technologies. The
management provides latest hardware and software facilities for the successful
completion of the projects. With these latest hardware and software support the system
will perform extremely well. The system is available through Internet.

Operational Feasibility
In the existing manual system it is very difficult to maintain and update huge
amount of information. The development of the system was started because of the
requirement put forward by the management of the concerned department. This system,
will handles the request in a better way and make the process easier thus, it is sure that
the system developed is operationally feasible.

Page
13
Employee Management System
Economic Feasibility
In the economic feasibility the development cost of the system is evaluated
weighing it against the ultimate benefit derived from the new system. It is found that the
benefit, from the new system would be more than the cost and time involved in its
development.

Legal Feasibility
In the legal feasibility it is necessary to check that the software we are going to
develop is legally correct which means that the ideas which we have taken for the
proposed system will be legally implemented or not. So, it is also an important step in
feasibility study.

Page
14
Employee Management System

Design Notations
Data Flow Diagram

Report1

Login

Personal_Detail Change_Password

Employee
Detail

Employee
Professional_Detail Detail Salary_Detail

Report2
Report3

Professional_Detail
Salary_Detail

Report2
Report3

Page
15
Employee Management System
E-R diagram

1. Employee’s Personal Detail.

Qualification Emp_Id D_O_B

Name
Address_Local_
Guardian

Age

Name_Local_
Guardian Nationalit
y
Personal_Detail

Mother’s_Nam Address
e

Occupation Father’s_Nam Phone_n


e o

Page
16
Employee Management System
2. Employee’s Professional Detail.

D_o_j Emp_Id Departmen


t

Experience Designation

Professional_Detail

3. Employee’s Salary Detail.

Emp_Id
TA Basic_Sala
ry

DA HRA

Salary_Detail

Page
17
Employee Management System

4. Login Form.

User_name Password

Login

5. Change Password

User_name New_Passwor
d

Password Retype_Ne
w_Passwor
d

Salary_Detail

Page
18
Employee Management System
INPUT DESIGN
Errors committed by data entry operator can be controlled by the input design.
The following approaches have been incorporated into the input design of the proposed
system.

MENU
A menu is a selection list that simplifies the data entry the user can choose from a
list of option, by typing the option letter associated with option in position where the
cursor is located.

This project has both Graphical Menu and also Pull down Menu Graphical Menu is
designed in such a way that, if the user moves the mouse cursor above the main option –
sub options displayed automatically.

FORMATTED SCREEN
Data entry screens have been designed which are similar in formatting source
documents. Help screens have been designed the user to enter data without confusion.

DATA VALIDATION
The input data are validated to minimize errors validation is done. In certain cases
validation is made to check whether the given data is numeric or not.

USER FRIENDLINESS
Appropriate messages are provided to the user to inform of what is happening.
Errors are used to indicate the error code and specific error message.

CONSISTENT FORMAT
A fixed format is adopted for displaying the title and the messages. Each screen
has a status line, which displays the operation that can be performed after data entry.

Page
19
Employee Management System
INTERACTIVE DIALOGUE
The system participates in interactive dialogue and is able to cope with missing or
omitted information. It covers the dialogue by retaining adequate information between
each dialogue.

OUTPUT DESIGN
It is necessary that the output reports be compatible format with the manual
reports. The output has been designed in mind. Output design is the basis by which
many users evaluate the usefulness of the system. The output forms used in this
software are required for query response and reports. The emphasis is required for
producing the hard copy of the information requested or displaying the output on a CRT
screen.

Page
20
Employee Management System

DATABASE STRUTURE

Employee Entry

Department Name

Page
21
Employee Management System
Attendance Entry

Pay slip

Page
22
Employee Management System

CODING
Login

Option Explicit

Public LoginSucceeded As Boolean

Private Sub cmdCancel_Click()


'set the global var to false
'to denote a failed login
LoginSucceeded = False
Me.Hide
End Sub

Private Sub cmdOK_Click()


'check for correct password
If txtUserName = "anoop" And txtPassword = "password" Then
'place code to here to pass the
'success to the calling sub
'setting a global var is the easiest
LoginSucceeded = True
Me.Hide
MDIForm1.Show
Else
MsgBox "Invalid Password, try again!", , "Login"
txtPassword.SetFocus
SendKeys "{Home}+{End}"
End If
End Sub

MDI Main Form

Private Sub areport_Click(Index As Integer)


Attendence_report.Show

End Sub

Private Sub backup_Click(Index As Integer)


backup_fm.Show
End Sub

Private Sub dentry_Click(Index As Integer)

Page
23
Employee Management System
Department_entry.Show
End Sub

Private Sub eattandence_Click(Index As Integer)


Attendence_entry.Show
End Sub

Private Sub eentry_Click(Index As Integer)


Employee_entry.Show
Employee_entry.add.SetFocus

End Sub

Private Sub empdetail_Click(Index As Integer)


Employee_detail_report.Show
End Sub

Private Sub exit_Click(Index As Integer)


End
End Sub

Private Sub monthly_pay_report_Click(Index As Integer)


pay_slip_report.Show
End Sub

Private Sub pay_slip_Click(Index As Integer)


pay_slip_fm.Show
End Sub

Employee Entry
Option Explicit
Dim cd As ADODB.Connection
Dim rsd As ADODB.Recordset
Dim rse As ADODB.Recordset
Dim rsen As ADODB.Recordset
Dim rssearch As ADODB.Recordset
Dim rsnamesearch As ADODB.Recordset
Dim count1 As Integer
Dim flagedit, flagsave As Integer

Private Sub Form_Load()

Me.eentry.Enabled = False

Page
24
Employee Management System
Me.searchframe.Visible = False

Me.delete.Enabled = False
Me.save.Enabled = False
Me.delete.Enabled = False
Me.edit.Enabled = False

flagedit = False
flagsave = False

Set cd = New ADODB.Connection


cd.Provider = "Microsoft.Jet.OLEDB.4.0;"
cd.Open App.Path & "\db1.mdb"

Set rse = New ADODB.Recordset


rse.Open "select * from employeeentry", cd, adOpenStatic, adLockOptimistic
rse.Requery
Set rsen = New ADODB.Recordset
rsen.Open "select * from employeeentry", cd, adOpenStatic, adLockOptimistic
rsen.Requery

Me.dname.Text = ""
Me.ename.Text = ""
Me.address.Text = ""
Me.city.Text = ""
Me.pincode.Text = ""
Me.phno_r.Text = ""
Me.salary.Text = ""
Me.jdate.Value = Now
Me.edu.Text = ""
Me.remark.Text = ""

End Sub
' ************ for adding record*********
Private Sub add_Click()
Me.searchframe.Visible = False
Me.eentry.Visible = True
Me.eentry.Enabled = True

Me.edit.Enabled = False

flagedit = False
flagsave = False

Page
25
Employee Management System

Me.dname.Enabled = True
Me.ename.Enabled = True
Me.address.Enabled = True
Me.city.Enabled = True
Me.pincode.Enabled = True
Me.phno_r.Enabled = True
Me.salary.Enabled = True
Me.edu.Enabled = True
Me.remark.Enabled = True
Me.phno_o.Enabled = True
Me.phno_m.Enabled = True

Me.dname.SetFocus
Me.delete.Enabled = False
Me.save.Enabled = True
'**** for combo entry****
Set rsd = New ADODB.Recordset
rsd.Open "select * from departmentname", cd, adOpenStatic, adLockOptimistic
If rsd.RecordCount = 0 Then
MsgBox "NO record for department"
Exit Sub
End If
count1 = 0
rsd.Requery

Me.dname.Clear
While (count1 < rsd.RecordCount)
Me.dname.AddItem (rsd.Fields(0))
count1 = count1 + 1
rsd.MoveNext
Wend
'********************
Me.dname.ListIndex = 0
Me.ename.Text = ""
Me.address.Text = ""
Me.city.Text = ""
Me.pincode.Text = ""
Me.phno_r.Text = ""
Me.salary.Text = ""
Me.edu.Text = ""
Me.remark.Text = ""

Page
26
Employee Management System
Me.phno_o.Text = ""
Me.phno_m.Text = ""

End Sub
Private Sub ename_keypress(KeyAscii As Integer)
Dim a As String
a = " abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
KeyAscii = Asc(Chr(KeyAscii))
If KeyAscii > 26 Then ' if it's not a control code
If InStr(a, Chr(KeyAscii)) = 0 Then
KeyAscii = 0
End If
End If
End Sub
Private Sub ename_lostfocus()
Set rse = New ADODB.Recordset
rse.Open "select * from employeeentry where ename='" & ename.Text & "'", cd,
adOpenStatic, adLockOptimistic
If rse.RecordCount > 0 Then
MsgBox "THIS NAME IS ALREADY STORED!!!"
ename.SetFocus
End If
End Sub
Private Sub city_keypress(KeyAscii As Integer)
Dim a As String
a = " abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
KeyAscii = Asc(Chr(KeyAscii))
If KeyAscii > 26 Then ' if it's not a control code
If InStr(a, Chr(KeyAscii)) = 0 Then
KeyAscii = 0
End If
End If
End Sub

Private Sub pincode_KeyPress(KeyAscii As Integer)


Dim strValid7 As String
strValid7 = "0123456789"
KeyAscii = Asc(Chr(KeyAscii))
If KeyAscii > 26 Then ' if it's not a control code
If InStr(strValid7, Chr(KeyAscii)) = 0 Then
KeyAscii = 0

Page
27
Employee Management System
End If
End If
End Sub
Private Sub phno_r_KeyPress(KeyAscii As Integer)
Dim strValid7 As String
strValid7 = "0123456789()-"
KeyAscii = Asc(Chr(KeyAscii))
If KeyAscii > 26 Then ' if it's not a control code
If InStr(strValid7, Chr(KeyAscii)) = 0 Then
KeyAscii = 0
End If
End If
End Sub
Private Sub phno_o_KeyPress(KeyAscii As Integer)
Dim strValid7 As String
strValid7 = "0123456789()-"
KeyAscii = Asc(Chr(KeyAscii))
If KeyAscii > 26 Then ' if it's not a control code
If InStr(strValid7, Chr(KeyAscii)) = 0 Then
KeyAscii = 0
End If
End If
End Sub
Private Sub phno_m_KeyPress(KeyAscii As Integer)
Dim strValid7 As String
strValid7 = "0123456789()-"
KeyAscii = Asc(Chr(KeyAscii))
If KeyAscii > 26 Then ' if it's not a control code
If InStr(strValid7, Chr(KeyAscii)) = 0 Then
KeyAscii = 0
End If
End If
End Sub
Private Sub salary_KeyPress(KeyAscii As Integer)
Dim strValid7 As String
strValid7 = "0123456789"
KeyAscii = Asc(Chr(KeyAscii))
If KeyAscii > 26 Then ' if it's not a control code
If InStr(strValid7, Chr(KeyAscii)) = 0 Then
KeyAscii = 0
End If
End If
End Sub

Page
28
Employee Management System
Private Sub remark_keypress(KeyAscii As Integer)
Dim a As String
a = " abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789./-"
KeyAscii = Asc(Chr(KeyAscii))
If KeyAscii > 26 Then ' if it's not a control code
If InStr(a, Chr(KeyAscii)) = 0 Then
KeyAscii = 0
End If
End If
End Sub
Private Sub save_Click()
If flagsave = False Then
If flagedit = False Then

If Me.dname.Text = "" Then


MsgBox "ENTER ENOUGH DATA!!"
Exit Sub
End If
If Me.ename.Text = "" Then
MsgBox "ENTER ENOUGH DATA!!"
Exit Sub
End If

If Me.address.Text = "" Then


Me.address.Text = "-"
End If

If Me.city.Text = "" Then


Me.city.Text = "-"
End If

If Me.pincode.Text = "" Then


Me.pincode.Text = "0"
End If

If Me.phno_r.Text = "" Then


Me.phno_r.Text = "0"
End If
If Me.phno_o.Text = "" Then
Me.phno_o.Text = "0"
End If
If Me.phno_m.Text = "" Then
Me.phno_m.Text = "0"

Page
29
Employee Management System
End If
If Me.salary.Text = "" Then
Me.salary.Text = "0"
End If

If Me.remark.Text = "" Then


Me.remark.Text = "-"
End If
rse.AddNew

rse.Fields(0) = Me.dname.Text
rse.Fields(2) = Me.ename.Text
rse.Fields(3) = Me.address.Text
rse.Fields(4) = Me.city.Text
rse.Fields(5) = Me.pincode.Text
rse.Fields(6) = Me.phno_r.Text
rse.Fields(7) = Me.salary.Text
Me.jdate.Value = Format$(Me.jdate.Value, "d/M/yyyy")
rse.Fields(8) = Format$(Me.jdate.Value, "dd/mmm/yyyy")
rse.Fields(9) = Me.edu.Text
rse.Fields(10) = Me.remark.Text
rse.Fields(11) = Me.phno_o.Text
rse.Fields(12) = Me.phno_m.Text
Else
rse.MoveFirst
While (Not rse.EOF)
If (Me.lstename.Text = rse.Fields(2)) Then
rse.delete
rse.Update
flagedit = False
End If
rse.MoveNext
Wend
rse.AddNew
rse.Fields(0) = Me.lstdname.List(Me.lstdname.ListIndex)
rse.Fields(2) = Text1.Text
rse.Fields(3) = Me.lbladdress.Text
rse.Fields(4) = Me.lblcity.Text
rse.Fields(5) = Me.lblpincode.Text
rse.Fields(6) = Me.lblphno_r.Text
rse.Fields(7) = Me.lblsalary.Text
Me.lbljdate.Text = Format$(Me.lbljdate.Text, "d/M/yyyy")
rse.Fields(8) = Format$(Me.lbljdate.Text, "dd/mmm/yyyy")

Page
30
Employee Management System
rse.Fields(9) = Me.lbledu.Text
rse.Fields(10) = Me.lblremark.Text
rse.Fields(11) = Me.phno_o.Text
rse.Fields(12) = Me.phno_m.Text
Me.Text1.Visible = False
End If
flagsave = True
rse.Update
rse.Requery
MsgBox "record has been saved"
Me.save.Enabled = False
Me.edit.Enabled = False
Me.delete.Enabled = False
Else
MsgBox "record already saved"
End If

Me.dname.Text = ""
Me.ename.Text = ""
Me.address.Text = ""
Me.city.Text = ""
Me.pincode.Text = ""
Me.phno_r.Text = ""
Me.salary.Text = ""
Me.edu.Text = ""
Me.remark.Text = ""
Me.phno_o.Text = ""
Me.phno_m.Text = ""

Me.add.SetFocus
Me.eentry.Enabled = False

End Sub
Private Sub delete_Click()
Dim employee_no, i As Integer

i = MsgBox("Do You Want To Delete This Employee Name:" +


Me.lstename.List(Me.lstename.ListIndex) + "", vbQuestion + vbYesNo, "Deleting Record")
If (i = vbYes) Then
If rse.RecordCount <> 0 Then
While (rse.EOF)
If (Me.lstename.Text = rse.Fields(2)) Then
rse.delete

Page
31
Employee Management System
rse.Update
MsgBox "record has been deleted"
End If
rse.MoveNext
Wend

Me.lbladdress.Text = ""
Me.lblcity.Text = ""
Me.lblpincode.Text = ""
Me.lblphno_r.Text = ""
Me.lblsalary.Text = ""
Me.lbljdate.Text = ""
Me.lbledu.Text = ""
Me.lblremark.Text = ""
Me.lblphno_o.Text = ""
Me.lblphno_m.Text = ""

End If
End If

Me.delete.Enabled = False
Me.edit.Enabled = False

End Sub

Private Sub first_Click()


Me.delete.Enabled = False
Me.edit.Enabled = False

Me.searchframe.Visible = False
Me.eentry.Enabled = True
Me.eentry.Visible = True

If (rsen.RecordCount = 0) Then
MsgBox "No record"
Exit Sub
End If

If (rsen.BOF = False) Then


rsen.Requery
rsen.MoveFirst

Page
32
Employee Management System
Me.dname.List(0) = rsen.Fields(0)
Me.ename.Text = rsen.Fields(2)
Me.address.Text = rsen.Fields(3)
Me.city.Text = rsen.Fields(4)
Me.pincode.Text = rsen.Fields(5)
Me.phno_r.Text = rsen.Fields(6)
Me.salary.Text = rsen.Fields(7)
Me.jdate.Value = Format$(rsen.Fields(8), "dd/mm/yyyy")
Me.edu.Text = rsen.Fields(9)
Me.remark.Text = rsen.Fields(10)
Me.phno_o.Text = rsen.Fields(11)
Me.phno_m.Text = rsen.Fields(12)

End If
Me.dname.Enabled = False
Me.ename.Enabled = False
Me.address.Enabled = False
Me.city.Enabled = False
Me.pincode.Enabled = False
Me.phno_r.Enabled = False
Me.salary.Enabled = False
Me.edu.Enabled = False
Me.remark.Enabled = False
Me.phno_o.Enabled = False
Me.phno_m.Enabled = False

End Sub
Private Sub last_Click()
Me.delete.Enabled = False
Me.edit.Enabled = False

Me.searchframe.Visible = False
Me.eentry.Enabled = True
Me.eentry.Visible = True

If (rsen.RecordCount = 0) Then
MsgBox "No record"
Exit Sub
End If

If (rsen.EOF = False) Then


rsen.MoveLast
Me.dname.List(0) = rsen.Fields(0)

Page
33
Employee Management System
Me.ename.Text = rsen.Fields(2)
Me.address.Text = rsen.Fields(3)
Me.city.Text = rsen.Fields(4)
Me.pincode.Text = rsen.Fields(5)
Me.phno_r.Text = rsen.Fields(6)
Me.salary.Text = rsen.Fields(7)
Me.jdate.Value = Format$(rsen.Fields(8), "dd/mm/yyyy")
Me.edu.Text = rsen.Fields(9)
Me.remark.Text = rsen.Fields(10)
Me.phno_o.Text = rsen.Fields(11)
Me.phno_m.Text = rsen.Fields(12)
End If
Me.dname.Enabled = False
Me.ename.Enabled = False
Me.address.Enabled = False
Me.city.Enabled = False
Me.pincode.Enabled = False
Me.phno_r.Enabled = False
Me.salary.Enabled = False
Me.edu.Enabled = False
Me.remark.Enabled = False
Me.phno_o.Enabled = False
Me.phno_m.Enabled = False

End Sub
Private Sub privious_Click()
Me.delete.Enabled = False
Me.edit.Enabled = False

Me.searchframe.Visible = False
Me.eentry.Enabled = True
Me.eentry.Visible = True

If (rsen.RecordCount = 0) Then
MsgBox "No record"
Exit Sub
End If
rsen.MovePrevious
If (rsen.BOF = True) Then
rsen.MoveFirst
End If
Me.dname.List(0) = rsen.Fields(0)
Me.ename.Text = rsen.Fields(2)

Page
34
Employee Management System
Me.address.Text = rsen.Fields(3)
Me.city.Text = rsen.Fields(4)
Me.pincode.Text = rsen.Fields(5)
Me.phno_r.Text = rsen.Fields(6)
Me.salary.Text = rsen.Fields(7)
Me.jdate.Value = Format$(rsen.Fields(8), "dd/mm/yyyy")
Me.edu.Text = rsen.Fields(9)
Me.remark.Text = rsen.Fields(10)
Me.phno_o.Text = rsen.Fields(11)
Me.phno_m.Text = rsen.Fields(12)

Me.dname.Enabled = False
Me.ename.Enabled = False
Me.address.Enabled = False
Me.city.Enabled = False
Me.pincode.Enabled = False
Me.phno_r.Enabled = False
Me.salary.Enabled = False
Me.edu.Enabled = False
Me.remark.Enabled = False
Me.phno_o.Enabled = False
Me.phno_m.Enabled = False

End Sub
Private Sub next_Click()

Me.delete.Enabled = False
Me.edit.Enabled = False

Me.searchframe.Visible = False
Me.eentry.Enabled = True
Me.eentry.Visible = True

If (rsen.RecordCount = 0) Then
MsgBox "No record"
Exit Sub
End If
rsen.MoveNext
If (rsen.EOF = True) Then
rsen.MoveLast
End If
Me.dname.List(0) = rsen.Fields(0)

Page
35
Employee Management System
Me.ename.Text = rsen.Fields(2)
Me.address.Text = rsen.Fields(3)
Me.city.Text = rsen.Fields(4)
Me.pincode.Text = rsen.Fields(5)
Me.phno_r.Text = rsen.Fields(6)
Me.salary.Text = rsen.Fields(7)
Me.jdate.Value = Format$(rsen.Fields(8), "dd/mm/yyyy")
Me.edu.Text = rsen.Fields(9)
Me.remark.Text = rsen.Fields(10)
Me.phno_o.Text = rsen.Fields(11)
Me.phno_m.Text = rsen.Fields(12)

Me.dname.Enabled = False
Me.ename.Enabled = False
Me.address.Enabled = False
Me.city.Enabled = False
Me.pincode.Enabled = False
Me.phno_r.Enabled = False
Me.salary.Enabled = False
Me.edu.Enabled = False
Me.remark.Enabled = False
Me.phno_o.Enabled = False
Me.phno_m.Enabled = False

End Sub
Private Sub edit_Click()
flagedit = True
flagsave = False

Me.save.Enabled = True
Me.delete.Enabled = False

Me.eentry.Enabled = False
Me.eentry.Visible = False
Me.searchframe.Visible = True

Me.Text1.Visible = True
Me.Text1.Text = Me.lstename.List(Me.lstename.ListIndex)

Me.lbladdress.Enabled = True
Me.lblcity.Enabled = True
Me.lblpincode.Enabled = True
Me.lblphno_r.Enabled = True

Page
36
Employee Management System
Me.lblsalary.Enabled = True
Me.lbljdate.Enabled = True
Me.lbledu.Enabled = True
Me.lblremark.Enabled = True
Me.lblphno_o.Enabled = True
Me.lblphno_m.Enabled = True
Me.Text1.SetFocus
End Sub
Private Sub exit_Click()
Unload Me
End Sub
Private Sub cmdsearch_Click()
Me.searchframe.Visible = True
Me.searchframe.Enabled = True
Me.eentry.Visible = False

Me.delete.Enabled = True
Me.edit.Enabled = True
Me.save.Enabled = False

Me.lstdname.SetFocus
Me.lstdname.Clear

Set rssearch = New ADODB.Recordset


rssearch.Open "Select * from departmentname", cd, adOpenStatic, adLockOptimistic

While (rssearch.EOF = False)


Me.lstdname.AddItem (rssearch.Fields(0))
rssearch.MoveNext
Wend
End Sub
Private Sub lstdname_click()
Set rsnamesearch = New ADODB.Recordset
rsnamesearch.Open "Select * from employeeentry ", cd, adOpenStatic, adLockOptimistic
rsnamesearch.MoveFirst
Me.lstename.Clear
While (rsnamesearch.EOF = False)
If (rsnamesearch.Fields(0) = lstdname.Text) Then
Me.lstename.AddItem (rsnamesearch.Fields(2))
End If
rsnamesearch.MoveNext
Wend
Me.lbladdress.Text = ""

Page
37
Employee Management System
Me.lblcity.Text = ""
Me.lblpincode.Text = ""
Me.lblphno_r.Text = ""
Me.lblsalary.Text = ""
Me.lbljdate.Text = ""
Me.lbledu.Text = ""
Me.lblremark.Text = ""
Me.lblphno_o.Text = ""
Me.lblphno_m.Text = ""
End Sub
Private Sub lstename_click()
rsnamesearch.MoveFirst
rsnamesearch.Requery

While (rsnamesearch.EOF = False)


If (rsnamesearch.Fields(2) = Me.lstename.Text) Then
Me.lbladdress.Text = rsnamesearch.Fields(3)
Me.lblcity.Text = rsnamesearch.Fields(4)
Me.lblpincode.Text = rsnamesearch.Fields(5)
Me.lblphno_r.Text = rsnamesearch.Fields(6)
Me.lblsalary.Text = rsnamesearch.Fields(7)
Me.lbljdate.Text = Format$(rsnamesearch.Fields(8), "dd/mm/yyyy")
Me.lbledu.Text = rsnamesearch.Fields(9)
Me.lblremark.Text = rsnamesearch.Fields(10)
Me.lblphno_o.Text = rsnamesearch.Fields(11)
Me.lblphno_m.Text = rsnamesearch.Fields(12)

End If
rsnamesearch.MoveNext
Wend
Me.lbladdress.Enabled = False
Me.lblcity.Enabled = False
Me.lblpincode.Enabled = False
Me.lblphno_r.Enabled = False
Me.lblsalary.Enabled = False
Me.lbljdate.Enabled = False
Me.lbledu.Enabled = False
Me.lblremark.Enabled = False
Me.lblphno_o.Enabled = False
Me.lblphno_m.Enabled = False
End Sub
Attendance Entry
Option Explicit

Page
38
Employee Management System

Dim cd2 As ADODB.Connection


Dim rs2 As ADODB.Recordset

Dim rsd As ADODB.Recordset


Dim rse, rsf, rsg, rsh, rsi, rsj As ADODB.Recordset

Dim flagsave As Boolean


Dim flagedit As Boolean
Dim flagsearch As Boolean

Dim lunchtime, daytime, totaltime, thour, totalminute As Integer


Dim la, da As Date
Dim lb, db As Date
Dim strlunchtime As String

Dim count1 As Integer

Private Sub exit1_Click()


Unload Me
End Sub
Private Sub Form_Load()
Set cd2 = New ADODB.Connection
cd2.Provider = "Microsoft.Jet.OLEDB.4.0"
cd2.Open App.Path & "\db1.mdb"
Set rs2 = New ADODB.Recordset
rs2.Open "select * from attendenceentry", cd2, adOpenStatic, adLockOptimistic

Me.aentry.Enabled = False
Me.searchframe.Visible = False
Me.save.Enabled = False

flagsave = False
flagedit = False
flagsearch = False

Set rsd = New ADODB.Recordset


rsd.Open "select * from departmentname", cd2, adOpenStatic, adLockOptimistic

Set rse = New ADODB.Recordset

Page
39
Employee Management System
rse.Open "select * from employeeentry", cd2, adOpenStatic, adLockOptimistic

'******* fetch department name**********

While (rsd.EOF = False)


Me.dname.AddItem (rsd.Fields("dname"))
rsd.MoveNext
Wend
Me.DTPicker1.Value = Now
Me.DTPicker2.Value = Now

Me.atype.AddItem ("AB")
Me.atype.AddItem ("P")
Me.atype.AddItem ("HOLYDAY")

End Sub
Private Sub add_Click()
Me.searchframe.Visible = False

Me.aentry.Visible = True
Me.aentry.Enabled = True
Me.save.Enabled = True
Me.atype.Enabled = False
Me.dname.SetFocus

flagedit = False

End Sub
Private Sub dname_Click()
Me.searchframe.Visible = False
Me.ename.Clear
rse.MoveFirst
While (rse.EOF = False)
If (rse.Fields(0) = dname.Text) Then
Me.ename.AddItem (rse.Fields(2))
End If
rse.MoveNext
Wend
End Sub

Private Sub ename_Click()


Me.searchframe.Visible = False

Page
40
Employee Management System

Me.dstart.Text = "00:00:00 AM"


Me.dend.Text = "00:00:00 AM"
Me.lstart.Text = "00:00:00 AM"
Me.lend.Text = "00:00:00 AM"
If flagedit = True Then

Set rsf = New ADODB.Recordset


rsf.Open "select * from attendenceentry where date1='" & Format$
(DTPicker1.Value, "d/M/yyyy") & "' and ename='" & ename.Text & "'", cd2, adOpenStatic,
adLockOptimistic

rsf.Requery
If rsf.RecordCount = 0 Then
Else
rsf.MoveFirst
count1 = 0
While (count1 < rsf.RecordCount)
If ((Me.ename.Text) = (rsf.Fields(2))) Then
Me.atype.Text = rsf.Fields(4)
Me.avalue.Text = rsf.Fields(5)

If rsf.Fields(6) = "12:00:00 AM" Then


Me.dstart.Text = "00:00:00 AM"
Else
Me.dstart.Text = rsf.Fields(6)
End If

If rsf.Fields(7) = "12:00:00 AM" Then


Me.dend.Text = "00:00:00 AM"
Else
Me.dend.Text = rsf.Fields(7)
End If

If rsf.Fields(8) = "12:00:00 AM" Then


Me.lstart.Text = "00:00:00 AM"
Else
Me.lstart.Text = rsf.Fields(8)
End If

If rsf.Fields(9) = "12:00:00 AM" Then


Me.lend.Text = "00:00:00 AM"
Else

Page
41
Employee Management System
Me.lend.Text = rsf.Fields(9)
End If

Me.totalhour.Text = rsf.Fields(10)
End If
count1 = count1 + 1
rsf.MoveNext
Wend
End If
End If
Me.atype.Enabled = True
End Sub
Private Sub DTPicker1_closeup()
Me.searchframe.Visible = False

'********************************
If flagedit = True Then

Set rsf = New ADODB.Recordset


rsf.Open "select * from attendenceentry where date1='" & Format$
(DTPicker1.Value, "d/M/yyyy") & "' and ename='" & ename.Text & "' ", cd2, adOpenStatic,
adLockOptimistic

rsf.Requery
If rsf.RecordCount = 0 Then
Me.dstart.Text = ""
Me.dend.Text = ""
Me.lstart.Text = ""
Me.lend.Text = ""
Else
rsf.MoveFirst
count1 = 0
While (count1 < rsf.RecordCount)
If ((Me.ename.Text) = (rsf.Fields(2))) Then
Me.atype.Text = rsf.Fields(4)
Me.avalue.Text = rsf.Fields(5)

If rsf.Fields(6) = "12:00:00 AM" Then


Me.dstart.Text = "00:00:00 AM"
Else
Me.dstart.Text = rsf.Fields(6)
End If

Page
42
Employee Management System

If rsf.Fields(7) = "12:00:00 AM" Then


Me.dend.Text = "00:00:00 AM"
Else
Me.dend.Text = rsf.Fields(7)
End If

If rsf.Fields(8) = "12:00:00 AM" Then


Me.lstart.Text = "00:00:00 AM"
Else
Me.lstart.Text = rsf.Fields(8)
End If

If rsf.Fields(9) = "12:00:00 AM" Then


Me.lend.Text = "00:00:00 AM"
Else
Me.lend.Text = rsf.Fields(9)
End If

Me.totalhour.Text = rsf.Fields(10)
End If
count1 = count1 + 1
rsf.MoveNext
Wend
End If
End If
Me.atype.Enabled = True
End Sub
Private Sub DTPicker1_change()
Me.searchframe.Visible = False

If flagedit = True Then

Set rsf = New ADODB.Recordset


rsf.Open "select * from attendenceentry where date1='" & Format$(DTPicker1.Value,
"d/M/yyyy") & "' and ename='" & ename.Text & "' ", cd2, adOpenStatic, adLockOptimistic

rsf.Requery

If rsf.RecordCount = 0 Then
Me.dstart.Text = ""
Me.dend.Text = ""
Me.lstart.Text = ""

Page
43
Employee Management System
Me.lend.Text = ""
Else
rsf.MoveFirst
count1 = 0
While (count1 < rsf.RecordCount)
If ((Me.ename.Text) = (rsf.Fields(2))) Then
Me.atype.Text = rsf.Fields(4)
Me.avalue.Text = rsf.Fields(5)
If rsf.Fields(6) = "12:00:00 AM" Then
Me.dstart.Text = "00:00:00 AM"
Else
Me.dstart.Text = rsf.Fields(6)
End If

If rsf.Fields(7) = "12:00:00 AM" Then


Me.dend.Text = "00:00:00 AM"
Else
Me.dend.Text = rsf.Fields(7)
End If

If rsf.Fields(8) = "12:00:00 AM" Then


Me.lstart.Text = "00:00:00 AM"
Else
Me.lstart.Text = rsf.Fields(8)
End If

If rsf.Fields(9) = "12:00:00 AM" Then


Me.lend.Text = "00:00:00 AM"
Else
Me.lend.Text = rsf.Fields(9)
End If
Me.totalhour.Text = rsf.Fields(10)
End If
count1 = count1 + 1
rsf.MoveNext
Wend
End If
End If

Me.atype.Enabled = True
End Sub
Private Sub DTPicker1_lostfocus()
Me.searchframe.Visible = False

Page
44
Employee Management System

If flagedit = True Then

Set rsf = New ADODB.Recordset


rsf.Open "select * from attendenceentry where date1='" & Format$(DTPicker1.Value,
"d/M/yyyy") & "' and ename='" & ename.Text & "'", cd2, adOpenStatic, adLockOptimistic
rsf.Requery

If rsf.RecordCount = 0 Then
Me.dstart.Text = ""
Me.dend.Text = ""
Me.lstart.Text = ""
Me.lend.Text = ""
Else
rsf.MoveFirst
count1 = 0
While (count1 < rsf.RecordCount)
If ((Me.ename.Text) = (rsf.Fields(2))) Then
Me.atype.Text = rsf.Fields(4)
Me.avalue.Text = rsf.Fields(5)
If rsf.Fields(6) = "12:00:00 AM" Then
Me.dstart.Text = "00:00:00 AM"
Else
Me.dstart.Text = rsf.Fields(6)
End If

If rsf.Fields(7) = "12:00:00 AM" Then


Me.dend.Text = "00:00:00 AM"
Else
Me.dend.Text = rsf.Fields(7)
End If

If rsf.Fields(8) = "12:00:00 AM" Then


Me.lstart.Text = "00:00:00 AM"
Else
Me.lstart.Text = rsf.Fields(8)
End If

If rsf.Fields(9) = "12:00:00 AM" Then


Me.lend.Text = "00:00:00 AM"
Else
Me.lend.Text = rsf.Fields(9)
End If

Page
45
Employee Management System
Me.totalhour.Text = rsf.Fields(10)
End If
count1 = count1 + 1
rsf.MoveNext
Wend
End If
End If 'end of flag edit stat
Me.dstart.SetFocus
Me.atype.Enabled = True
End Sub
Private Sub atype_click()

If (dstart.Text = "00:00:00 AM" Or dstart.Text = "00:00:00 PM" Or dend.Text = "00:00:00


AM" Or dend.Text = "00:00:00 PM") Then
Me.totalhour.Text = ""
Else
If (lstart.Text = "00:00:00 AM" Or lstart.Text = "00:00:00 PM" Or lend.Text =
"00:00:00 AM" Or lend.Text = "00:00:00 PM") Then
lunchtime = 0
Else
la = Format$(lstart.Text, "HH:mm")
lb = Format$(lend.Text, "HH:mm")
lunchtime = DateDiff("n", la, lb)
End If
da = Format$(dstart, "HH:mm")
db = Format$(dend, "HH:mm")
daytime = DateDiff("n", da, db)

totaltime = daytime - lunchtime

thour = (totaltime / 60)


totalminute = (totaltime Mod 60)
strlunchtime = "" + Str(thour) + " h" + Str(totalminute) + " m"
Me.totalhour.Text = strlunchtime
End If

End Sub
Private Sub atype_gotfocus()

If (dstart.Text = "00:00:00 AM" Or dstart.Text = "00:00:00 PM" Or dend.Text = "00:00:00


AM" Or dend.Text = "00:00:00 PM") Then
Me.totalhour.Text = ""

Page
46
Employee Management System
Else
If (lstart.Text = "00:00:00 AM" Or lstart.Text = "00:00:00 PM" Or lend.Text =
"00:00:00 AM" Or lend.Text = "00:00:00 PM") Then
lunchtime = 0
Else
la = Format$(lstart.Text, "HH:mm")
lb = Format$(lend.Text, "HH:mm")
lunchtime = DateDiff("n", la, lb)
End If

da = Format$(dstart, "HH:mm")
db = Format$(dend, "HH:mm")
daytime = DateDiff("n", da, db)

totaltime = daytime - lunchtime

thour = (totaltime / 60)


totalminute = (totaltime Mod 60)
strlunchtime = "" + Str(thour) + " h" + Str(totalminute) + " m"
Me.totalhour.Text = strlunchtime
End If
End Sub
Private Sub avalue_click()
Me.searchframe.Visible = False

End Sub
Private Sub avalue_gotfocus()
Me.searchframe.Visible = False

Me.avalue.Clear
Me.avalue.AddItem ("1")
Me.avalue.AddItem ("0.5")
End Sub
Private Sub save_Click()

If Me.dname.Text = "" Then


MsgBox "ENTER ENOUGH DATA!!!"
Me.dname.SetFocus
Exit Sub
End If
If Me.ename.Text = "" Then
MsgBox "ENTER ENOUGH DATA!!!"

Page
47
Employee Management System
Me.ename.SetFocus
Exit Sub
End If

If Me.atype.Text = "" Then


Me.atype.Text = "-"
End If

If Me.avalue.Text = "" Then


Me.avalue.Text = "0"
End If

If Me.dstart.Text = "" Then


Me.dstart.Text = "00:00:00 AM"
End If

If Me.dend.Text = "" Then


Me.dend.Text = "00:00:00 AM"
End If

If Me.lstart.Text = "" Then


Me.lstart.Text = "00:00:00 AM"
End If

If Me.lend.Text = "" Then


Me.lend.Text = "00:00:00 AM"
End If

If Me.totalhour.Text = "" Then


Me.totalhour.Text = "0"
End If

If Me.atype.Text = "AB" Or Me.atype.Text = "HOLYDAY" Then


Me.dstart.Text = "00:00:00 AM"
Me.dend.Text = "00:00:00 AM"
Me.lstart.Text = "00:00:00 AM"
Me.lend.Text = "00:00:00 AM"
Me.avalue.Enabled = False
Else
Me.avalue.Enabled = True
End If

Page
48
Employee Management System
If flagedit = False Then
'*********** if record is already there
Set rsg = New ADODB.Recordset
rsg.Open "select * from attendenceentry where date1='" & Format$
(DTPicker1.Value, "d/m/yyyy") & "' ", cd2, adOpenStatic, adLockOptimistic
rsg.Requery

If (rsg.RecordCount = 0) Then
Else
rsg.MoveFirst
count1 = 0
While (count1 < rsg.RecordCount)
If ((Me.ename.Text) = (rsg.Fields(2))) Then
MsgBox "already in record"
Me.add.SetFocus
GoTo here
End If
count1 = count1 + 1
rsg.MoveNext
Wend
'*********************************
End If
rs2.AddNew
rs2.Fields(0) = Me.dname.Text
rs2.Fields(2) = Me.ename.Text
rs2.Fields(3) = Format$(Me.DTPicker1.Value, "dd/mmm/yyyy")
rs2.Fields(4) = Me.atype.Text
rs2.Fields(5) = Me.avalue.Text
rs2.Fields(6) = Me.dstart.Text
rs2.Fields(7) = Me.dend.Text
rs2.Fields(8) = Me.lstart.Text
rs2.Fields(9) = Me.lend.Text
rs2.Fields(10) = Me.totalhour.Text
rs2.Fields(11) = Format$(Me.DTPicker1.Value, "dd/M/yyyy")

rs2.Update

MsgBox "record has been saved"


Me.save.Enabled = False

ElseIf flagedit = True Then


'******* check for edit***
Set rsh = New ADODB.Recordset

Page
49
Employee Management System

rsh.Open "select * from attendenceentry where date1='" & Format$


(DTPicker1.Value, "d/M/yyyy") & "' ", cd2, adOpenStatic, adLockOptimistic

count1 = 0
rsh.Requery
While (count1 < rsh.RecordCount)
If ((Me.ename.Text) = (rsh.Fields(2))) Then
rsh.delete
End If
count1 = count1 + 1
rsh.MoveNext
Wend

'****************************
rs2.AddNew
rs2.Fields(0) = Me.dname.Text
rs2.Fields(2) = Me.ename.Text
rs2.Fields(3) = Format$(Me.DTPicker1.Value, "dd/mmm/yyyy")
rs2.Fields(4) = Me.atype.Text
rs2.Fields(5) = Me.avalue.Text
rs2.Fields(6) = Me.dstart.Text
rs2.Fields(7) = Me.dend.Text
rs2.Fields(8) = Me.lstart.Text
rs2.Fields(9) = Me.lend.Text
rs2.Fields(10) = Me.totalhour.Text
rs2.Fields(11) = Format$(Me.DTPicker1.Value, "dd/M/yyyy")
rs2.Update
'rs2.Sort
MsgBox "record has been saved"

End If

here:
Me.aentry.Enabled = False

Me.dname.Text = ""
Me.ename.Text = ""
Me.atype.Text = ""
Me.avalue.Text = ""
Me.dstart.Text = ""

Page
50
Employee Management System
Me.dend.Text = ""
Me.lstart.Text = ""
Me.lend.Text = ""
Me.totalhour.Text = ""

End Sub
Private Sub edit_Click()
Me.searchframe.Visible = False
Me.aentry.Visible = True

aentry.Enabled = True
Me.save.Enabled = True
flagedit = True
Me.dname.SetFocus
End Sub

Private Sub search_Click()


Me.searchframe.Visible = True
Me.aentry.Visible = False
Me.save.Enabled = False
'Me.delete.Enabled = True

Me.cmbename.Clear

rsd.Requery
If (rsd.RecordCount = 0) Then
Else
rsd.MoveFirst
While (rsd.EOF = False)
Me.cmbdname.AddItem (rsd.Fields(0))
rsd.MoveNext
Wend
End If
Me.cmbdname.SetFocus

End Sub
Private Sub cmbdname_click()
Me.cmbename.Clear
If (rsd.RecordCount = 0) Then
Else
rse.MoveFirst

Page
51
Employee Management System
While (rse.EOF = False)
If (rse.Fields(0) = cmbdname.Text) Then
Me.cmbename.AddItem (rse.Fields(2))
End If
rse.MoveNext
Wend
End If

End Sub
Private Sub DTPicker2_CLOSEUP()
flagsearch = False

Set rsi = New ADODB.Recordset


rsi.Open "select * from attendenceentry where date1='" & Format$(DTPicker2.Value,
"d/M/yyyy") & "' and ename='" & cmbename.Text & "'", cd2, adOpenStatic,
adLockOptimistic

rsi.Requery
If (rsi.RecordCount = 0) Then
Me.txtdstart.Text = ""
Me.txtdend.Text = ""
Me.txtlstart.Text = ""
Me.txtlend.Text = ""
Me.txtatype.Text = ""
Me.txtavalue.Text = ""
'Me.DTPicker2.SetFocus
Else

count1 = 0
While (count1 < rsi.RecordCount)

If (Me.cmbename.Text = rsi.Fields(2)) Then


Me.txtatype.Text = rsi.Fields(4)
Me.txtavalue.Text = rsi.Fields(5)

If rsi.Fields(6) = "12:00:00 AM" Then


Me.txtdstart.Text = "00:00:00 AM"
Else
Me.txtdstart.Text = rsi.Fields(6)
End If

If rsi.Fields(7) = "12:00:00 AM" Then

Page
52
Employee Management System
Me.txtdend.Text = "00:00:00 AM"
Else
Me.txtdend.Text = rsi.Fields(7)
End If

If rsi.Fields(8) = "12:00:00 AM" Then


Me.txtlstart.Text = "00:00:00 AM"
Else
Me.txtlstart.Text = rsi.Fields(8)
End If

If rsi.Fields(9) = "12:00:00 AM" Then


Me.txtlend.Text = "00:00:00 AM"
Else
Me.txtlend.Text = rsi.Fields(9)
End If

Me.txttotalhour.Text = rsi.Fields(10)

flagsearch = True
End If
count1 = count1 + 1
rsi.MoveNext
Wend

'If flagsearch = False Then


'MsgBox "no record "
'Me.DTPicker2.SetFocus
'End If
End If
End Sub
Private Sub DTPicker2_change()
flagsearch = False

Set rsi = New ADODB.Recordset


rsi.Open "select * from attendenceentry where date1='" & Format$(DTPicker2.Value,
"d/M/yyyy") & "' and ename='" & cmbename.Text & "'", cd2, adOpenStatic,
adLockOptimistic

rsi.Requery
If (rsi.RecordCount = 0) Then
Me.txtdstart.Text = ""
Me.txtdend.Text = ""

Page
53
Employee Management System
Me.txtlstart.Text = ""
Me.txtlend.Text = ""
Me.txtatype.Text = ""
Me.txtavalue.Text = ""
'Me.DTPicker2.SetFocus
Else
count1 = 0
While (count1 < rsi.RecordCount)

If (rsi.Fields(2) = Me.cmbename.Text) Then


Me.txtatype.Text = rsi.Fields(4)
Me.txtavalue.Text = rsi.Fields(5)
If rsi.Fields(6) = "12:00:00 AM" Then
Me.txtdstart.Text = "00:00:00 AM"
Else
Me.txtdstart.Text = rsi.Fields(6)
End If

If rsi.Fields(7) = "12:00:00 AM" Then


Me.txtdend.Text = "00:00:00 AM"
Else
Me.txtdend.Text = rsi.Fields(7)
End If

If rsi.Fields(8) = "12:00:00 AM" Then


Me.txtlstart.Text = "00:00:00 AM"
Else
Me.txtlstart.Text = rsi.Fields(8)
End If

If rsi.Fields(9) = "12:00:00 AM" Then


Me.txtlend.Text = "00:00:00 AM"
Else
Me.txtlend.Text = rsi.Fields(9)
End If
Me.txttotalhour.Text = rsi.Fields(10)
flagsearch = True

End If
count1 = count1 + 1
rsi.MoveNext
Wend

Page
54
Employee Management System
'If flagsearch = False Then
' Me.cmbename.SetFocus
'End If
End If
End Sub
Private Sub DTPicker2_lostfocus()
flagsearch = False

Set rsi = New ADODB.Recordset


rsi.Open "select * from attendenceentry where date1='" & Format$(DTPicker2.Value,
"d/M/yyyy") & "' and ename='" & cmbename.Text & "' ", cd2, adOpenStatic,
adLockOptimistic

rsi.Requery
If (rsi.RecordCount = 0) Then
Me.txtdstart.Text = ""
Me.txtdend.Text = ""
Me.txtlstart.Text = ""
Me.txtlend.Text = ""
Me.txtatype.Text = ""
Me.txtavalue.Text = ""
'Me.DTPicker2.SetFocus
Else
count1 = 0
While (count1 < rsi.RecordCount)

If (rsi.Fields(2) = Me.cmbename.Text) Then


Me.txtatype.Text = rsi.Fields(4)
Me.txtavalue.Text = rsi.Fields(5)
If rsi.Fields(6) = "12:00:00 AM" Then
Me.txtdstart.Text = "00:00:00 AM"
Else
Me.txtdstart.Text = rsi.Fields(6)
End If

If rsi.Fields(7) = "12:00:00 AM" Then


Me.txtdend.Text = "00:00:00 AM"
Else
Me.txtdend.Text = rsi.Fields(7)
End If

If rsi.Fields(8) = "12:00:00 AM" Then


Me.txtlstart.Text = "00:00:00 AM"

Page
55
Employee Management System
Else
Me.txtlstart.Text = rsi.Fields(8)
End If

If rsi.Fields(9) = "12:00:00 AM" Then


Me.txtlend.Text = "00:00:00 AM"
Else
Me.txtlend.Text = rsi.Fields(9)
End If
Me.txttotalhour.Text = rsi.Fields(10)
flagsearch = True

End If
count1 = count1 + 1
rsi.MoveNext
Wend

'If flagsearch = False Then


' MsgBox "No record!! "
' Me.cmbename.SetFocus
'End If
End If
End Sub

Page
56
Employee Management System

OUTPUT

1. Login Form

Page
57
Employee Management System
2. MDI Form

Page
58
Employee Management System
3. Employee Entry Form

Page
59
Employee Management System
4. Attendance Entry Form

Page
60
Employee Management System
5. Department Entry Form

Page
61
Employee Management System
6. Pay slip form

Page
62
Employee Management System

7. Pay slip Report

Page
63
Employee Management System

8. Employee Detail Report

Page
64
Employee Management System

9. Attendance Report

Page
65
Employee Management System

10. Back up Form

Page
66
Employee Management System

TESTING & IMPLEMENTATION

SYSTEM TESTING
Software testing is a crucial element of software quality assurance and represents
the ultimate review of specification, design and coding. The increasing visibility of
software as a system element and the attendant "cost" associated with a software failure
are motivating forces for well-planned, thorough testing. Testing is a set of activities that
can be planned in advance and conducted systematically. Testing begins at the module
level and work towards the integration of entire computers based system. Nothing is
complete without testing, as it is vital success of the system.

Unit Testing
Unit testing focuses on the verification of smallest unit of software design of the
module. To check whether each module in the software works properly so that it gives
desired outputs to the given inputs. All validations and conditions are tested in the
module level in unit test. Control paths are tested to ensure the information properly
flows into and out of the program unit under test. Boundary condition are tested to
ensure that the modules operates at boundary establishes to restrict processing. All
independent paths through control structure are exercised to ensure that all statements
in a module have been executed at least once. And finally all errors handling paths are
tested. In our system, Unit testing has been successfully handled. The test data was given
to each module in all respects and have got desired output. Each module has been found
working properly.

Black Box Testing


Black Box Testing methods focus on the functional requirements of the software.
This testing enables the software engineer to derive sets of input conditions that will fully
exercise all functional requirements for a program. This testing attempts to find errors in

Page
67
Employee Management System
the following categories: incorrect or missing functions, interface errors, errors in data
structure or external database access, performance errors and initialization errors and
termination errors. In our system, Black Box testing has been successfully handled. The
test input data was given has got desired output.

User Acceptance Testing


The performance of user interactive testing is actually the user show. The user
gives live data and checks whether software is giving specified outputs.

SYSTEM IMPLEMENTATION
Implementation Procedures & Operational Documentation
Implementation is the phase where the system goes for actual functioning. Hence
in this phase one has to be cautious because all the efforts undertaken during the project
will be fruitful only if the software is properly implemented according to the plans made.

The implementation phase is less creative than system design. It is primarily


concerned with user training, site preparation and file conversion. Depending on the
nature of the system, extensive user training may be required. The initial parameters of
the MIS should be modified as the result of programming efforts; programming provides
a reality test for the assumptions made by the analyst.

The system testing checks the readiness and accuracy of the system to access,
update and retrieve data from new files. Once the programs become available, the test
data are read into the computer and process.

SYSTEM MAINTENANCE
We may define Software Maintenance by describing four activities that are
undertaken after a program is released for use.

Page
68
Employee Management System
Corrective Maintenance
The first maintenance activity occurs since it is unreasonable to assume that
software testing will uncover all errors in a large software system. The process of
including the diagnosis and correction of one or more errors is called corrective
maintenance.

Adaptive Maintenance
This activity that contributes to the definition of maintenance occurs since rapid
change is encountered in every aspect of computing. Therefore, adaptive maintenance
modifies software to properly interface with the changing environment.

Perfective Maintenance
This activity involves recommendations for new capabilities, modifications to the
existing functions and general enhancements when the software is used. To satisfy these
requests, perfective maintenance is performed.

Preventive Maintenance
This activity occurs when software is changed to improve further maintainability
or reliability. If the only available element of a Software Configuration is the source code,
maintenance activity begins with the evaluation of the code, often complicated by poor
internal documentation. The subtle characteristics such as program structure, global data
structure, system interfaces and performance & design constraints are difficult to handle
and are often misinterpreted. The amounts of changes that are made to the code are
difficult to access.

Page
69
Employee Management System

CONCLUSION
The Employee Management System didn’t automate 100% of their work, but it is
really a good start to computerize everything and entire Detail can be 100%
computerized. As far as the work done so far much care was given about the user
friendliness and a very good interaction with the end users. The interface are so designed
and channeled the users can never make any mistake while using the application, for an
example while adding new record, user’s can’t go out without either saving or canceling
the operation, till the time either they save or cancel the current operation all other
operations are blocked. There is no chance of making any mistake in the application.

SCOPE FOR FUTHER ENHANCEMENT


Search details can be enhanced by detailed identification of searching problems
and rectification steps by company.

This system is entirely designed for STAND ALONE usage, according to the need of
the customer if needed the same system can be designed with Network facility to handle
the branch activities also.

Page
70
Employee Management System

REFERENCES
 Visual Basic 6.0 Programming Black Book by steven holzner –dreamtech
publications
 Mastering VB 6.0 by Evangelos petroutsos- BPB publications
 Introduction to Visual Basic framework-Worx publication
 Ms Office XP complete BPB publication ISBN 81-7656-564-4
 Ms Access 2002 fast & easy by Faithe Wempen PHI .ISBN 81-203-1893
 System Analysis & Design by Pearson Education
 msdn.microsoft.com/net/
 www.vbtutor.net
 www.officetutorials.com/accesstutorials.htm
 www.computer-training-software.com/access-2003.htm

Page
71

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy