Download - DOC SYNOPSIS VB(Currently Editing)
-
8/7/2019 DOC SYNOPSIS VB(Currently Editing)
1/86
Project Synopsis
On
: -
: - (94752345054)
.
(94752345050 )
4
.
-
8/7/2019 DOC SYNOPSIS VB(Currently Editing)
2/86
Acknowledgements
The preparation of this report Railway Reservation would not have
been possible without the valuable contribution of Mr. Parminder Singh (Head of
Department, BCA), Mr. Gautam Kumar (senior, BCA 6th
sem.) and my classmates.
We would like to thank Mr. Parminder Singh (HOD, BCA) for his direction,
Mr. Gautam Kumar (senior, BCA 6th
sem.) for his co-operation in making this
project and my classmate for their innovative ideas.
Indian Railways has made the process of seat reservation much simpler
than ever before. Throughout the length and breadth of the country, there arenumerous counters where one can easily book the tickets. The metropolitan cities
like Mumbai, Chennai and Delhi, have many counters at different centers for the
convenience of users. Most of the manual reservation centers have been changed
into computerized reservation centers, which provide ticket booking facilities
from any station to any destination.
Ranjit Kaur
Parminder Kaur
-
8/7/2019 DOC SYNOPSIS VB(Currently Editing)
3/86
Certificate
It is to certify that the project named
RAILWAY RESARVATION is carried out by RANJIT
KAUR (ROLL NO 94752345054) and PARMINDERKAUR(ROLL NO 94752345050), students of BCA 4th
sem., during the Academic session (2009-2012) in partial
fulfillment of the requirement for the award of Bachelor of
Computer Application offered by PUNJAB TECHNICAL
UNIVERTCITY, JALANDHAR (PUNJAB) at KCSchool of Management & Computer Application
( KCSMCA ). The matter embodied in this project has not
been submitted earlier for award of any degree or diploma
to the best of my knowledge and belief.
Signature of the student Signature of the HOD
-
8/7/2019 DOC SYNOPSIS VB(Currently Editing)
4/86
INTRODUCTION
What is Visual Basics?
VISUAL BASIC is a high level programming language which evolved from the
earlier DOS version called BASIC. BASIC means Beginners' All-purpose Symbolic
Instruction Code. It is a very easy programming language to learn. The code looks
a lot like English Language. Different software companies produced different
versions of BASIC, such as Microsoft QBASIC, QUICKBASIC, GWBASIC, IBM BASICA
and so on. However, people prefer to use Microsoft Visual Basic today, as it is a
well developed programming language and supporting resources are available
everywhere. Now, there are many versions of VB exist in the market, the most
popular one and still widely used by many VB programmers is none other than
Visual Basic 6. We also have VB.net, VB2005, VB2008 and the latest VB2010. Both
Vb2008 and VB2010 are fully object oriented programming (OOP) language.
VISUAL BASIC is a VISUAL and events driven Programming Language. These are
the main divergence from the old BASIC. In BASIC, programming is done in a text-
only environment and the program is executed sequentially. In VB, programming
is done in a graphical environment. In the old BASIC, you have to write program
code for each graphical object you wish to display it on screen, including its
position and its color. However, In VB, you just need to drag and drop any
graphical object anywhere on the form, and you can change its color any time
using the properties windows.
On the other hand, because the user may click on certain object randomly, so
each object has to be programmed independently to be able to response to those
actions (events). Therefore, a VB Program is made up of many subprograms, each
has its own program code, and each can be executed independently and at the
same time each can be linked together in one way or another.
-
8/7/2019 DOC SYNOPSIS VB(Currently Editing)
5/86
Visual Basic (VB) is the third-generation event-driven programming language and
integrated development environment (IDE) from Microsoft for its COM
programming model. Visual Basic is relatively easy to learn and use.
Visual Basic was derived from BASIC and enables the rapid applicationdevelopment (RAD) of graphical user interface (GUI) applications, access to
databases using Data Access Objects, Remote Data Objects, or ActiveX Data
Objects, and creation of ActiveX controls and objects. Scripting languages such as
VBA and VBScript are syntactically similar to Visual Basic, but perform differently.
A programmer can put together an application using the components provided
with Visual Basic itself. Programs written in Visual Basic can also use the Windows
API, but doing so requires external function declarations.
The final release was version 6 in 1998. Microsoft's extended support ended in
March 2008 and the designated successor was Visual Basic .NET (now known
simply as Visual Basic).
-
8/7/2019 DOC SYNOPSIS VB(Currently Editing)
6/86
The Development Environment
Learning the Development Environment before you learn visual basic is somewhat
like learning for a test you must know where all the functions belong and what
their purpose is. First we will start with labeling the development environment.
-
8/7/2019 DOC SYNOPSIS VB(Currently Editing)
7/86
The diagram shows the development environment with all the important points
labeled.
Many of Visual basic functions work similar to Microsoft word eg. The Tool Bar
and the tool box is similar to other products on the market which work off a singleclick then drag the width of the object required . The Tool Box contains the
control you placed on the form window. All of the controls that appear on the
Tool Box controls on the above picture never run out of controls as soon as you
place one on the form another awaits you o the Tool Box ready to be placed as
needed.
The project explorer window
The project explorer window gives you a tree-structured view of all the files
inserted into the application. You can expand these and collapse branches of the
views to get more or less detail (Projectexplorer).The project explorer window
displays forms, modules or other separator which are supported by the visual
basic like classes and Advance Modules .If you want to select a for on its own
simply double click on the project explorer window for a more detailed look .And
it will display it where the Defaultform is located.
Properties Window
Some programmers prefer the Categorisized view of the properties window. By
defaulting, the properties window displays its properties alphabetically (with the
-
8/7/2019 DOC SYNOPSIS VB(Currently Editing)
8/86
exception of the name value) when you click on the categorized button the
window changes to left picture.
Understanding the tool box.
You may have noticed that when
you click on different controls the
Properties Window changes slightly
this is due to different controls
having different functions.
Therefore more options are needed
for example if you had a picture
then you want to show an image.
But if you wanted to open a
internet connection you would
have to fill in the remote host and
other such settings. When you use
the command ( ) you will find
that a new set of properties come
up the following will provide a
description and a property
Buttons
The button, also referred to as command button or pus button , is one of the
more popular user interface components. A button is used to initiate an action.
The command button returns a variant or string that contain any command line
parameters used when VB or VB environment was started
Text Boxes
-
8/7/2019 DOC SYNOPSIS VB(Currently Editing)
9/86
Text box is a control used to accept information from the user. Therefore, it is
sometimes also called input box.
Label
The label is the control used to place text in a window. The label cannot be
changed directly by the user at run time. Thats is, a user cannot select the text in a
label and change its value.List Boxes
List boxes are used to present the user with the possible options. When the
number of display items is more than can be displayed in the list box.
Combo box
A combo box is a combination of a list box and a text control. The list box allows
the user to only select from the available list by clicking on it. It is not allowed to
key-in a value. The combo box does way with this disadvantage by providing a
text box in addition to the list box. Thus, the user may also key-in the value in the
text box portion of the control.
Timer
The timer contains the action that take place when a time equal to the interval value of
the timer control has elapsed. This event triggers every time the interval of time elapses
(pass of time) until the timer control is disable. A timer control is disable by setting its
property to false or interval property is 0 or by unloading the form.
Opening an existing Visual Basic project.
-
8/7/2019 DOC SYNOPSIS VB(Currently Editing)
10/86
Microsoft has included some freebies with visual basic to show its capabilities and
functions. Dismantling or modifying these sample projects is a good way to
understand what is happening at runtime. These files can be located at your
default directory /SAMPLES/
To open these projects choose 'Open Project' from the 'File' menu. Then Double
click on the samples folder to open the directory then Double click on any project
to load it.
What is Microsoft Access?
Microsoft Office Access, previously known as Microsoft Access, is a relational
database management system from Microsoft that combines the relational
Microsoft Jet Database Engine with a graphical user interface and software-
development tools. It is a member of the Microsoft Office suite of applications,
included in the Professional and higher editions or sold separately. In mid-May
2010, the current version Microsoft Access 2010 was released by Microsoft in
Office 2010; Microsoft Office Access 2007 was the prior version.
Access stores data in its own format based on the Access Jet Database Engine. It
can also import or link directly to data stored in other applications and databases.
Software developers and data architects can use Microsoft Access to develop
application software, and "power users" can use it to build simple applications.
Like other Office applications, Access is supported by Visual Basic for Applications,
an object-oriented programming language that can reference a variety of objects
including DAO (Data Access Objects), ActiveX Data Objects, and many other
ActiveX components. Visual objects used in forms and reports expose their
methods and properties in the VBA programming environment, and VBA code
modules may declare and call Windows operating-system functions.
-
8/7/2019 DOC SYNOPSIS VB(Currently Editing)
11/86
Microsoft Access Database Fundamentals
Are you overwhelmed by the large quantities of data that need to be tracked in
your organization? Perhaps you're currently using a paper filing system, text
documents or a spreadsheet to keep track of your critical information. If you're
searching for a more flexible data management system, a database might be just
the salvation you're looking for.
What is a database? Quite simply, it's an organized collection of data. A database
management system (DBMS) such as Access, FileMaker Pro, Oracle or SQL Server
provides you with the software tools you need to organize that data in a flexible
manner. It includes facilities to add, modify or delete data from the database, ask
questions (or queries) about the data stored in the database and produce reports
summarizing selected contents.
Microsoft Access provides users with one of the simplest and most flexible DBMS
solutions on the market today. Regular users of Microsoft products will enjoy the
familiar Windows "look and feel" as well as the tight integration with other
Microsoft Office family products. An abundance of wizards lessen the complexity
of administrative tasks and the ever-present Microsoft Office Helper (you know
the paper clip!) is available for those who care to use it. Before purchasing Access,
be sure that your system meets Microsoft's minimum system requirements. To
further our discussion, let's first examine three of the major components of
Access that most database users will encounter - tables, queries, forms. Once
-
8/7/2019 DOC SYNOPSIS VB(Currently Editing)
12/86
we've completed that we'll look at the added benefits of reports, web integration
and SQL Server integration.
Tables comprise the fundamental building blocks of any database. If you're
familiar with spreadsheets, you'll find database tables extremely similar.
RAILWAY RESARVATION
Railway Resarvation (RR) are configurations of networked computer hardware
and software. A variety of office automation systems are now applied to business
and communication functions that used to be performed manually or in multiple
locations of a company, such as preparing written communications and strategic
planning. In addition, functions that once required coordinating the expertise of
outside specialists in typesetting, printing, or electronic recording can now be
integrated into the everyday work of an organization, saving both time and
money.
Types of functions integrated by office automation systems include (1) electronic
publishing; (2) electronic communication; (3) electronic collaboration; (4) image
processing; and (5) office management. At the heart of these systems is often alocal area network (LAN). The LAN allows users to transmit data, voice, mail, and
images across the network to any destination, whether that destination is in the
local office on the LAN, or in another country or continent, through a connecting
network. An OAS makes office work more efficient and increases productivity.
-
8/7/2019 DOC SYNOPSIS VB(Currently Editing)
13/86
Electronic Publishing
Electronic publishing systems include word processing and desktop publishing.
Word processing software, (e.g., Microsoft Word, Corel Word-Perfect) allows
users to create, edit, revise, store, and print documents such as letters, memos,reports, and manuscripts. Desktop publishing software (e.g., Adobe PageMaker,
Corel VENTURA, and Microsoft Publisher) enables users to integrate text, images,
photographs, and graphics to produce high-quality printable output. Desktop
publishing software is used on a microcomputer with a mouse, scanner, and
printer to create professional-looking publications. These may be newsletters,
brochures, magazines, or books.
Electronic Communication
Electronic communication systems include electronic mail (e-mail), voice mail,
facsimile (fax), and desktop videoconferencing.
Electronic Mail.
E-mail is software that allows users, via their computer keyboards, to create,
send, and receive messages and files to or from anywhere in the world. Most e-
mail systems let the user do other sophisticated tasks such as filter, prioritize, orfile messages; forward copies of messages to other users; create and save drafts
of messages; send "carbon copies"; and request automatic confirmation of the
delivery of a message. E-mail is very popular because it is easy to use, offers fast
delivery, and is inexpensive. Examples of e-mail software are Eudora, Lotus Notes,
and Microsoft Outlook.
Voice Mail.
Voice mail is a sophisticated telephone answering machine. It digitizes incomingvoice messages and stores them on disk. When the recipient is ready to listen, the
message is converted from its digitized version back to audio, or sound.
Recipients may save messages for future use, delete them, or forward them to
other people.
Facsimile.
-
8/7/2019 DOC SYNOPSIS VB(Currently Editing)
14/86
A facsimile or facsimile transmission machine (FAX) scans a document containing
both text and graphics and sends it as electronic signals over ordinary telephone
lines to a receiving fax machine. This receiving fax recreates the image on paper.
A fax can also scan and send a document to a fax modem (circuit board) inside a
remote computer. The fax can then be displayed on the computer screen andstored or printed out by the computer's printer.
Desktop Videoconferencing
Desktop videoconferencing is one of the fastest growing forms of
videoconferencing. Desktop videoconferencing requires a network and a
desktop computer with special application software (e.g., CUSeeMe) as well as a
small camera installed on top of the monitor. Images of a computer user from the
desktop computer are captured and sent across the network to the other
computers and users that are participating in the conference. This type of
videoconferencing simulates face-to-face meetings of individuals.
Electronic Collaboration
Electronic collaboration is made possible through electronic meeting and
collaborative work systems and teleconferencing. Electronic meeting and
collaborative work systems allow teams of coworkers to use networks of
microcomputers to share information, update schedules and plans, and
cooperate on projects regardless of geographic distance. Special software called
groupware is needed to allow two or more people to edit or otherwise work on
the same files simultaneously.
Teleconferencing is also known as videoconferencing. As was mentioned in the
discussion of desktop videoconferencing earlier, this technology allows people in
multiple locations to interact and work collaboratively using real-time sound and
images. Full teleconferencing, as compared to the desktop version, requires
special-purpose meeting rooms with cameras, video display monitors, and audiomicrophones and speakers.
Telecommuting and Collaborative Systems.
Telecommuters perform some or all of their work at home instead of traveling to
an office each day, usually with the aid of office automation systems, including
-
8/7/2019 DOC SYNOPSIS VB(Currently Editing)
15/86
those that allow collaborative work or meetings. A microcomputer, a modem,
software that allows the sending and receiving of work, and an ordinary
telephone line are the tools that make this possible.
High-tech
meeting rooms help companies make more effective presentations. At some
conference halls, like this one at the Chinzan-so Four Seasons Hotel in Toyko,
small video screens are built into the table tops.
Telecommuting is gaining in popularity in part due to the continuing increase in
population, which creates traffic congestion, promotes high energy consumption,
and causes more air pollution. Telecommuting can help reduce these problems.
Telecommuting can also take advantage of the skills of homebound people with
physical limitations.
Studies have found that telecommuting programs can boost employee morale
and productivity among those who work from home. It is necessary to maintain a
collaborative work environment, however, through the use of technology and
general employee management practices, so that neither on-site employees nor
telecommuters find their productivity is compromised by such arrangements. The
technologies used in electronic communication and teleconferencing can be
useful in maintaining a successful telecommuting program.
-
8/7/2019 DOC SYNOPSIS VB(Currently Editing)
16/86
Image Processing
Image processing systems include electronic document management,
presentation graphics, and multimedia systems. Imaging systems convert text,
drawings, and photographs into digital form that can be stored in a computer
system. This digital form can be manipulated, stored, printed, or sent via a
modem to another computer. Imaging systems may use scanners, digital cameras,
video capture cards, or advanced graphic computers. Companies use imaging
systems for a variety of documents such as insurance forms, medical records,
dental records, and mortgage applications.
Presentation graphics software uses graphics and data from other software tools
to create and display presentations. The graphics include charts, bullet lists, text,
sound, photos, animation, and video clips. Examples of such software are
Microsoft Power Point, Lotus Freelance Graphics, and SPC Harvard Graphics.
Multimedia systems are technologies that integrate two or more types of media
such as text, graphic, sound, voice, full-motion video, or animation into a
computer-based application. Multimedia is used for electronic books and
newspapers, video conferencing, imaging, presentations, and web sites.
Office Management
Office management systems include electronic office accessories, electronic
scheduling, and task management. These systems provide an electronic means of
organizing people, projects, and data. Business dates, appointments, notes, and
client contact information can be created, edited, stored, and retrieved.
Additionally, automatic reminders about crucial dates and appointments can be
programmed. Projects and tasks can be allocated, subdivided, and planned. All of
these actions can either be done individually or for an entire group. Computerizedsystems that automate these office functions can dramatically increase
productivity and improve communication within an organization.
-
8/7/2019 DOC SYNOPSIS VB(Currently Editing)
17/86
Technical Detail
In order to implement the proposed system the following various hardware andsoftware requirements are required to achieve good performance:
Minimum Hardware Requirements
y Processor core 2 duo,2.2 GHzy Random Access Memory 256 MB or abovey Harddisk 40 GB or abovey Keyboard/Mouse any compatibley Printery Monitor
Tools/software requirement
y Windows 7y Visual basic 6.0
Data base
y Ms Access
-
8/7/2019 DOC SYNOPSIS VB(Currently Editing)
18/86
CODING
Main Form
Private Sub exit_Click()
'Dim a As Integer
'a = MsgBox(" ARE YOU SURE YOU WANT TO EXIT ", vbCritical + vbOKCancel,
"sujay")
'If a = 1 Then
End
'End If
End Sub
Private Sub Form_Load()
Image3.Visible = False
M.mm
rmleaves.Open "SELECT * FROM EMPLEAVES", con, adOpenDynamic,adLockOptimistic
CC.Open "select * from ccheck ", con, adOpenDynamic, adLockOptimistic
-
8/7/2019 DOC SYNOPSIS VB(Currently Editing)
19/86
If (Month(Date) = 1 Or Month(Date) = 7) And CC.Fields(0) = 0 Then
rmleaves.MoveFirst
While rmleaves.EOF = False
rmleaves.Fields("lap") = rmleaves.Fields("lap") + 15
rmleaves.Fields("lhap") = rmleaves.Fields("lhap") + 15
rmleaves.Update
rmleaves.MoveNext
Wend
CC.Fields(0) = 1
CC.Update
End If
If Month(Date) = 2 Or Month(Date) = 8 Then
CC.Fields(0) = 0
CC.Update
End If
rmleaves.Close
CC.Close
End Sub
-
8/7/2019 DOC SYNOPSIS VB(Currently Editing)
20/86
Private Sub LAF_Click()
Me.Enabled = False
leave_app.Show
End Sub
Private Sub MLF_Click()
Me.Enabled = False
m_leave.Show
End Sub
Private Sub leavea_Click()
main.Enabled = False
leave_app.Show
End Sub
Private Sub mleave_Click()
main.Enabled = False
m_leave.Show
End Sub
Private Sub n_employee_Click()
Me.Enabled = False
employee.Show
-
8/7/2019 DOC SYNOPSIS VB(Currently Editing)
21/86
End Sub
Private Sub Form_DblClick()
If Image3.Visible = True Then
Image3.Visible = False
Else
Image3.Visible = True
End If
End Sub
Private Sub pf_Click()
Me.Enabled = False
promoting.Show
End Sub
Private Sub ret_form_Click()
Me.Enabled = False
retirement.Show
End Sub
Private Sub Sub_Click()
Me.Enabled = False
subscription.Show
-
8/7/2019 DOC SYNOPSIS VB(Currently Editing)
22/86
End Sub
Private Sub vdf_Click()
Me.Enabled = False
vacancy_d.Show
End Sub
Leave application
Dim ll As Boolean
Private Sub CommandButton1_Click()
Dim ff As Boolean
Dim nn As Double
If Text1 = "" Or Text2 = "" Or Text3 = "" Or Text4 = "" Or Text5 = "" Or Text6 = "" Or
Text7 = "" Or Text8 = "" Or Text9 = "" Then
MsgBox " Enter the data in all fields ", vbCritical, "sujay"
Exit Sub
End If
If ll = False Then
rmleaves.AddNew
-
8/7/2019 DOC SYNOPSIS VB(Currently Editing)
23/86
rmleaves.Fields("lap") = Val(Text5)
rmleaves.Fields("lhap") = Val(Text6)
rmleaves.Update
End If
rdleaves.AddNew
rdleaves.Fields("empid") = CDbl(Text1)
rdleaves.Fields("ldate") = Text7
rdleaves.Fields("days") = Val(Text8)
rdleaves.Fields("reasons") = Text9
rdleaves.Update
nn = CDbl(Text1)
ff = RMFIND(nn)
If ff = True Then
If rmleaves.Fields("lap")
-
8/7/2019 DOC SYNOPSIS VB(Currently Editing)
24/86
End If
MsgBox " Leave granted for days " & Text8
main.Enabled = True
Unload leave_app
End Sub
Private Sub CommandButton1_MouseMove(Button As Integer, Shift As Integer, X
As Single, Y As Single)
CommandButton1.ForeColor = RGB(255, 0, 0)
CommandButton2.ForeColor = RGB(0, 0, 255)
End Sub
Private Sub CommandButton2_MouseMove(Button As Integer, Shift As Integer, X
As Single, Y As Single)
CommandButton1.ForeColor = RGB(0, 0, 255)
CommandButton2.ForeColor = RGB(255, 0, 0)
End Sub
Private Sub CommandButton2_Click()
main.Enabled = True
Unload leave_app
End Sub
-
8/7/2019 DOC SYNOPSIS VB(Currently Editing)
25/86
Private Sub Form_Load()
rs.Open "select * from empdetail,empdept where
empdetail.empid=empdept.empid and dojpc in (select max(dojpc) from empdept
group by empid) ", con, adOpenDynamic, adLockOptimistic
rdleaves.Open "select * from empleavedetails", con, adOpenDynamic,
adLockOptimistic
rmleaves.Open "select * from empleaves", con, adOpenDynamic,
adLockOptimistic
Calendar1.Visible = False
Text2.Enabled = False
Text3.Enabled = False
Text4.Enabled = False
Text5.Enabled = False
Text6.Enabled = False
Text7.Enabled = False
Text8.Enabled = False
Text9.Enabled = False
End Sub
Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y
As Single)
CommandButton1.ForeColor = RGB(0, 0, 255)
-
8/7/2019 DOC SYNOPSIS VB(Currently Editing)
26/86
CommandButton2.ForeColor = RGB(0, 0, 255)
End Sub
Private Sub Form_Unload(Cancel As Integer)
rs.Close
rdleaves.Close
rmleaves.Close
main.Enabled = True
End Sub
Private Sub Text1_KeyUp(KeyCode As Integer, Shift As Integer)
If Text1 "" Then
If Not IsNumeric(Text1) Then
MsgBox "ONLY NUMBER SHOULD BE ENTERED"
Text1 = ""
End If
End If
End Sub
Private Sub Text1_LostFocus()
Dim flag As Boolean
Dim ff As Boolean
-
8/7/2019 DOC SYNOPSIS VB(Currently Editing)
27/86
Dim nn As Double
If Text1 "" Then
nn = CDbl(Text1)
flag = RSFIND(nn)
ff = RMFIND(nn)
If flag = False Then
MsgBox " there is no employee with the id " & nn, vbCritical, "sujay"
Text1 = ""
Exit Sub
End If
If ff = True Then
ll = True
Else
ll = False
End If
If flag = True Then
assigntext
End If
-
8/7/2019 DOC SYNOPSIS VB(Currently Editing)
28/86
End If
End Sub
Private Sub Text5_KeyUp(KeyCode As Integer, Shift As Integer)
If Text5 "" Then
If Not IsNumeric(Text5) Then
MsgBox "ONLY NUMBER SHOULD BE ENTERED"
Text5 = ""
End If
End If
End Sub
Private Sub Text6_KeyUp(KeyCode As Integer, Shift As Integer)
If Text6 "" Then
If Not IsNumeric(Text6) Then
MsgBox "ONLY NUMBER SHOULD BE ENTERED"
Text6 = ""
End If
End If
End Sub
Private Sub Text7_GotFocus()
Calendar1.Visible = True
-
8/7/2019 DOC SYNOPSIS VB(Currently Editing)
29/86
End Sub
Private Sub Text7_LostFocus()
Text7 = Format(Calendar1.Value, "dd-mmm-yyyy")
Calendar1.Visible = False
End Sub
Public Function RSFIND(N As Double)
rs.MoveFirst
While rs.EOF True
If rs.Fields(0) = N Then
RSFIND = True
Exit Function
End If
rs.MoveNext
Wend
RSFIND = False
End Function
Public Function RMFIND(N As Double)
rmleaves.MoveFirst
While rmleaves.EOF True
If rmleaves.Fields(0) = N Then
-
8/7/2019 DOC SYNOPSIS VB(Currently Editing)
30/86
RMFIND = True
Exit Function
End If
rmleaves.MoveNext
Wend
RMFIND = False
End Function
Public Sub assigntext()
If ll = True Then
Text2 = rs.Fields("empname")
Text3 = rs.Fields("desg")
Text4 = rs.Fields("depo")
Text5 = rmleaves.Fields("lap")
Text6 = rmleaves.Fields("lhap")
Text1.Enabled = False
Text7.Enabled = True
Text8.Enabled = True
Text9.Enabled = True
Else
Text2 = rs.Fields("empname")
Text3 = rs.Fields("desg")
Text4 = rs.Fields("depo")
-
8/7/2019 DOC SYNOPSIS VB(Currently Editing)
31/86
Text1.Enabled = False
Text5.Enabled = True
Text6.Enabled = True
Text7.Enabled = True
Text8.Enabled = True
Text9.Enabled = True
Text5.SetFocus
End If
End Sub
Private Sub Text8_KeyUp(KeyCode As Integer, Shift As Integer)
If Text8 "" Then
If Not IsNumeric(Text8) Then
MsgBox "ONLY NUMBER SHOULD BE ENTERED"
Text8 = ""
End If
End If
End Sub
Master applicationform
Dim badd As Boolean
-
8/7/2019 DOC SYNOPSIS VB(Currently Editing)
32/86
Dim bedit As Boolean
Private Sub CommandButton1_Click()
'add button
MsgBox " Enter the employee id ", , "sujay"
badd = True
Text1 = ""
Text2 = ""
Text3 = ""
Text4 = ""
Text5 = ""
Text6 = ""
Text1.Enabled = True
Text1.SetFocus
CommandButton1.Enabled = False
CommandButton2.Enabled = True
CommandButton3.Enabled = True
CommandButton4.Enabled = False
CommandButton5.Enabled = False
CommandButton6.Enabled = False
End Sub
-
8/7/2019 DOC SYNOPSIS VB(Currently Editing)
33/86
Private Sub CommandButton1_MouseMove(Button As Integer, Shift As Integer, X
As Single, Y As Single)
CommandButton1.ForeColor = RGB(255, 0, 0)
CommandButton2.ForeColor = RGB(0, 0, 255)
CommandButton3.ForeColor = RGB(0, 0, 255)
CommandButton4.ForeColor = RGB(0, 0, 255)
CommandButton5.ForeColor = RGB(0, 0, 255)
CommandButton6.ForeColor = RGB(0, 0, 255)
End Sub
Private Sub CommandButton2_Click()
'save button
If Text1 = "" Or Text2 = "" Or Text3 = "" Or Text4 = "" Or Text5 = "" Or Text6 = ""Then
MsgBox " Enter the data in all fields ", vbCritical, "sujay"
Exit Sub
End If
If badd = True Then
rmleaves.AddNew
rmleaves.Fields("empid") = CDbl(Text1)
-
8/7/2019 DOC SYNOPSIS VB(Currently Editing)
34/86
rmleaves.Fields("lap") = Val(Text5)
rmleaves.Fields("lhap") = Val(Text6)
rmleaves.Update
badd = False
CommandButton1.Enabled = True
CommandButton2.Enabled = False
CommandButton3.Enabled = False
CommandButton4.Enabled = True
CommandButton5.Enabled = True
CommandButton6.Enabled = True
End If
If bedit = True Then
rmleaves.Fields("lap") = Val(Text5)
rmleaves.Fields("lhap") = Val(Text6)
rmleaves.Update
bedit = False
CommandButton1.Enabled = True
CommandButton2.Enabled = False
CommandButton3.Enabled = False
CommandButton4.Enabled = True
CommandButton5.Enabled = True
-
8/7/2019 DOC SYNOPSIS VB(Currently Editing)
35/86
CommandButton6.Enabled = True
End If
End Sub
Private Sub CommandButton2_MouseMove(Button As Integer, Shift As Integer, X
As Single, Y As Single)
CommandButton1.ForeColor = RGB(0, 0, 255)
CommandButton2.ForeColor = RGB(255, 0, 0)
CommandButton3.ForeColor = RGB(0, 0, 255)
CommandButton4.ForeColor = RGB(0, 0, 255)
CommandButton5.ForeColor = RGB(0, 0, 255)
CommandButton6.ForeColor = RGB(0, 0, 255)
End Sub
Private Sub CommandButton3_Click()
badd = False
bedit = False
CommandButton1.Enabled = True
CommandButton2.Enabled = False
CommandButton3.Enabled = False
CommandButton4.Enabled = True
-
8/7/2019 DOC SYNOPSIS VB(Currently Editing)
36/86
CommandButton5.Enabled = True
CommandButton6.Enabled = True
End Sub
Private Sub CommandButton3_MouseMove(Button As Integer, Shift As Integer, X
As Single, Y As Single)
CommandButton1.ForeColor = RGB(0, 0, 255)
CommandButton2.ForeColor = RGB(0, 0, 255)
CommandButton3.ForeColor = RGB(255, 0, 0)
CommandButton4.ForeColor = RGB(0, 0, 255)
CommandButton5.ForeColor = RGB(0, 0, 255)
CommandButton6.ForeColor = RGB(0, 0, 255)
End Sub
Private Sub CommandButton4_Click()
'edit button
MsgBox " Enter the employee id ", , "sujay"
bedit = True
Text1 = ""
Text2 = ""
Text3 = ""
Text4 = ""
-
8/7/2019 DOC SYNOPSIS VB(Currently Editing)
37/86
Text5 = ""
Text6 = ""
Text1.Enabled = True
Text1.SetFocus
CommandButton1.Enabled = False
CommandButton2.Enabled = True
CommandButton3.Enabled = True
CommandButton4.Enabled = False
CommandButton5.Enabled = False
CommandButton6.Enabled = False
End Sub
Private Sub CommandButton4_MouseMove(Button As Integer, Shift As Integer, X
As Single, Y As Single)
CommandButton1.ForeColor = RGB(0, 0, 255)
CommandButton2.ForeColor = RGB(0, 0, 255)
CommandButton3.ForeColor = RGB(0, 0, 255)
CommandButton4.ForeColor = RGB(255, 0, 0)
CommandButton5.ForeColor = RGB(0, 0, 255)
CommandButton6.ForeColor = RGB(0, 0, 255)
End Sub
-
8/7/2019 DOC SYNOPSIS VB(Currently Editing)
38/86
Private Sub CommandButton5_Click()
Dim ff As Variant
Dim nn As Double
Dim flag As Boolean
Dim tt As Boolean
ff = InputBox("enter the employee id to find", "input")
If IsNumeric(ff) Then
nn = CDbl(ff)
flag = RSFIND(nn)
If flag = True Then
addassigntext
Else
MsgBox " THERE IS NO EMPLOYEE WITH ID " & nn
Exit Sub
End If
tt = RMFIND(nn)
If tt = True Then
Text5 = rmleaves.Fields("lap")
Text6 = rmleaves.Fields("lhap")
Else
Text5 = 0
-
8/7/2019 DOC SYNOPSIS VB(Currently Editing)
39/86
Text6 = 0
End If
End If
End Sub
Private Sub CommandButton5_MouseMove(Button As Integer, Shift As Integer, X
As Single, Y As Single)
CommandButton1.ForeColor = RGB(0, 0, 255)
CommandButton2.ForeColor = RGB(0, 0, 255)
CommandButton3.ForeColor = RGB(0, 0, 255)
CommandButton4.ForeColor = RGB(0, 0, 255)
CommandButton5.ForeColor = RGB(255, 0, 0)
CommandButton6.ForeColor = RGB(0, 0, 255)
End Sub
Private Sub CommandButton6_Click()
1 main.Enabled = True
Unload m_leave
End Sub
-
8/7/2019 DOC SYNOPSIS VB(Currently Editing)
40/86
Private Sub CommandButton6_MouseMove(Button As Integer, Shift As Integer, X
As Single, Y As Single)
CommandButton1.ForeColor = RGB(0, 0, 255)
CommandButton2.ForeColor = RGB(0, 0, 255)
CommandButton3.ForeColor = RGB(0, 0, 255)
CommandButton4.ForeColor = RGB(0, 0, 255)
CommandButton5.ForeColor = RGB(0, 0, 255)
CommandButton6.ForeColor = RGB(255, 0, 0)
End Sub
Private Sub Form_Load()
rs.Open "select * from empdetail,empdept where
empdetail.empid=empdept.empid and dojpc in (select max(dojpc) from empdept
group by empid) ", con, adOpenDynamic, adLockOptimistic
'rs.MoveFirst
rmleaves.Open "select * from empleaves", con, adOpenDynamic,
adLockOptimistic
'rmleaves.MoveFirst
'assigntext
Text1.Enabled = False
Text2.Enabled = False
Text3.Enabled = False
Text4.Enabled = False
-
8/7/2019 DOC SYNOPSIS VB(Currently Editing)
41/86
CommandButton2.Enabled = False
CommandButton3.Enabled = False
End Sub
Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y
As Single)
CommandButton1.ForeColor = RGB(0, 0, 255)
CommandButton2.ForeColor = RGB(0, 0, 255)
CommandButton3.ForeColor = RGB(0, 0, 255)
CommandButton4.ForeColor = RGB(0, 0, 255)
CommandButton5.ForeColor = RGB(0, 0, 255)
CommandButton6.ForeColor = RGB(0, 0, 255)
End Sub
Private Sub Form_Unload(Cancel As Integer)
rs.Close
rmleaves.Close
main.Enabled = True
End Sub
Private Sub Text1_KeyUp(KeyCode As Integer, Shift As Integer)
If Text1 "" Then
If Not IsNumeric(Text1) Then
-
8/7/2019 DOC SYNOPSIS VB(Currently Editing)
42/86
MsgBox "ONLY NUMBER SHOULD BE ENTERED"
Text1 = ""
End If
End If
End Sub
Private Sub Text1_LostFocus()
Dim ff As Boolean
Dim flag As Boolean
Dim nn As Double
If badd = True Then
If Text1 = "" Then
Exit Sub
End If
nn = CDbl(Text1)
ff = RSFIND(nn)
If ff = False Then
MsgBox " there is no employee with the given id", vbCritical, "employee"
Text1 = ""
Exit Sub
-
8/7/2019 DOC SYNOPSIS VB(Currently Editing)
43/86
End If
If ff = True Then
flag = RMFIND(nn)
If flag = True Then
MsgBox " The record is already added you can edit it ", vbCritical, "railway"
Text1 = ""
badd = False
CommandButton1.Enabled = True
CommandButton2.Enabled = False
CommandButton3.Enabled = False
CommandButton4.Enabled = True
CommandButton5.Enabled = True
CommandButton6.Enabled = True
Else
addassigntext
Text1.Enabled = False
Text5.SetFocus
End If
End If
End If
-
8/7/2019 DOC SYNOPSIS VB(Currently Editing)
44/86
If bedit = True Then
If Text1 = "" Then
Exit Sub
End If
nn = CDbl(Text1)
ff = RSFIND(nn)
If ff = False Then
MsgBox " there is no employee with the given id", vbCritical, "employee"
Text1 = ""
Exit Sub
End If
If ff = True Then
flag = RMFIND(nn)
If flag = True Then
addassigntext
Text1.Enabled = False
Text5 = rmleaves.Fields("lap")
Text6 = rmleaves.Fields("lhap")
-
8/7/2019 DOC SYNOPSIS VB(Currently Editing)
45/86
Text5.SetFocus
Else
MsgBox " There is no record with the given id" & vbCrLf & " first add the record
and then edit", vbCritical, "sujay"
Text1 = ""
bedit = False
CommandButton1.Enabled = True
CommandButton2.Enabled = False
CommandButton3.Enabled = False
CommandButton4.Enabled = True
CommandButton5.Enabled = True
CommandButton6.Enabled = True
End If
End If
End If
End Sub
Public Function RSFIND(N As Double)
rs.MoveFirst
While rs.EOF True
If rs.Fields(0) = N Then
RSFIND = True
-
8/7/2019 DOC SYNOPSIS VB(Currently Editing)
46/86
Exit Function
End If
rs.MoveNext
Wend
RSFIND = False
End Function
Public Sub addassigntext()
Text1 = rs.Fields("empdetail.empid")
Text2 = rs.Fields("empname")
Text3 = rs.Fields("desg")
Text4 = rs.Fields("depo")
End Sub
Public Function RMFIND(N As Double)
rmleaves.MoveFirst
While rmleaves.EOF True
If rmleaves.Fields(0) = N Then
RMFIND = True
Exit Function
End If
rmleaves.MoveNext
Wend
-
8/7/2019 DOC SYNOPSIS VB(Currently Editing)
47/86
RMFIND = False
End Function
Sub
Promotionform
Option Explicit
Dim s1 As String
Dim s2 As String
Dim s3 As String
Dim s4 As String
Dim s5 As String
Dim roster As String
Private Sub Combo1_LostFocus()
Dim ff As Boolean
Dim SS As Boolean
Dim flag As Boolean
Dim varphase As Variant
Dim phase As Integer
Dim tt As String
-
8/7/2019 DOC SYNOPSIS VB(Currently Editing)
48/86
phase = 15
ff = FINDS(Combo1.Text)
If ff = True Then
'below are equal to 14
If rcaderd.Fields("sstrength") 14 Then
MsgBox " Enter the number between 1 and 14 ", vbCritical
End If
Loop While phase < 1 Or phase > 14
flag = FINDR14(rcaderd.Fields("sstrength"))
If flag = True Then
roster = rr14chart.Fields(phase + 1)
End If
-
8/7/2019 DOC SYNOPSIS VB(Currently Editing)
49/86
End If
'above 14
If rcaderd.Fields("sstrength") > 14 Then
If rcaderd.Fields("vtype") > 0 Then
FINDR (Combo1.Text)
End If
If rcaderd.Fields("vtype")
-
8/7/2019 DOC SYNOPSIS VB(Currently Editing)
50/86
where desg='" & s1 & "' or desg='" & s2 & "' or desg='" & s3 & "' or desg='" & s4 &
"' or desg='" & s5 & "' group by empid) group by desg", con, adOpenDynamic,
adLockOptimistic
If Not ms.EOF And Not ms.BOF Then
Call finddt(s1, s2, s3, s4, s5, ms.Fields(0))
End If
ms.Close
End If
If roster = "SC" Or roster = "SC*" Then
tt = "SC*"
ms.Open " select max(dojpc) from empdetail,empdept where
empdetail.empid=empdept.empid and (community='" & roster & "' or
community='" & tt & "')and dojpc in (select max(dojpc) from empdept where
desg='" & s1 & "' or desg='" & s2 & "' or desg='" & s3 & "' or desg='" & s4 & "' or
desg='" & s5 & "' group by empid) group by desg", con, adOpenDynamic,
adLockOptimistic
If Not ms.EOF And Not ms.BOF Then
Call finddt(s1, s2, s3, s4, s5, ms.Fields(0))
End If
ms.Close
End If
If roster = "ST" Or roster = "ST*" Then
tt = "ST*"
-
8/7/2019 DOC SYNOPSIS VB(Currently Editing)
51/86
ms.Open " select max(dojpc) from empdetail,empdept where
empdetail.empid=empdept.empid and (community='" & roster & "' or
community='" & tt & "')and dojpc in (select max(dojpc) from empdept where
desg='" & s1 & "' or desg='" & s2 & "' or desg='" & s3 & "' or desg='" & s4 & "' or
desg='" & s5 & "' group by empid) group by desg", con, adOpenDynamic,
adLockOptimistic
If Not ms.EOF And Not ms.BOF Then
Call finddt(s1, s2, s3, s4, s5, ms.Fields(0))
End If
ms.Close
End If
End If
End Sub
Private Sub CommandButton1_Click()
Dim oldcomunity As String
Dim newcomunity As String
Dim ff As Boolean
Dim flag As Boolean
Dim fflag As Boolean
-
8/7/2019 DOC SYNOPSIS VB(Currently Editing)
52/86
If Text1 "" And Text2 "" And Text3 "" And Text4 "" And Text5 ""
And Text6 "" And Text7 "" And Combo1.Text "" Then
rempdept.AddNew
rempdept.Fields("empid") = CDbl(Text1)
rempdept.Fields("desg") = Text4
rempdept.Fields("depo") = Text3
rempdept.Fields("dojpc") = Text6
rempdept.Fields("comments") = Text7
rempdept.Update
oldcomunity = Text5
If oldcomunity = "SC*" Then
oldcomunity = "SC"
End If
If oldcomunity = "ST*" Then
oldcomunity = "ST"
End If
rrosterd.AddNew
rrosterd.Fields("cader") = Text4
-
8/7/2019 DOC SYNOPSIS VB(Currently Editing)
53/86
rrosterd.Fields("community") = oldcomunity
rrosterd.Update
newcomunity = Text5
If (roster = "SC" Or roster = "SC*") And (Text5 = "SC" Or Text5 = "SC*") Then
newcomunity = "SC*"
End If
If (roster = "ST" Or roster = "ST*") And (Text5 = "ST" Or Text5 = "ST*") Then
newcomunity = "ST*"
End If
ff = FINDCN(CDbl(Text1))
If ff = True Then
remp.Fields("community") = newcomunity
remp.Update
End If
flag = FINDS(Combo1.Text)
If flag = True Then
-
8/7/2019 DOC SYNOPSIS VB(Currently Editing)
54/86
'updating the cader details
rcaderd.Fields("astrength") = rcaderd.Fields("astrength") + 1
rcaderd.Fields("vacancies") = rcaderd.Fields("sstrength") -
rcaderd.Fields("astrength")
If rcaderd.Fields("vtype") > 0 Then
rcaderd.Fields("vtype") = rcaderd.Fields("vtype") - 1
End If
If rcaderd.Fields("astrength") > rcaderd.Fields("sstrength") Then
rcaderd.Fields("excess") = rcaderd.Fields("astrength") -
rcaderd.Fields("sstrength")
End If
rcaderd.Update
End If
fflag = FINDS(Text4)
If flag = True Then
'updating the cader details
rcaderd.Fields("astrength") = rcaderd.Fields("astrength") - 1
rcaderd.Fields("vacancies") = rcaderd.Fields("sstrength") -
rcaderd.Fields("astrength")
rcaderd.Fields("vtype") = rcaderd.Fields("vtype") + 1
-
8/7/2019 DOC SYNOPSIS VB(Currently Editing)
55/86
If rcaderd.Fields("astrength") > rcaderd.Fields("sstrength") Then
rcaderd.Fields("excess") = rcaderd.Fields("astrength") -
rcaderd.Fields("sstrength")
End If
rcaderd.Update
End If
CommandButton1.Enabled = False
Else
MsgBox " Enter the data in all fields ", vbCritical, "sujay"
End If
End Sub
Private Sub CommandButton1_MouseMove(Button As Integer, Shift As Integer, X
As Single, Y As Single)
CommandButton1.ForeColor = RGB(255, 0, 0)
CommandButton2.ForeColor = RGB(0, 0, 255)
End Sub
Private Sub CommandButton2_MouseMove(Button As Integer, Shift As Integer, X
As Single, Y As Single)
CommandButton2.ForeColor = RGB(255, 0, 0)
CommandButton1.ForeColor = RGB(0, 0, 255)
-
8/7/2019 DOC SYNOPSIS VB(Currently Editing)
56/86
End Sub
Private Sub CommandButton2_Click()
main.Enabled = True
Unload promoting
End Sub
Private Sub Form_Load()
remp.Open "select * from empdetail", con, adOpenDynamic, adLockOptimistic
rempdept.Open "select * from empdept", con, adOpenDynamic, adLockOptimistic
rrosterd.Open "select * from roasterdetails", con, adOpenDynamic,
adLockOptimistic
rpchart.Open "select * from promotionchart", con, adOpenDynamic,
adLockOptimistic
rrchart.Open "select * from roasterchart", con, adOpenDynamic,
adLockOptimistic
rr14chart.Open "select * from roaster14chart", con, adOpenDynamic,
adLockOptimistic
rs.Open "select * from empdetail,empdept where
empdetail.empid=empdept.empid and dojpc in (select max(dojpc) from empdept
group by empid) ", con, adOpenDynamic, adLockOptimistic
rcaderd.Open "SELECT * FROM CADERDETAILS", con, adOpenDynamic,
adLockOptimistic
rcaderd.MoveFirst
-
8/7/2019 DOC SYNOPSIS VB(Currently Editing)
57/86
While rcaderd.EOF = False
Combo1.AddItem rcaderd.Fields("CATEGORY")
rcaderd.MoveNext
Wend
CommandButton1.Enabled = False
Calendar1.Visible = False
End Sub
Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y
As Single)
CommandButton1.ForeColor = RGB(0, 0, 255)
CommandButton2.ForeColor = RGB(0, 0, 255)
End Sub
Private Sub Form_Unload(Cancel As Integer)
rrosterd.Close
rpchart.Close
rrchart.Close
rr14chart.Close
rs.Close
rcaderd.Close
rempdept.Close
-
8/7/2019 DOC SYNOPSIS VB(Currently Editing)
58/86
remp.Close
main.Enabled = True
End Sub
Public Function FINDS(SS As String)
rcaderd.MoveFirst
While rcaderd.EOF True
If LCase(rcaderd.Fields(0)) = LCase(SS) Then
FINDS = True
Exit Function
End If
rcaderd.MoveNext
Wend
FINDS = False
End Function
Public Function FINDR14(N As Integer)
rr14chart.MoveFirst
While rr14chart.EOF True
If rr14chart.Fields(0) = N Then
FINDR14 = True
Exit Function
End If
rr14chart.MoveNext
-
8/7/2019 DOC SYNOPSIS VB(Currently Editing)
59/86
Wend
FINDR14 = False
End Function
Public Sub FINDPC(SS As String)
rpchart.MoveFirst
While rpchart.EOF True
If LCase(rpchart.Fields(0)) = LCase(SS) Then
s1 = rpchart.Fields("lc1")
s2 = rpchart.Fields("lc2")
s3 = rpchart.Fields("lc3")
s4 = rpchart.Fields("lc4")
s5 = rpchart.Fields("lc5")
Exit Sub
End If
rpchart.MoveNext
Wend
End Sub
Public Sub finddt(s1 As String, s2 As String, s3 As String, s4 As String, s5 As String,
cd As String)
rs.MoveFirst
-
8/7/2019 DOC SYNOPSIS VB(Currently Editing)
60/86
If cd "" Then
While rs.EOF True
If (LCase(rs.Fields("desg")) = LCase(s1) Or LCase(rs.Fields("desg")) = LCase(s2) Or
LCase(rs.Fields("desg")) = LCase(s3) Or LCase(rs.Fields("desg")) = LCase(s4) Or
LCase(rs.Fields("desg")) = LCase(s5)) And rs.Fields("dojpc") = cd Then
Text1 = rs.Fields("empdetail.empid")
Text2 = rs.Fields("empname")
Text3 = rs.Fields("depo")
Text4 = rs.Fields("desg")
Text5 = rs.Fields("community")
CommandButton1.Enabled = True
Exit Sub
End If
rs.MoveNext
Wend
Else: MsgBox " There is no employee to promot", vbCritical, "sujay"
End If
End Sub
Public Sub FINDR(SS As String)
rrosterd.MoveFirst
While rrosterd.EOF True
If LCase(rrosterd.Fields(0)) = LCase(SS) Then
-
8/7/2019 DOC SYNOPSIS VB(Currently Editing)
61/86
roster = rrosterd.Fields(1)
Exit Sub
End If
rrosterd.MoveNext
Wend
End Sub
Public Sub FINDRT(N As Integer)
rrchart.MoveFirst
While rrchart.EOF True
If rrchart.Fields(0) = N Then
roster = rrchart.Fields(1)
Exit Sub
End If
rrchart.MoveNext
Wend
End Sub
Public Function FINDCN(N As Double)
remp.MoveFirst
While remp.EOF True
If remp.Fields(0) = N Then
FINDCN = True
-
8/7/2019 DOC SYNOPSIS VB(Currently Editing)
62/86
Exit Function
End If
remp.MoveNext
Wend
FINDCN = False
End Function
Private Sub Text6_GotFocus()
Calendar1.Visible = True
End Sub
Private Sub Text6_LostFocus()
Text6 = Format(Calendar1.Value, "dd-mmm-yyyy")
Calendar1.Visible = False
End Sub
Retairementform
Private Sub Form_Unload(Cancel As Integer)
Unload Me
main.Enabled = True
End Sub
-
8/7/2019 DOC SYNOPSIS VB(Currently Editing)
63/86
Subscriptionform
Option Explicit
Dim badd As Boolean
Dim bredit As Boolean
Private Sub CommandButton1_Click()
'add button
Text1.Enabled = True
Text1 = ""
Text2 = ""
Text3 = ""
Text4 = ""
Text5 = ""
Text6 = ""
Text7 = ""
Text8 = ""
badd = True
CommandButton1.Enabled = False
CommandButton2.Enabled = False
CommandButton3.Enabled = True
-
8/7/2019 DOC SYNOPSIS VB(Currently Editing)
64/86
CommandButton4.Enabled = True
CommandButton5.Enabled = False
CommandButton6.Enabled = False
MsgBox " Enter the employee id ", , "sujay"
Text1.SetFocus
End Sub
Private Sub CommandButton1_MouseMove(Button As Integer, Shift As
Integer, X As Single, Y As Single)
CommandButton1.ForeColor = RGB(255, 0, 0)
CommandButton2.ForeColor = RGB(0, 0, 255)
CommandButton3.ForeColor = RGB(0, 0, 255)
CommandButton4.ForeColor = RGB(0, 0, 255)
CommandButton5.ForeColor = RGB(0, 0, 255)
CommandButton6.ForeColor = RGB(0, 0, 255)
End Sub
Private Sub CommandButton2_MouseMove(Button As Integer, Shift As
Integer, X As Single, Y As Single)
CommandButton1.ForeColor = RGB(0, 0, 255)
CommandButton2.ForeColor = RGB(255, 0, 0)
-
8/7/2019 DOC SYNOPSIS VB(Currently Editing)
65/86
CommandButton3.ForeColor = RGB(0, 0, 255)
CommandButton4.ForeColor = RGB(0, 0, 255)
CommandButton5.ForeColor = RGB(0, 0, 255)
CommandButton6.ForeColor = RGB(0, 0, 255)
End Sub
Private Sub CommandButton3_MouseMove(Button As Integer, Shift As
Integer, X As Single, Y As Single)
CommandButton1.ForeColor = RGB(0, 0, 255)
CommandButton2.ForeColor = RGB(0, 0, 255)
CommandButton3.ForeColor = RGB(255, 0, 0)
CommandButton4.ForeColor = RGB(0, 0, 255)
CommandButton5.ForeColor = RGB(0, 0, 255)
CommandButton6.ForeColor = RGB(0, 0, 255)
End Sub
Private Sub CommandButton4_MouseMove(Button As Integer, Shift As
Integer, X As Single, Y As Single)
CommandButton1.ForeColor = RGB(0, 0, 255)
CommandButton2.ForeColor = RGB(0, 0, 255)
CommandButton3.ForeColor = RGB(0, 0, 255)
CommandButton4.ForeColor = RGB(255, 0, 0)
-
8/7/2019 DOC SYNOPSIS VB(Currently Editing)
66/86
CommandButton5.ForeColor = RGB(0, 0, 255)
CommandButton6.ForeColor = RGB(0, 0, 255)
End Sub
Private Sub CommandButton5_MouseMove(Button As Integer, Shift As
Integer, X As Single, Y As Single)
CommandButton1.ForeColor = RGB(0, 0, 255)
CommandButton2.ForeColor = RGB(0, 0, 255)
CommandButton3.ForeColor = RGB(0, 0, 255)
CommandButton4.ForeColor = RGB(0, 0, 255)
CommandButton5.ForeColor = RGB(255, 0, 0)
CommandButton6.ForeColor = RGB(0, 0, 255)
End Sub
Private Sub CommandButton6_MouseMove(Button As Integer, Shift As
Integer, X As Single, Y As Single)
CommandButton1.ForeColor = RGB(0, 0, 255)
CommandButton2.ForeColor = RGB(0, 0, 255)
CommandButton3.ForeColor = RGB(0, 0, 255)
CommandButton4.ForeColor = RGB(0, 0, 255)
CommandButton5.ForeColor = RGB(0, 0, 255)
CommandButton6.ForeColor = RGB(255, 0, 0)
-
8/7/2019 DOC SYNOPSIS VB(Currently Editing)
67/86
-
8/7/2019 DOC SYNOPSIS VB(Currently Editing)
68/86
CommandButton6.Enabled = False
End Sub
Private Sub CommandButton3_Click()
Dim ff As Boolean
Dim nn As Double
If Text1 = "" Or Text2 = "" Or Text3 = "" Or Text4 = "" Or Text5 = "" Or
Text6 = "" Or Text7 = "" Or Text8 = "" Then
MsgBox " Enter the data in all fields ", vbCritical, "sujay"
Exit Sub
End If
nn = CDbl(Text1)
If badd = True Then
ff = SSFIND(nn)
If ff = True Then
MsgBox " The employee is added renaval him ", vbCritical, "sujay"
End If
-
8/7/2019 DOC SYNOPSIS VB(Currently Editing)
69/86
If ff = False Then
rsubscription.AddNew
rsubscription.Fields("empid") = CDbl(Text1)
rsubscription.Fields("date") = Text6
rsubscription.Fields("recieptno") = CDbl(Text3)
rsubscription.Fields("fee") = Val(Text7)
rsubscription.Fields("donation") = Val(Text8)
rsubscription.Update
End If
CommandButton1.Enabled = True
CommandButton2.Enabled = True
CommandButton3.Enabled = False
CommandButton4.Enabled = False
CommandButton5.Enabled = True
CommandButton6.Enabled = True
badd = False
Exit Sub
-
8/7/2019 DOC SYNOPSIS VB(Currently Editing)
70/86
End If
If bredit = True Then
ff = SSFIND(nn)
If ff = False Then
MsgBox " No employee is there with this id to renaval so add him ",
vbCritical, "sujay"
End If
If ff = True Then
rsubscription.Fields("empid") = CDbl(Text1)
rsubscription.Fields("date") = Text6
rsubscription.Fields("recieptno") = CDbl(Text3)
rsubscription.Fields("fee") = Val(Text7)
rsubscription.Fields("donation") = Val(Text8)
rsubscription.Update
End If
CommandButton1.Enabled = True
CommandButton2.Enabled = True
-
8/7/2019 DOC SYNOPSIS VB(Currently Editing)
71/86
CommandButton3.Enabled = False
CommandButton4.Enabled = False
CommandButton5.Enabled = True
CommandButton6.Enabled = True
bredit = False
Exit Sub
End If
End Sub
Private Sub CommandButton4_Click()
CommandButton1.Enabled = True
CommandButton2.Enabled = True
CommandButton3.Enabled = False
CommandButton4.Enabled = False
CommandButton5.Enabled = True
CommandButton6.Enabled = True
bredit = False
badd = False
-
8/7/2019 DOC SYNOPSIS VB(Currently Editing)
72/86
End Sub
Private Sub CommandButton5_Click()
Dim ff As Variant
Dim nn As Double
Dim flag As Boolean
Dim fn As Boolean
ff = InputBox("enter the employee id to find ", "input")
If IsNumeric(ff) Then
nn = CDbl(ff)
flag = RSFIND(nn)
fn = SSFIND(nn)
If flag = True And fn = True Then
assigntext
Text1 = rsubscription.Fields("empid")
Text6 = rsubscription.Fields("date")
Text3 = rsubscription.Fields("recieptno")
Text7 = rsubscription.Fields("fee")
Text8 = rsubscription.Fields("donation")
Else
-
8/7/2019 DOC SYNOPSIS VB(Currently Editing)
73/86
MsgBox " THERE IS NO EMPLOYEE WITH ID " & nn
End If
End If
End Sub
Private Sub CommandButton6_Click()
main.Enabled = True
Unload subscription
End Sub
Private Sub Form_Load()
rs.Open "select * from empdetail,empdept where
empdetail.empid=empdept.empid and dojpc in (select max(dojpc) from
empdept group by empid) ", con, adOpenDynamic, adLockOptimistic
rsubscription.Open "select * from subscription", con, adOpenDynamic,
adLockOptimistic
Calendar1.Visible = False
CommandButton4.Enabled = False
CommandButton3.Enabled = False
End Sub
-
8/7/2019 DOC SYNOPSIS VB(Currently Editing)
74/86
Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As
Single, Y As Single)
CommandButton1.ForeColor = RGB(0, 0, 255)
CommandButton2.ForeColor = RGB(0, 0, 255)
CommandButton3.ForeColor = RGB(0, 0, 255)
CommandButton4.ForeColor = RGB(0, 0, 255)
CommandButton5.ForeColor = RGB(0, 0, 255)
CommandButton6.ForeColor = RGB(0, 0, 255)
End Sub
Private Sub Form_Unload(Cancel As Integer)
main.Enabled = True
rs.Close
rsubscription.Close
End Sub
Private Sub Text1_KeyUp(KeyCode As Integer, Shift As Integer)
If Text1 "" Then
If Not IsNumeric(Text1) Then
MsgBox "ONLY NUMBER SHOULD BE ENTERED"
Text1 = ""
-
8/7/2019 DOC SYNOPSIS VB(Currently Editing)
75/86
End If
End If
End Sub
Private Sub Text1_LostFocus()
Dim ff As Boolean
Dim flag As Boolean
Dim nn As Double
If badd = True Or bredit = True Then
If Text1 = "" Then
Exit Sub
End If
nn = CDbl(Text1)
ff = RSFIND(nn)
If ff = False Then
MsgBox " there is no employee with the given id", vbCritical,
"employee"
Text1 = ""
Exit Sub
-
8/7/2019 DOC SYNOPSIS VB(Currently Editing)
76/86
End If
If ff = True Then
assigntext
Text1.Enabled = False
Text2.Enabled = False
Text4.Enabled = False
Text5.Enabled = False
Text3.SetFocus
End If
End If
End Sub
Private Sub Text3_Change()
If Text3 "" Then
If Not IsNumeric(Text3) Then
MsgBox "ONLY NUMBER SHOULD BE ENTERED"
Text3 = ""
End If
-
8/7/2019 DOC SYNOPSIS VB(Currently Editing)
77/86
End If
End Sub
Private Sub Text6_GotFocus()
Calendar1.Visible = True
Calendar1.Value = Format(Date, "dd-mmm-yyyy")
End Sub
Private Sub Text6_LostFocus()
Text6 = Format(Calendar1.Value, "dd-mmm-yyyy")
Calendar1.Visible = False
End Sub
Private Sub Text7_KeyUp(KeyCode As Integer, Shift As Integer)
If Text7 "" Then
If Not IsNumeric(Text7) Then
MsgBox "ONLY NUMBER SHOULD BE ENTERED"
Text7 = ""
End If
End If
End Sub
-
8/7/2019 DOC SYNOPSIS VB(Currently Editing)
78/86
Private Sub Text8_KeyUp(KeyCode As Integer, Shift As Integer)
If Text8 "" Then
If Not IsNumeric(Text8) Then
MsgBox "ONLY NUMBER SHOULD BE ENTERED"
Text8 = ""
End If
End If
End Sub
Public Function RSFIND(N As Double)
rs.MoveFirst
While rs.EOF True
If rs.Fields(0) = N Then
RSFIND = True
Exit Function
End If
rs.MoveNext
Wend
RSFIND = False
End Function
Public Function SSFIND(N As Double)
-
8/7/2019 DOC SYNOPSIS VB(Currently Editing)
79/86
rsubscription.MoveFirst
While rsubscription.EOF True
If rsubscription.Fields(0) = N Then
SSFIND = True
Exit Function
End If
rsubscription.MoveNext
Wend
SSFIND = False
End Function
Sub assigntext()
Text2 = rs.Fields("empname")
Text4 = rs.Fields("depo")
Text5 = rs.Fields("desg")
End Sub
-
8/7/2019 DOC SYNOPSIS VB(Currently Editing)
80/86
Vaccency
Option Explicit
Private Sub CommandButton1_Click()
Unload Me
main.Enabled = True
End Sub
Private Sub CommandButton1_MouseMove(Button As Integer, Shift As Integer, X
As Single, Y As Single)
CommandButton1.ForeColor = RGB(255, 0, 0)
End Sub
Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, YAs Single)
CommandButton1.ForeColor = RGB(0, 0, 255)
End Sub
Private Sub Form_Unload(Cancel As Integer)
main.Enabled = True
End Sub
-
8/7/2019 DOC SYNOPSIS VB(Currently Editing)
81/86
Screenshorts
Mainform
-
8/7/2019 DOC SYNOPSIS VB(Currently Editing)
82/86
Newemploy
Subscription
-
8/7/2019 DOC SYNOPSIS VB(Currently Editing)
83/86
Vaccency detail
Promotionform
-
8/7/2019 DOC SYNOPSIS VB(Currently Editing)
84/86
Leave application
Master leave
-
8/7/2019 DOC SYNOPSIS VB(Currently Editing)
85/86
Bibliography
The following books have been referred to bring the system towards the completion:
y Programming &problem solving through Visual Basic. By:-V.K. Jainy Visual Basic 6 in 21 Days-By Nathan Gurewich & Ori Gurewichy Complete referenceof Visual Basic -Gurvinder Singhy
DataBaseP
rogramming with Visual Basic 6 in 21 Days-ByC
urtis Smith &Michael Amundsen
y Ms-access - Rachpal Singhy Software engineering- Pankaj Jalotey VB documents downloaded from website.
-
8/7/2019 DOC SYNOPSIS VB(Currently Editing)
86/86