Telephone Exchange System

179
Certificate This is to certify that Student's Name, Student's Name & Student's Name are bona fide students of _____________Centre Name _____________ during session ____________, appeared in the 6 th semester Examination of Master of Computer Applications”. Student's Name, Student's Name & Student's Name have appeared in _______ examination of MCA 6 th semester under Roll No. _______,_______ & _______ respectively. They were regular in the development of their project based on “ Telephone Exchange System”, under the guidance of Mr. _______. Signature of Centre Head Signature of Guide ______________________ _________________ Dated :________________ Dated:____________

description

Visit : www.loreaprint.blogspot.com

Transcript of Telephone Exchange System

Page 1: Telephone Exchange System

Certificate

This is to certify that Student's Name, Student's Name & Student's Name are

bona fide students of _____________Centre Name _____________ during

session ____________, appeared in the 6th semester Examination of “

Master of Computer Applications”. Student's Name, Student's Name &

Student's Name have appeared in _______ examination of MCA 6th semester

under Roll No. _______,_______ & _______ respectively. They were regular

in the development of their project based on “ Telephone Exchange

System”, under the guidance of Mr. _______.

Signature of Centre Head Signature of Guide

______________________ _________________

Dated :________________ Dated:____________

Page 2: Telephone Exchange System

CERTIFICATE OF THE PROJECT GUIDE

(Project‟s Title and Guide Details)

Regn. No.: ______________

Name & Address of Centre:

____________________________

____________________________

____________________________

1. Name & Address of the Student _______________________

_______________________

_______________________

_______________________

2. Title of Project _________________________________

3. Name & Address of the Guide _______________________

_______________________

_______________________

_______________________

4. Qualification of the guide

Ph.D M.Tech B.Tech MCA Any Other

5. Working / teaching experience of Guide (in years) ___________________

Signature of the Student Signature of the Guide

Date …………………… Date…………………...

Page 3: Telephone Exchange System

CERTIFICATE OF THE PROJECT GUIDE

(Project‟s Title and Guide Details)

Regn. No.: ______________

Name & Address of Centre:

____________________________

____________________________

____________________________

1. Name & Address of the Student _______________________

_______________________

_______________________

_______________________

2. Title of Project _________________________________

3. Name & Address of the Guide _______________________

_______________________

_______________________

_______________________

4. Qualification of the guide

Ph.D M.Tech B.Tech MCA Any Other

5. Working / teaching experience of Guide (in years) ___________________

Signature of the Student Signature of the Guide

Date …………………… Date…………………...

Page 4: Telephone Exchange System

CERTIFICATE OF THE PROJECT GUIDE

(Project‟s Title and Guide Details)

Regn. No.: ______________

Name & Address of Centre:

____________________________

____________________________

____________________________

1. Name & Address of the Student _______________________

_______________________

_______________________

_______________________

2. Title of Project _________________________________

3. Name & Address of the Guide _______________________

_______________________

_______________________

_______________________

4. Qualification of the guide

Ph.D M.Tech B.Tech MCA Any Other

5. Working / teaching experience of Guide (in years) ___________________

Signature of the Student Signature of the Guide

Date …………………… Date…………………...

Page 5: Telephone Exchange System

ACKNOWLEDGEMENT

It is a matter of great pleasure for me to express my sincerest and

heartfelt sense of gratitude and thanks to my revered and worthy guide

Mr. _______ for his inspiring guidance, constant supervision and

simulating discussions throughout the entire course of the project. His

encouragement and valuable suggestions proved immense help for me

in completing my project.

I am grateful to Mr. _____________ Superdent, Telephone

Exchange, _________ for providing all kind of information regarding

Office management and so many valuable tips from a user’s point of

view.

Last, but not the least, thanks are due to many others who

remained behind the scene but whose works have been often consulted

and referred.

Roll No: _______ Student's Name Roll No.: _______ Student's Name Rollno: _______

Program Code: MCA Study Centre : C4

Page 6: Telephone Exchange System

Contents

Certificate

Acknowledgement

Introduction & Objectives

System Analysis

Identification of Need

Preliminary Investigation

Feasibility Study

Technical Feasibility

Economical Feasibility

Operational Feasibility

Software and Hardware Requirements Specification

Coding

Validation Checks

Implementation and Maintenance

Testing (Testing techniques and testing strategies used along

with the test data and the errors listed for each test case)

Reports

Data Flow Diagrams

Screen Structure

Screen Shots

Bibliography

Page 7: Telephone Exchange System

Organization Background

Punjab Technical University (_______), Jalandhar was setup by the State

Legislature under "The Punjab Technical University Act", in January 1997.

The university is committed to bring about quality improvement,

modernization and capacity expansion in the education system to fulfill the

requirements and expectations of the industry and the society, in the new

globally competitive economy.

Punjab Technical University has at present, about 80 engineering and

management colleges and about 110 centers of IT/ Management under its

Distance Education Programmed. A separate city campus of Punjab

Technical University is situated at Ladowali Road, Jalandhar (Pb) India. It

houses online Virtual Campus and Distance Education Directorate apart

from administrative offices of the University. For admission, The

University carries out regular entrance exams for various courses. The

students are offered seats depending on the merit list of these exams. In the

field of Distance education, in the very first year, _______ enrolled 20,000

students for various programmers.

University also forms the bridge between the students and the industry; this

helps students in job placements. In addition, University helps the industry

in R&D through its various programmers under Confederation of Indian

Industry

As a logical extension, the Directorate of Distance Education of Punjab

Technical University took a bold decision in _________ to launch Online

Education through Virtual Campus (www._______online.com). This

venture is expected to maximize the reach of professional education by

taking it to the fingertips of the learners. The vision of the Virtual Campus

is decisively shaped by the growing availability and capabilities of

advanced information technologies based on telecommunications and

personal computers to be further supported by CD's and printed material.

These technologies are making possible an approach to education founded

on the premise of delivering instruction from anywhere to anywhere at

anytime at affordable cost. The barriers of time and place are eroding

opportunities to learn are everywhere.

Page 8: Telephone Exchange System

_______ Study Center, _________

The _______ Study Center was established on July _________ under

Punjab Technical University to promote Distance (Technical &

Management) education in the area where it was established, at the

Undergraduate, Post-Graduate level.

This Study Center is providing training to students to help the development

of skilled manpower in IT sector. One of the focuses of this Study Center

at this time is in the area of providing Training in professionals & skill

oriented technologies to the masses by courses in different streams,

promoted by Punjab Technical University. The programmers to be offer:

Undergraduate Programmes

Integrated B.Sc.(IT) , Diploma in Computer Application (DCA),

B.Sc.(Information Tech.), Lateral Entry to B.Sc.(Computer Science &

Tech.)

Postgraduate Programmes

Post Graduate Diploma in Computer Application (PGDCA),

M.Sc.(Information Tech), MCA , MBA etc.

A team of experts has been drawn from industry, university teachers and

in-house faculty by the Punjab Technical University designs the courses.

The curriculum so designed is scrutinized by content experts, supervised

by instructors and only then adapted by them.

Page 9: Telephone Exchange System

Introduction

The Project work constitutes a major component in most of the

professional programs. The objective of the project is to help the

student develop ability to apply theoretical and practical

tools/techniques to solve real life problems related to industry,

academic institutions and research laboratories etc.

This project will help in handling various tasks related to

Telephone Exchange whole of process will be fully computerized.

Hence I have decided to name this project as “Telephone

Exchange System”. This project is going to deal with the matters

relating to the Telephone Exchange.

Page 10: Telephone Exchange System

Objective

The objective of our project is to overcome the problems in the existing

system by computerizing Telephone Exchange System. Being

computerized system, it is easy to handle huge amount of data rather than

pilling hard copies. Proposed system updates data automatically hence it is

very time saving and easy to implement. Major tasks of our project is:-

1. New Telephone Connection

2. Payment During the Connection

3. Shifting The Phone connection

4. ADD On Facility Opening

5. ADD On Facility Close

6. Bill Form

7. Prepare The Telephone Bill

8. Pay The Telephone Bill

9. Disconnection Of Phone

10. Reconnection The Connection

11. Employee Detail

12. Employee Payroll System

13. Form showing the Bill to the Subscriber

14. Complaint

1.New Telephone Connection:- In this module first subscriber

will fill the form. Then the telephone exchange will check the

Page 11: Telephone Exchange System

form. After the validation of form the exchange will allot the

Telephone No. to the subscriber. It will add that Telephone

Number automatically in the Telephone directory.

2.Payment During Connection:- After the validation of form the

subscriber will fill the form of security and will pay the payment

by cash or draft/check . Subscriber has to pay the installation fee

according to the exchange capacity. It will also give the

information about rents according to the Area (Rural/Urban) and

category. Net amount will also change according to the

subscribers requirement i.e. whether he/she is asking for internal

wiring or not, whether he/she wants the telephone instruments or

not. In this module the user (employ) can check the subscribers

detail (which are under processing) by pressing the buttons. At

end it will allot the telephone number to the subscriber and will

add that allotted no.

3. Shifting the Phone connection:- In this module if the

subscriber request to change the position of the phone

connection then he has to fill the form if he/she fulfills the all

conditions of the form then the phone will be shifted it will shift

the position of the phone not the allotted phone number.

4. Add on Open facility: If the customer/subscriber wants to add

one or more facilities like he /she requests for STD, ISD, CLI

Page 12: Telephone Exchange System

or Hotline etc. facility/facilities then this module will asks the

subscriber for extra payment according to the facilities.

5. Add on Close Facility:- If the customer/subscriber wants to

close any facility like he /she requests for STD,ISD,CLI or

Hotline etc. then this module will close that facility.

6. Bill Form:- This module will show/print the bill of two months

of a existing particular Phone .

7. Prepare the Bill Form:- This module will prepare bill of

existing telephone . It will calculate the metered calls, net

chargeable calls and will also calculate net amount of the

chargeable calls.

8. Pay The Telephone Bill:- In this module user can pay the bill

by cash/draft.

9. Disconnection of Phone:- If the subscriber will not pay the bill

before surcharges date or the subscriber wants to disconnect the

phone then this module will disconnect the telephone.

10. Reconnection of Phone:- If the subscriber will pay the bill

with surcharges or the subscriber wants to reconnect the

existing telephone then this module will reconnect that

telephone.

11. Employee Detail:- This module contains the detail of

employees. It can also add the detail of new employee and can

Page 13: Telephone Exchange System

also delete the record of the employee if he/she leaves that

telephone exchange.

12. Employee Payroll System:- This module contains the full

detail of salary of an employee . In this module addition the

TA, DA, HRA, & Deduction the GPF, Income Tax,

Advance_GPF then calculate the Net Salary.

13. Form showing the bill to the subscriber:- This module will

show/print the bill to the subscriber . In the bill it will show the

total detail like subscribers name, previous meter reading,

current meter reading, service charges, surcharges, total amount

without surcharges and with surcharges, issue date, payable

date, after surcharges payable date etc.

14. Complaint:- In this module ,the subscriber‟s telephone occur

any problem then subscriber dial the 0111 number and fill the

complaint form .

Page 14: Telephone Exchange System

SYSTEM ANALYSIS

System analysis involves the study of an application area to

fully understand the problem. This study involves interviews, observation,

hands-on experience, consultations, and many other forms of data

gathering.

The task provided by the system analysis include the following:-

Understanding the problem: First of all is to understand what the

real problem is and what to do for it.

Planning: Planning includes the planning for the solution of the

problem.

Scheduling: It includes the scheduling of the activities to be done.

Developing solution: This one includes the development of basic

solution for a particular problem.

Performing studies: Then brief studies should be made on the

developed solution.

Performing cost benefit analysis: Next step is to make cost benefit

analysis to check if it is economically bearable.

Recommending alternative solutions: If solution is not economic

bearable then need to be make alternative solution for the problem.

Writing requirement specifications: Make a system requirement

specification.

Selling off the system: Next is to sell the system.

Installing the system: After selling is the installation of the system.

Maintaining the system: Last step is to maintain existing system and

upgrading to the latest system.

Initial Investigation

The first step in the System development life cycle is the identification of a

need. The objective is to determine whether the request is valid and

feasible before a recommendation is reached to do nothing, improve or

modify the existing system, or build a new one.

Here a title for the project was first inquired for from the concerned client

(Computerized Voting System).

Every major operation that the software should perform was also inquired.

The main motive was to get a brief feeling of what exactly the client

wanted and what did he expect it to do for him. The major function offered

by the existing manual system was also studied. The way database was

Page 15: Telephone Exchange System

handled was also viewed. Some details analysis was also done of the inputs

that would be fed into the system and the outputs that the system could

generate.

A User's request form was also signed from the client. It had a title,

objectives with the expected benefits. The input and output specifications

were also included.

During the initial analysis the client was told upon what all advantages he

could expect from the software. The disadvantages of manually

maintaining voter & candidate records was that lot of calculations are to be

carried out, data is repeated so tedious paper work and it is time

consuming.

Stress was also laid upon the fact that paper work could almost be made

negligible and there would be maximum time saving. Less manual

interference would mean more data consistency and accuracy.

Page 16: Telephone Exchange System

Feasibility Study

Many feasibility studies are disillusioning for both users and analysts.

First, the study often presupposes that when the feasibility document is

being prepared, the analyst is in a position to evaluate solutions. Second,

most studies tend to overlook the confusion inherent in system

development-the constraints and the assumed attitudes. If the feasibility

study is to serve as a decision document, it must answer three key

questions:

Is there a new and better way to do the job that will benefit the user?

What are the costs and savings of the alternative(s)?

What is recommended?

The most successful system projects are not necessarily the biggest or most

visible in a business but rather those that truly meet user expectations.

More projects fall because of inflated expectations than for any other

reason.

Feasibility Considerations

Three key considerations are involved in the feasibility analysis: economic,

technical and behavioral. Let us briefly review each consideration and how

it relates to the systems efforts.

Economic Feasibility: -

Economic analysis is the most frequently used method for evaluating the

effectiveness of a candidate system. More commonly known as

cost/benefit analysis, the procedure is to determine the benefits and savings

that are expected from a candidate system and compare them with costs. If

benefits outweigh costs, then the decision is made to design and implement

the system. Otherwise, further justification or alterations in the proposed

system will have to be made if it is to have a chance of being approved.

This ongoing effort improves in accuracy at each phase of the system life

cycle.

Technical Feasibility: -

Technical feasibility centers on the existing computer system (hardware,

software, etc.) and to what extent it can support the proposed addition. For

example, if the current computer is operating at 80 percent capacity, an

arbitrary ceiling, then running another application could overload the

system or require additional hardware. This involves financial

Page 17: Telephone Exchange System

considerations to accommodate technical enhancements. If the budget is a

serious constraint, then the project is judged not feasible.

Behavioral Feasibility: -

People are inherently resistant to change, and computers have been known to facilitate change. An estimate should be made of how strong a reaction the user staff is likely to have toward the development of a computerized system. It is common knowledge that computer installations have something to do with turnover; transfers, retraining and changes in employee job status. Therefore, it is understandable that the introduction of a candidate system requires special effort to educate, sell, and train the staff on new ways of conducting business.

Steps Involved in Feasibility Analysis are: -

Form a Project team and Appoint a Project Leader:

A project team was formed which looked into the feasibility aspect of the

project. While forming a team, it was taken into account that future system

users should also be a part of the team. Their knowledge and experience in

the operation area will be essential to the success of the system. The

collective expertise of the users and the analysts would be essential in

devising a solution to the problems faced. A senior system analyst was

appointed as the project leader. Regular meetings of the team took place

and the records of each meeting were noted for future reference.

Preparation of data-flow diagrams:

The team started making generalized flow diagrams for the system.

Information oriented charts and flow diagrams prepared at the initial

investigation stage were reviewed at this time. Input's Output's and data

flow among key points were analyzed minutely at this stage.

Enumerate Potential Candidate Systems:

Here all the available candidate systems were considered. All systems that

could generate the required outputs from the given input set were taken

into account. The main aim was to transfer the entire logical model into a

physical system model.

Another aspect of this system was the consideration of the hardware that

could handle the total system requirements. The processing speed and the

Page 18: Telephone Exchange System

memory were the main criteria. In the Computerized Voting System as

there were no candidate systems available, more weight was given to the

hardware part as large databases have to be processed at a fast pace.

Feasibility Report:

At the end, a feasibility report was generated and submitted to the

management. The main points covered in it were:

Overview of the system.

Detailed findings about the existing manual Pension calculation

Systems, its effectiveness, efficiency, operating cost were

emphasized.

Economic justifications for the new system with comparison to the

previous system were also mentioned.

Recommendations and conclusions were also included.

Page 19: Telephone Exchange System

SYSTEM IMPLEMENTATION AND DETAILS OF

HARDWARE AND SORTWARE USED

HARDWARE REQUIREMENTS:-

PC(Pentium Processor)

Computer should be a Pentium processor

preferably. Nothing less then a Pentium processor would work efficiently.

Higher the quality of the configuration higher will be the output of the

various colorful interfaces used into the system. An official or Home PC‟s

that are generally being used now a days will provide the user with the

desired output of this proposed system

32 MB of RAM The basic requirements of RAM is of 32MB but it can

exceed up to any limit available now-a-days for PC‟s (Home PC‟s). The

higher size of memory available in the “RAM” the better will be the

performance. Basically several processes have to be performed

simultaneously from the system hence “RAM” should have enough

memory size

A colorful Monitor The requirement of the monitor is straight forward to

be a colored monitor that is generally available in the market now-a-days

as per the requirement or as desired by the user. All the colorful screens

available in this software for the user will increase the desired of the user

to work on this proposed system. The effect of the colorful interface can be

attained to its best if the monitor used is of good quality.

Hard Disk Requirement

The Hard Disk must be at least of 2GB‟s or of higher

memory as available in the market for home PC‟s. General size disks

available now-a-days will provide the user the best performance of this

proposed system as space should not be a bottleneck for the user using this

software.

Page 20: Telephone Exchange System

SOFTWARE REQUIREMENT:-

Operating System The requirements of operating system is not a matter of

confusion and headache for the user as the user can run this proposed

system on either WIN-95,

WIN-98, WIN-2000 PROFESSIONAL, WIN-ME or WIN-XP that are

generally being used in all offices and homes in today‟s world. Windows

environment is must for this proposed system as this proposed system will

have no functionality available for the user under the UNIX and LINUX

operating system.

Language and GUI tolls required

This proposed system will require

“Visual Basic 6.0” for the functioning of the software as its used as “Front

End” for the user and ”Microsoft Access” as it is used as the “Back End”

for the user. The prime requirement of the “Visual Basic”. This is the

the other hand if the user just wants the “.EXE” file there is no such

requirement for “Visual “Basic” He can work efficiently on this proposed

system irrespective of the fact whether he has “Visual Basic” installed on

his “PC” or not.

Page 21: Telephone Exchange System

Introduction to Visual Basic

Visual Basic is an ideal programming language for developing

sophisticated professional applications for Microsoft Windows. Visual

Basic is a Powerful Development platform that you can use to create

feature-rich applications for the Windows 95 and Windows NT operating

systems quickly and easily. Although professional programmers use Visual

Basic, it is easy for novices to program in Visual Basic with professional

Results. It utilizes of Graphical User Interface for creating robust and

powerful applications. Features such as easier comprehension, user-

friendliness, faster applications development and many other aspects such

as introduction to ActiveX technology and Internet features make Visual

Basic an interesting tool to work with. Visual Basic was developed from

the BASIC programming language. It is based on an event-driven

programming model. Visual Basic provides a rapid application

development (RAD) environment and an easy-to-use set of debugging

tools.

Event Driven Programming

Visual Basic programs are built around events. Events are various things

that can happen in a program. Programs Statements in an event-driven

application execute only when a particular event calls a section of Code

assigned to that event. Events can be triggered by keyboard input, mouse

actions, the operating system, or code in the application. For example,

consider what happens when the user clicks a command button named

Cmd1 on a form. The mouse click is an event. When the Click event

occurs, Visual Basic executes the code in the Sub Procedure named

Cmd1_Click. When the code has finished running, Visual Basic waits for

the next event. Various Controls support various events that will be listed

in the Properties drop-down list. For example the TextBox control supports

various events such Change, Clicks, MouseMove, etc. Several events are

associated with different controls and forms, some of the events being

common to most of them and a few being specific to each control. We will

look into a few of them:

The code entered in the change event fires when there is a change in the

contents of the TextBox.

The click event fires when the TextBox control is clicked.

The MouseMove event fires when the mouse is moved over the Text Box.

Page 22: Telephone Exchange System

Event-based programming simply means that the actions the program

performs are triggered by something that happens, either in the program, or

by the user. This is called an “event”. For instance, when we click a mouse

button, this is an event. When you press a key on the keyboard, or scroll

down the page, these are events. If we put a timer in the program, and set it

to count every second, then every time the timer counts off a second,

which is an event. Basically, anything that the person using your program

does, or anything the program is set to do itself, are events.

How does the program know that to do when these events occur? The

programmer tells it what to do in the code he writes.

When the “New Project” dialog box appears, select “Standard EXE”

(usually the default), and click the “Open” button. We now have a small

squarish box, called a “form” (by default, named “Form1”. There‟s nothing

on the form yet, but you‟re about to change that! On the left-hand side of

your screen, we should see a column of icons, known as “controls”. If we

let your cursor hover over each of them, well see the time of control

displayed.

Find the small, rectangular box called “CommandButton”, and double-

click it. When we do, a copy of that command button should appear in the

middle of the form: There are many properties of this button which can be

controlled, both at “design time” (when we‟re creating the program) and at

“run time” (when the program we create is actually running), but we‟ll get

to those in another lesson.

The important thing to note is that, while we have a form, and a command

button on this form, if we were to start the program you‟ve created so far,

nothing would happen when we click that button.

If we want, we can test that out. If we press the F5 key, the program we

have created will become functional, and the form, with the button, will

appear on the screen. We can click on the button, and nothing will happen.

That‟s because we haven‟t “told” the program, in code, to do anything

when the “Click” event occurs for that command button.

Click the close button in the upper right corner of your form, and the

program will stop, and Visual Basic will return us to the “Design

Environment”, where we can make your program do what you want it to

do. Now, double click the command button. This time, we should find you

looking at a text-type box. This is the code window. And, because we

clicked on the command button, Visual Basic assumes we want to write

Page 23: Telephone Exchange System

code to tell the program what to do when we click the button while the

program is running. It should look something like:

Private Sub Command1_Click()

End Sub

The first line tells Visual Basic that this is a “sub” (short for subroutine),

which affects the control known as Command1, for the event known as

Click. The second line tells Visual Basic this is the end of the code for that

event. So, when our program is running, and Command1 button is clicked,

the program will know to do whatever you have written in code between

those two lines.

Msgbox “This is my first program!”, vbokonly, “First”

Now, press the F5 button again. After the program begins to run, click on

the Command1 button. This time, when the Click event occurs for that

button, the program knows what to do, and promptly displays a message

box, which was programmed to display on the screen.

Obviously, While everything in Visual Basic isn‟t that easy, everything

works on the same principle: an event and does what we have told it to do.

If we don‟t want something to happen when an event occurs, we simply

don‟t write any code for it.

The IDE

One of the significant features in Visual Basic 6.0 is the Integrated

Development Environment (IDE). In Visual Basic 6.0, the IDE is in a

Multiple Document Interface (MDI) format.

IDE is a term commonly used to describe the interface and environment

that we use to create our applications. It is called integrated because we

can access virtually all of the development tools that we need from one

screen called an interface. It is also referred to as the design environment,

or the program. The Visual Basic IDE is made up of a number of

components:

Menu Bar

Tool Bar

Project Explored

Page 24: Telephone Exchange System

Properties Window

For Layout Window

Toolbox

Form Designer

Object Browser

Properties, Methods and Events

Properties

Properties define the appearance and behavior of objects. Programming

objects are loaded with properties. A property is a named attribute of a

programming object. Text, Caption, Name, Size, Caption, Color Enabled,

Font, MultiLine, Visible, Width, etc. are common examples of Properties.

Methods

A method is an action or a task that can be performed on objects. Like

properties, methods are a part of objects. Generally, methods are actions

you want to perform, whereas properties are the attributes you set or

retrieve. Move and SetFocus are common examples or methods.

Events

Visual Basic programs are built around events. Events are various things

that can happen in a program. An event is an action recognized by a form

or a control. In an event driven application, the program statements are

executed only when a particular event calls a specific part of the code that

is assigned to the event Clicking a mouse or pressing a key are examples of

events.

Here are some of the events we use Visual Basic:

Active Change Click

DragDrop KeyDown KepUp

Cls Point Pset

LostFocus MouseDown MouseUp

Form Object

Visual Basic has several different types of objects. The form is one of the

most basic objects in which the application id developed. The user

Page 25: Telephone Exchange System

interacts with a application primarily through form objects and the controls

placed on them. A form is a window that contains application code and has

other objects placed on it to create the user interface. Visual Basic initially

included a default form, Form1 file in each new project. You can change

the form‟s name and caption to identify the purpose of the form. Forms

have their own properties, Methods and Events, which you can use to

control their appearance and behavior.

Setting Form Properties

Visual Basic Application program uses the form to gather input from the

user and to display the output information to the user. From the user‟s

point of view, the form window is the program. Hence it is necessary to

identify this window as clearly and definitively as possible, by assigning

appropriate properties to it. As with any other objects, you can set form

properties at design time in the Properties Window or at run time by

writing code. There are a few properties indigenous to the form alone and

they are:

Border style Caption Control Box

Max Button Min Button MDI Child

Font FontName FontSize

FontBold FontItalic FontStrikethru

FornUnderline Drawnode Drawstyle

Draw width Fill Color Fill Style

Fore Color Icon MouseIcon

Picture Windowstable StartupPosition

Control Box Name Mouse Pointer

Form Methods

A form also exposes Methods. Some methods of the Form Object include:

Hide PointForm Show

Point Pset Zorder

Move Refresh Cls

SetFocus Line Circle

Form Events

Like any other object, form responds to events. Events of form Object

include the following:

Page 26: Telephone Exchange System

Activate DragOver Resize

Click GotFocus DragDrop

Unload QueryUnload Terminate

Initialize Load Paint

LostFocus Unload Deactivate

Categories of Controls

Visual Basic Controls are classified as Standard Controls and Insertable

Objects. These three Categories are described below:

The Intrinsic Control

A Control is an object that can be drawn on a form object to enable user

interaction with an application. Controls are used to receive user input and

display output has its own set of properties, methods and events. Controls

have properties that define their appearance, such as size color, etc, and

their behavior such as their response to the user input. They can respond to

events initiated by the user or triggered by the system. Also methods can

be used with some controls to change their location or size. Most of the

controls provide choices to users that can be in the form of Option Button

or CheckBox Controls.

Standard Controls:

These controls are contained inside the .EXE file and are always included

in the toolbox that cannot be removed.

These controls are also called “Intrinsic Controls”. Examples of Standard

Controls are:

Page 27: Telephone Exchange System

Label

PictureBox

Command Button

Frame

TextBox

Checkbox

Option Button

ComboBox

Image

Hscroll Bar

Vscroll Bar

Timer

DirList Box

DriveList Box

File List Box

Shape

Data

OLE

The textbox Control, Label Control and Command Button Control are

explained below.

TextBox Control

A TextBox control, which is also called an edit control, displays information

entered at design time, entered by the user, or displays information by the

user, or assigned to the control in code at run time.

Properties Settings to a TextBox

Assigning the necessary string to the text property of the control can enter

text. To display multiple lines of text in a TextBox control, set the MultiLine

property to true. If you set the MultiLine property to True, you can use the

alignment property to set the alignment of text within the textBox. By default

the text is left justified. If the MultLine property is set to False, setting the

Alignment property has no effect.

We can also use the Font property to set the style, size, etc of the Font in the

Text box. In order to customize the scroll bar combination on a TextBox, set

the ScrollBars property. Scroll Bars will appear on the TextBox when its

MultiLine property is set to True and its Scroll Bars property is set to

anything except None 0.

Label Control

A label control is a graphical control you can use to display text, which a user

can‟t change directly.

Page 28: Telephone Exchange System

Properties of a Label Control

We can write code that changes the caption property displayed by a label

control in response to events at run time. We can also use label property to

identify a control, such as a TextBox control, that doesn‟t have its own

Caption property.

The AutoSize and WorkWrap properties should be set if the user wants the

Label to property display variable-length lines or varying numbers of lines.

Set the UseMnemonic property to True if you want to define a character in

the caption property of the Label as an access key. We can set the Backstyle

and BackColor for setting the Color of the Label Box.

Command Button

Command Button control to begin, interrupt, or end a process, when chosen, a

Command Button appears pushed in and so is sometimes called a push button.

Properties of Command Button Control

To display text on a CommandButton control, set its Caption property.

Clicking a command button can activate an event. Setting the Backcolor

property to the desired choice can set a button‟s background color.

The Text Color of a command button can be set using the ForecColor

property. The Font of a command button can be selected by setting the Font

property in the Font dialog box to the desired Font and the style and size can

also be set.

Visual Basic Modules

The modules are basically of three types namely Form Module, Standard

Module and Class Module. Each Form, Standard and Class Module can

contain:

Procedures

Declarations

Page 29: Telephone Exchange System

The three kinds of Modules form a kind of hierarchy that allows you to

organize your code. They are explained below:

Form Module

Form modules (of .frm file extension) can contain procedures that can handle

events as they occur within a form. Form modules also can contain general

procedures and form-level declarations of variables, constants, types, and

external procedures. The code you write in a form module is specific to the

application that contains the form.

Standard Module

When a application contains code that is shared by several forms, you should

store it in a standard module, code in a standard module can also be Public to

make it shareable to all modules in the application. Procedures stored in the

standard module are called general procedures. Standard module (.bas files)

can contain public (available to the whole application) or module-level

declarations of variables, constants, types, external procedures, and global

procedures. You can potentially reuse code from a standard module in many

different applications.

Class Module

Class modules (.cls files) contain the definition of classes used to create new

objects. These new objects can include customized properties and methods.

Dialog Boxes

Dialog Boxes are used to display information to the user. They ask the user

for the data needed to continue an application. Dialog Boxes are either Modal

or Modeless. A Model Dialog Box does not allow the user to continue with

other application unless it is closed or unloaded. The modeless dialog box

allows shifting of focus between the dialog box and another form without

closing the dialog Box.

There are three ways of adding dialog Boxes, which are as follows:

Predefined Dialog Boxes

Custom Dialog Boxes

Page 30: Telephone Exchange System

Common Dialog Boxes

PreDefined Dialog Boxes

These can be easily added to an application. This uses the InputBox and

MstBox functions.

The syntax of the MsgBox is

MsgBox <prompt>, <style>, <title>

The prompt is what will be shown in the box as the message. Style determines

what kinds of buttons are to be used in the box. Title is to specify the title of

the message box. If no title is specified, the project name is considered as the

default tide.

Some example will enhance the understanding.

MsgBox “Save Record?”, vbYesNo + vbQuestion, “Save”

Syntax for the InputBox is shown here;

InputBox <prompt>,<default value>,<title>,<x>, <y>

The prompt for InputBox is same as the MsgBox. Default value is supplied to

ensure that the variables are assigned with some value in case the user fails to

enter the data. Title needs no explanation. X and Y are used to position the

input box in the desktop. No example is needed for this as the syntax is quite

self-explanatory.

Taking about dialog boxes, there are two types of dialog boxes available.

Ones that are Model and ones that are Modal-less. Some dialog boxes which

appear once will not let the user continue unless he answers the box and

closes it. He won‟t be able to perform any other transaction with the

application by ignoring the box. Such boxes are called Model box. Some

dialog boxes will let the user interact with the application without having to

fully answer the dialog box. Such boxes are called Modeless. Find & Replace

box is Modeless.

Page 31: Telephone Exchange System

Custom Dialog Boxes

This created by adding Controls such as Command Button, Option Button,

etc., to the form or by Customizing an existing dialog box.

Common Dialog Boxes

Standard Dialog Boxes are created using Custom Dialog Controls.

Data types in Visual Basic

For efficiency in storing and using data, Visual Basic provides data types that

store specific kinds of information such as Data types that store text, Data

types that store numbers and other data types.

Data types that store text are:

String (variable length)

String (fixed length)

Data types that store numbers are:

Single

Double

Currency

Boolean

Integer

Long Integer

Date

Page 32: Telephone Exchange System

Other data types are:

Variant

Object

Scope and Visibility of Variables

There are many ways of declaring variables. Depending on where the variables are

declared and how they are declared, we can determine how they can be used by our

application.

The different ways of declaring variables in Visual Basic are:

Explicit Declaration

Using Option Explicit Statement

Scope of variables

Explicit Declaration

A variable declaration tells Visual Basic to reserve space in memory. However, it is

not required that you declare a variable before you use it. When Visual Basic

encounters a new variable, it assigns it the default variable type and value. This is

called implicit declaration. Though this type of declaration is easier, but for more

control over the variables, it is advisable to declare them explicitly. To declare a

variable explicitly, you use the Dim statement to name the variable and its type as in

the following syntax:

The As type clause in the Dim Statement allows the data type or the object type to

be defined when the variable is declared. This is called explicit declaration.

Dim strname As String

Dim intCtr As Integer

Variable Name Data Type

Page 33: Telephone Exchange System

Operators in VB

Operators cab be classified as Relational Operators, Logical Operators, Arithmetical

and Character Operators.

Relational Operators

There are six relational Operators.

Operator Description

< Less than

<= Less than or Equal to

> Greater than

>= Greater than or equal to

= Equal to

<> Not Equal to

Logical Operators are:

Operator Function

And Combine two expressions. If both the expressions

are true, then the entire expression is true.

Or Combines two expressions, If one of the expressions

is true, the entire expression is true.

Not The negative of a single expression.

Xor Combines two expressions. The entire expression is

Considered True if the two expressions are not both

True or both false.

Eqv Combines two expressions. Both expressions must

be true or false for the entire expression to be true.

Imp Combines two expressions. The entire expression is

true except when the first expression is true and the

second expression is false.

Page 34: Telephone Exchange System

Using Data Access Objects

One of the key images of Visual Basic is it being a front end. The term end refers to

and application that fetches somewhat raw data from server and presents it in a

readable useful form. Since the server (usually a database server) supplies the data,

the fronted is always identified as a client, the server being the backend. VB works

at the client side. It enables connecting to the server, opening the database and

fetching the data. There are lots of processes going on at the client side, basically

from Visual Basic in order to access the database at the backend.

Data Access Options in VB

Visual Basic provides a variety of options to access remote Client/Server databases.

They are:

Data Access Objects (DAO)

Remote Data Objects (RDO)

ActiveX Data Objects (ADO)

Data Control

ODBC Direct

Remote Data Control (RDC)

Open Database Connectivity (ODBC)

Visual Basic Library for SQL Server (VBSQL)

Data Access Objects (DAO)

DAO is probably the most popular access method for Windows. DAO

communicates with the data sources through the Jet database engine and can be used

to access a wide variety of database formats, including Microsoft Access, ISAM

(Indexed Sequential Access Method), and Text. In addition to Using Jet, DAO can

also access ODBC (open Database Connectivity) databases through its ODBC

Direct object mode.

Remote Data Objects (RDO)

RDO provides a framework for using code to create and manipulate components of a

remote ODBC database system, It is a wrapper around the ODBC API and the driver

manager that interacts with an ODBC database. It is often used for accessing large

relational databases from Visual Basic and it supports complex stored procedures.

Page 35: Telephone Exchange System

ActiveX Data Objects (ADO)

ADO is programming model that eliminates the need to choose from among SAO,

RDO and any other data access methods. It is designed to provide a common bridge

between different databases, file systems and e-mail servers. ASO fits all approach

as to the database access. It can connect to any type of database, both relational and

non-relational, local and remote.

Data Control

Data Control binds data-aware controls or Microsoft Access and other ODBC data

sources.

ODBC Direct

ODBC Direct allows accessing of ODBC data source through the RDO objects,

bypassing the JET database engine.

Remote Data Control (RDC)

RDC binds the controls to an ODBC remote database.

Open Database Connectivity (ODBC)

ODBC is an API called interface to the open Database Connectivity Libraries and

drives to provide data access to Oracle and other databases that provide an ODBC

driver.

Visual Basic Library for SQL Server (VBSQL)

VBSQL is an implementation of the DB library API specifically designed to provide

access to SQL Server through a Visual Basic application.

Using Visual Data Manager

But in order to access a database, we primarily need one. We create the database

using any of the database servers, viz. SQL Server, Oracle or Sybase. We can either

Page 36: Telephone Exchange System

open Microsoft Access, create our tables or use the built-in support provided by

Visual Basic.

Visual Data Manager is the Add-ins tool provided by Visual Basic to perform this

role, we‟ll have to either create it using Microsoft Access or write relevant code in

Visual Basic to do this dirty job. Visual Data Manager saves us from this headache.

It is comfortable creating a database in Visual Data Manager. And then using it in

VB.

We can access the Visual Data Manager by Add-ins (R) Visual Data Manager. To

create a database, select New (R) Microsoft Access (R) Version 7.0 MDB>

There isn‟t any use in just creating the databases and living with them. They need to

be put into put into use. The „use‟ we refer to could be in the form of adding records

to it, deleting records from it, mandating records or performing some query. Such

operations on a database usually called transaction.

Once a transaction is started on a database, all the changes may be recalled by using

a rollback operation. Similarly, changes may be saved permanently by issuing a

commit operation. On issuing commit statements, even a rollback will not undo the

changes. The visual Data Manager has three buttons to implement the transaction

operations. They are:

Begin Transaction

Rollback Current Transaction

Commit Current Transaction

Transactional buttons are the last buttons on the right of the Visual Data Manager.

Transaction ensures that the changes are complete always, i.e., they are either

completely saved or completely rolled back.

Data Access using Data Control

The Data control gives us access to databases without programming. We can set a

few properties for the control and use regular controls such as text boxes to display

the values of the fields in the database. Record sets are the foundation of database

programming.

Page 37: Telephone Exchange System

The most important properties of the Data Control are:

Database Name

Record Source

Connect Property

Exclusive Property

Exclusive property

Read Only

Record Set Type

BOFAction & EOFAction

Database Name

Database Name, specifies the database to be used, specify the database to which you

want to gain access by setting the name of a database.

Record Source

Record Source, specifies the part of the database seen by the control. At any time,

the Data control is positioned at a single row (record) of its Recordset. The user can

move to any other record with the help of the navigation buttons on the Data control.

To specify which records to retrieve, set the Record Source property to the name of a

table within the database or to an SQL string.

Control Property

The connect property specifies the type of database to open. It can include

arguments such as user ID and password.

Exclusive Property

The Exclusive property determines whether or not you have exclusive use of the

database. If you set the Exclusive to True and then successfully open the database,

no other application will be able to open the database until you close it.

Read only Property

The Read only property determines whether or not you can update the database. If

you do not plan to update the database, it is more efficient to set the Read Only

Page 38: Telephone Exchange System

Property to true. Read only returns or sets a value that determines whether the

control‟s Recordset is opened for read-only access.

Record Set Type

Record set Type returns or sets a value indicating the type of Record Set object we

want the Data control to create.

When the value is 0, it creates a table type of Record Set. Table Type deals only

with one table. Here, only one record will be stored in the memory. This would be

particularly useful in a multi-user environment. The user can apply lock on a single

table and restrict its usage while updating the records. Table Type allows Read and

Write operations. The Record Count properly will always be 1. Understanding.

When the value is 1, it creates a Dysaset type of Recordset. By default, the value

will be 1. Dynaset is preferred when a query is performed on multiple tables. Once

the query is performed at the Server side all the records affected by the query are

brought into the client. In this way, DynaSet stores more that one record in the

memory. If the client‟s memory is not adequate to store all the affected records, it

performs the partial transfer technique to bring in records to the Client. DynaSet

allows Read and Write operations. When the value if 2, it creates a SnapShot type of

Record set. Quite similar in DynaSet in all the behavioral aspect. The major

difference being that SnapShot allows only read operations.

BOF Action

It determines what action the Data control will take when the BOF properties of the

recordset are true. BOFAction sets or returns a value indicating what action the Data

control should take when the BOF property is True. When the value is set to 0, it

repositions the control on the first record. When the value is set to 1, moves past the

beginning of a Recordset and lands on an invalid record. At the same time, it triggers

the Data control‟s validate event for the first record.

EOF Action

EOFAction sets or returns a value indicating what action the Data control takes

when the EOF property is True. When the value is set to 0, it repositions the control

on the first record. When the value is set to 1, moves past the beginning of a

recordset and lands on an invalid record. At the same time, it triggers that Data

controls validate event for the first record. When the value is set to 2, it adds a new

Page 39: Telephone Exchange System

blank record to the recordset, which the user can edit. The new record is written to

the database when the user repositions the Data control. If the EOF Action property

of the Data control is set to vbActionNew, and you use the Data control to move past

the last record in the recordset, the data control will automatically execute the

AddNews method so we can enter a new record.

Binding of Controls

The controls that support that DataSource and DataField are called Bound controls.

These controls can be bound using Data controls. TextBox, Label, PictureBox, etc.,

are the example of bounded controls.

Navigation Methods

The data control also has built-in functionality which can be accessed through an

application‟s code with the Data control‟s methods. The simplest methods are the

navigation methods, which correspond to the actions of the four buttons on the

control, and they are as follows:

MoveFirst

MoveLast

MovePrevious

MoveNext

MoveFirst

The code in the click even of the Move first data-bound controls would be:

Private Sub Firstbutton_click()

Data1.Recordset.MoveFirst

End Sub

Here we move the recordset to the first record.

MoveLast

The code in the click event of the Move Last button would be:

Private Sub Lastbutton_click()

Data1.Recordset.MoveLast

End Sub

Here we move the recordset to the last record.

Page 40: Telephone Exchange System

MoveNext

The cord in the click event of the Move Next button would be:

Private Sub Nextbutton_click ()

Data1.Recordset.MoveNext

If Data1.Recordset.EOF then

MsgBox “We are on the Last Record”

Data1.Recordset.Movelast

End if

End Sub

Here the program moves to the next record, and then it examines the EOF property.

If EOF is True, we have landed on a record after the last one. The program displays

a message box that tells us that the record has been reached and then moves to the

last record.

MovePrevious

The code in the click event of the Move Previous button would be:

Private Sub Previousbutton_click ()

Data1.Recordset.MovePrevious

If Data1.Recordset.EOF then

MsgBox “We are on the First Record”

Data1.Recordset.MoveFirst

End if

End Sub

The code behind the previous button is similar to Next button. It called the

MovePrevious method, and instead of the EOF property, it examines the BOF

property of the Data control.

Find Methods

In addition to the navigation methods, the Data control provides four methods for

finding records in the recordset. One of the basic operations we perform on

databases is locating specific records. The following methods locate records:

Page 41: Telephone Exchange System

FindFirst Finds the first record that meets the specified criteria

FindLast Finds the last record that meets the specified criteria

Findnext Finds the next record that meets the specified criteria

FindLast Finds the last record that meets the specified criteria

FindPrevious Finds the previous record that meets the specified criteria

Entering Data

The data control is a great tool for browsing tables and editing their contents, but we

can‟t rely on the no-code approach of the Datacontrol for data entry. To write data-

entry applications, we use the following methods:

Add New Appends a record to the table

Delete Deletes the current record

Update writes the current record to the database

Refresh Reloads the data from the database

Edit Edits the current record

Page 42: Telephone Exchange System

BUTTONS EXPLANATION: - In this software package there are various general options

available on every screen. . These are the “Navigation Button”. The various

navigation buttons are as follow: -

First: - With the clicking of navigation button the screen will display the first record

of the corresponding data. This will allow the user to navigate through the records

from first till the end of records.

Next: - With the clicking of this button the user will navigate into all the records. In

the database. It will traverse the database in the forward direction i.e. from the first

record till the last record. As the user reaches the last record, the control from this

button will be shifted to another button available on the form i.e.” Previous”.

Last: - When the user clicks this button, then it will display the last record of the

database. With the help of this button the user can shift directly to the last record of

the data. If the user reaches the last record, through proper navigation with the help

of “Next” button the control from this button will be shifted to another button

available on the form i.e. ”Previous”.

Previous: - With the help of this navigation button the user can navigate in the

corresponding data in the backward direction i.e. from the last record till the first

record. As the user reaches on the first record, this button will lose its control will be

shifted to the “Next” button.

Add New: - This button is used to add new records into the corresponding data.

When the user is clicking this button, all the records are cleared allowing the user to

insert the new record into the database. If the user wants to save the record, which

has been inserted by him, he can make use of the “Save” button. The following

“message box” will appear on the screen if the user will clicks the save button: -

Page 43: Telephone Exchange System

Update: - This option allows the user to update any of the existing records. The user

make changes in the records with the help of this button, then either make use of the

“Save” button to save the changes made by him. If the user wants to save the record,

which has been edited by him, he can make use of the “Save” button. The following

“message box” will appear on the screen if the user clicks the “Update” button.

Delete: -

This button is used in order to delete the existing records from the database.

When the user clicks this button, the following “Message box” appears on the

screen.

Save: - With the helps of this option available on every screen the user can save any

newly added record or the currently altered record of the database. The following

“Message box” appears on the screen when the user is going to save the newly

added record. The following “Message box” will appear on the screen when the user

is going to save the record after making modifications in any of the existing record

of the corresponding data.

Search: -

With The help of this option available on every screen , the user can search any

particular record in the database. When user search the record in the database then

all information display on the serene.

Page 44: Telephone Exchange System

Back – End In MS – ACCESS

About Designing a Database

Before you use Microsoft Access to actually build the tables, forms, and other

objects that will make up your database, it is important to take time to design your

database. Whether you are using a Microsoft Access database or a Microsoft Access

Project, good database design is the keystone to creating a database that does what

you want it to do effectively, accurately, and efficiently.

Steps in designing a database

This topic provides reference information about these basic steps in designing a

database:

Determine the purpose of your database

The first step in designing a database is to determine its purpose and how it‟s to be

used. You need to know what information you want from the database. From that,

you can determine what subjects you need to store facts about (the tables) and what

facts you need to store about each subjects (the fields in the tables).

Talk to people who will use the database. Brainstorm about the questions you and

they would like the database to answer. Sketch out the reports you‟d like it to

produce. Gather the forms your currently use to record your data. Examine well

designed databases similar to the one you are designing.

Determine the tables you need

Determining the tables can be the trickiest step in the database design process.

That‟s because the results you want from your database – the reports you want to

print, the forms yo9u want to use, the questions you want answered – don‟t

necessarily provide clues about the structure of the tables that produce them.

You don‟t need to design your tables using Microsoft Access. In fact, it may be

better to sketch out and rework your design on paper first. When you design your

tables, divide up pieces of information by keeping these fundamental design

principles in mind:

Page 45: Telephone Exchange System

A table should not contain duplicate information, and information should not be

duplicated between tables. In this respect, a table in a relational database differs

from a table in a flat-file application such as a spreadsheet.

When each piece of information is stored in only one table, you update it in one

place. This is more efficeient, and it also eliminates the possibility of duplicate

entries that contain different information. For example, you would want to store each

customer address and phone number only once, in one table.

Each table should contain information about one subject.

When each table contain facts about only one subject, you can maintain information

about each subject independently from other subjects. For example, you would store

customer addresses in a different tables from the customers‟ orders, so that you

could delete one order and still maintain the customer information.

Determine the fields you need

Each table contains information about the same subject, and each field in a table

contains individual facts about the table‟s subjects. For example, a customer table

may include company name, address, city, state, and phone number fields.

When sketching out the fields for each table, keep these tips in mind:

Relate each field directly to the subject of the table.

Don‟t include derived or calculated data (data that is the result of an

expression).

Include all the information you need.

Store information in its smallest logical parts (for example, First Name and

Last Name, rather that Name).

Identify the field or fields with unique values in each record

In order for Microsoft Access to connect information stored in separate tables – for

example, to connect a customer with all the customer‟s orders – each table in your

database must include a field or set of fields that uniquely identifies each individual

record in the table. Such a field or set of fields is called a primary key.

Page 46: Telephone Exchange System

Determine the relationships between tables

Now that you‟ve divided your information into tables and identified primary key

fields, you need a way to tell Microsoft Access how to bring related information

back together again in meaningful ways. To do this, you define relationships

between tables in a Microsoft Access database.

Refine your design

After you have designed the tables, fields, and relationships you need, it‟s time to

study the design and detect any flaws that might remain. It is easier to change your

database design now than it will be after you have filled the tables with data.

Use Microsoft Access to create your tables, specify relationships between the tables,

and enter enough sample data in your tables so you can test your design. To test the

relationships in your database, see if you can create queries to get the answers you

want. Create rough drafts of your forms and reports and see if they show the data

you expect. Look for unnecessary duplications of data and eliminate them. If you

find problems, refine the design.

Enter date and create other database Objects

When you are satisfied that the table structures meet the design principles described

here, then it‟s time to go ahead and add all your existing data to the tables. You can

then create any queries, forms, reports, data access pages, macros, and modules that

you may want.

Use Microsoft Access Analysis tools

Microsoft Access includes two fools that can help you to refine the design of your

Microsoft Access database. The Table Analyzer Wizard can analyze the design of

one table at a time, can propose new table structures and relationships if appropriate,

and can divide a table into new related tables if that makes sense.

The performance analyzer can analyze your entire database and make

recommendations and suggestions for improving it. The wizard can also implement

these recommendations and suggestions.

Page 47: Telephone Exchange System

The Difference between Importing and Linking

Microsoft Access provides two choices for using data from an external data source.

You can Import the data into a new Microsoft Access table, which is a way to

convert data from a different format and copy it into Microsoft Access. You can also

import database objects into the current Microsoft Access database or Microsoft

Access project. Link the data, which is a way to connect to data from another

application without importing it so that you can view and edit the data in both the

original application and in an Access database. (In previous versions of Microsoft

Access, this process was referred to as attaching:). You can import or link data from

a variety of supported databases, programs, and file formats.

Importing data

Importing data creates a copy of its information in a new table in your Access

database or Access project. The source table or file is not altered in this process.

When importing data, you can‟t append data to existing tables (except when

importing spreadsheet or text files). However, once you have imported a table, in an

Access database you can perform an append query or in an Access project you can

use a stored procedure to add the table‟s date to another table.

You can also import database objects other than tables, such as forms or reports,

from another Access database or Access project.

Linking data

In an Access database, linking data enables you to read and in most cases, update

data in the external data source without importing. The external data source‟s format

is not altered so that you can continue to use the file with the program that originally

created it but you can add, delete, or edit its data by using Microsoft Access as well.

You can link a table only in an Access database, not an Access project.

Microsoft Access uses different icons to represent linked tables and tables that are

stored in the current database. If you delete the icon for a linked table, you delete the

link to the table, not the external table itself.

Page 48: Telephone Exchange System

Data Structure

New Connection

Field Name Data Type Width Description Checks Remarks

Tno. Number Long integer Specify the

Telephone

number

Cannot be

null & Text

Yes

CName Text 50 Specify the

customer

name

Cannot be

null

No

JName Text 50 Specify the

joint

applicant

name

Cannot be

null

No

FGName Text 50 Specify the

Father/Group

name

Cannot be

null

No

PGNo. Number 50 Specify the

Pan Gir No

Cannot be

null

No

WTNo. Number 50 Specify the

working

phone No

Cannot be

null

No

HNo. Text 50 Specify the

House No

name

Cannot be

null

No

ST No Text 50 Specify the

Street No

Cannot be

null

No

City Text 50 Specify the

City name

Cannot be

null

No

Pin Code Number 50 Specify the

Pin Code No

Cannot be

null

No

CAddress Text 50 Specify the

Customer

Address

Cannot be

null

No

Email Text 50 Specify

Email

Address

Cannot be

null

No

CCode Number 50 Specify

Category

Code

Cannot be

null

No

CAT Text 50 Specify the

Category

Cannot be

null

No

Page 49: Telephone Exchange System

name

CGCode Number 50 Specify the

Category

Group Code

Cannot be

null

No

CGName Text 50 Specify the

Category

Code name

Cannot be

null

No

Purpose Text 50 Specify the

Purpose of

Connection

Cannot be

null

No

STD Text 50 Specify the

Facility Of

STD

Cannot be

null

No

ISD Text 50 Specify the

Facility Of

ISD

Cannot be

null

No

CLI Text 50 Specify the

Facility Of

CLI

Cannot be

null

No

Hotline Text 50 Specify the

Facility Of

Hotline

Cannot be

null

No

Conf. Text 50 Specify the

Facility Of

Conferencing

Cannot be

null

No

CF Text 50 Specify the

Facility Of

Call

Forwarding

Cannot be

null

No

AD Text 50 Specify the

Facility Of

Abbreviated

Dialing

Cannot be

null

No

Page 50: Telephone Exchange System

Payment During Connection

Field Name Data Type Width Description Checks Remarks

Cuname

Text 50 Specify the

Customer name

Cannot be

Null

No

Tno

Number Long

integer

Specify the

Telephone No.

Cannot be

Null

Yes

JName

Text 50 Specify the

Joint Applicant

name

Cannot be

Null

No

PMode

Text 50 Specify the

Payment

mode name

Cannot be

Null

No

Dno.

Number Long

Integer

Specify the

Draft No.

Cannot be

Null

No

BName

Text 50 Specify the

Bank name

Cannot be

Null

No

Exc

Number Long

Integer

Specify the

Exchange

Capacity

Cannot be

Null

No

Area

Text 50 Specify the

Area(Rural/Urban)

Cannot be

Null

No

CCode

Number Long

Integer

Specify the

Category Code

Cannot be

Null

No

Cname

Text 50 Specify the

Category Name

Cannot be

Null

No

CGcode

Number Long

Integer

Specify the

Concessional

Group Code

Cannot be

Null

No

CGnmae Text 50 Specify the

Conecssional

Group Name

Cannot be

Null

No

IFee

Number Long

Integer

Specify the

Installation Fee

Cannot be

Null

No

RMonth

Number Long

Integer

Specify the

Rent Two Month

Cannot be

Null

No

NAmount

Number Long

Integer

Specify the

Net Amount

Cannot be

Null

No

PDate

Date/Time General Specify the

Payment date

Cannot be

Null

No

CGcode

Number Long

Integer

Specify the

Concessional

Cannot be

Null

No

Page 51: Telephone Exchange System

Group Code

TIR

Text 50 Specify the

Phone Instrument

Required

Cannot be

Null

No

IWR Text 50 Specify the

Internal Wiring

Required

Cannot be

Null

No

Page 52: Telephone Exchange System

Prepare The Telephone Bill

Field Name Data Type Width Description Checks Remarks

Tno Number Long Int Specifies the

Telephone

no.

Cannot be

null

No

PMR Number Long Int Specifies the

Previous

Meter

Reading

Cannot be

null

No

CMR Number Long Int Specifies the

Current Meter

Reading

Cannot be

null

No

MCalls Number Long Int Specifies the

Meter Calls

Cannot be

null

No

NCalls Number Long Int Specifies the

Net Calls

Cannot be

null

No

NAmount Number Long Int Specifies the

Total Amount

Cannot be

null

No

Page 53: Telephone Exchange System

Show_Bill

Field Name Data Type Width Description Checks Remarks

Tno.

Number Long

Integer

Specify the

Telephone No

Cannot be

Null

Yes

SName Text 50 Specify the

Subscriber Name

Cannot be

Null

No

SAddress Text 50 Specify the

Subscriber

Address

Cannot be

Null

No

SFName Text 50 Specify the

Subscriber‟s

Father Name

Cannot be

Null

No

BIDate Date/Time General Specify the Bill

Issue date

Cannot be

Null

No

PMR Number Long

Integer

Specify the

Previous Meter

Calls

Cannot be

Null

No

PMR Number Long

Integer

Specify the

Previous Meter

Calls

Cannot be

Null

No

NCCalls Number Long

Integer

Specify the Net

Chargeable Calls

Cannot be

Null

No

TPDDate Number Long

Integer

Specify the Total

Payment After

Due Date

Cannot be

Null

No

Surcharge Number Long

Integer

Specify the

Surcharge

Cannot be

Null

No

Pupto Date/Time Genaral Specify the

Previous Meter

Calls

Cannot be

Null

No

MCalls

Number Long

Integer

Specify the

Meter Calls

Cannot be

Null

No

Page 54: Telephone Exchange System

Reconnection The Telephone Connection

Field Name Data Type Width Description Checks Remarks

Tno Number LongIng Specifies the

Telephone no.

Cannot be

null

Yes

Dreconn Date/Time General Date Specifies the

Date of

Reconnection

Cannot be

null

No

PAmount Number LongInt Specifies the

Pay of

Amount

Cannot be

null

No

Page 55: Telephone Exchange System

Employee Details

Field Name Data Type Width Description Checks Remarks

EGPF Number Long Integer Specify the

Emp No

Cannot be

Null

Yes

Ename Text 50 Specify the

Emp name

Cannot be

Null

No

FNmae Text 50 Specify the

Emp Father

name

Cannot be

Null

No

Eaddress Text 50 Specify the

Emp

Address

Cannot be

Null

No

PinCode Number Long Integer Specify the

pin code no.

Cannot be

Null

No

DOB Date/Time General

Date

Specify the

Emp Date

Of Birth

Cannot be

Null

No

Djoining Date/Time General

Date

Specify the

Emp Joining

Date

Cannot be

Null

No

Group Text 50 Specify the

Emp Group

Name

Cannot be

Null

No

BPay Number Long Integer Specify the

Emp Basic

Pay

Cannot be

Null

No

Sex Text 50 Specify the

Emp sex

Information

Cannot be

Null

No

Department Text 50 Specify the

Emp

Department

Cannot be

Null

No

Destination Text 50 Specify the

Emp

Destination

Cannot be

Null

No

Page 56: Telephone Exchange System

Employee Payroll System

Field Name Data Type Width Description Checks Remarks

EGPF Number Long Integer Specify the

Emp No

Cannot be

Null

Yes

EName Text 50 Specify the

Emp Name

Cannot be

Null

No

Bpay Number Long Integer Specify the

Emp Basic

Pay

Cannot be

Null

No

HRA Number Long Integer Specify the

Emp House

rent

Allowance

Cannot be

Null

No

DA Number Long Integer Specify the

Emp

Dearness

Allowance

Cannot be

Null

No

GTA Number Long Integer Specify the

General

Traveling

Allowance

Cannot be

Null

No

ITax Number Long Integer Specify the

Emp Income

Tax

Cannot be

Null

No

GPFAd Number Long Integer Specify the

Emp

Advance

Payment

Cannot be

Null

No

TD Number Long Integer Specify the

Emp Total

Deduction

Cannot be

Null

No

Nsalary Number Long Integer Specify the

Emp Net

Salary

Cannot be

Null

No

HLIssue Text 50 Specify the

emp House

Loan Issue

Cannot be

Null

No

Page 57: Telephone Exchange System

Complaint System

Field Name Data type Width Description Checks Remarks

Tno Number Long integer Specify the

Telephone

No

Can Not be

Null

No

Sname Text 50 Specify the

Subscriber

Name

Can Not be

Null

No

Address Text 50 Specify the

Subscriber‟s

Address

Can Not be

Null

No

Date Date/time General

Date

Specify the

Complaint

Date

Can Not be

Null

No

Page 58: Telephone Exchange System

Testing

In a software development project, errors can be infected at any stage during

development. For each phase, we have techniques for detecting and eliminating

errors that originate in that phase. However, no technique is perfect, and it is

expected that some of the errors of the earlier phases will finally manifest

themselves in the code. This is particularly true because in the earlier phases most of

the verification techniques are manual because no executable code exists.

Ultimately, these remaining errors will be reflected in the code. Hence, the code

developed during the coding activity is likely to have some requirements errors and

design errors, in addition to errors introduced during the coding activity. Because

code is frequently the only product that can be executed and whose actual behavior

can be observed, testing is the phase where the errors remaining from all the

previous phases must be detected. Hence, testing performs a very critical role for

squalidly assurance and for ensuring the reliability of software.

During testing, the program to be tested is executed with a set of test cases, and the

output of the program for the test cases is evaluated to determine if the program is

performing as expected. Due to its approach dynamic testing can only ascertain the

presence of errors in the program; the exact nature of the errors is not usually

decided by testing. Testing forms the first step in determining the errors in a

program. Clearly, the success of testing in revealing errors in programs depends

critically on the test cases. Much of this chapter is devoted to test case selection,

criteria for selecting test cases, and their effect on testing.

Testing a large system is a complex activity, and like any complex activity it has to

be broken into smaller activities. In this chapter I will continue to use the terms in

the manner commonly used, and no explicit distinction will be made between errors

and faults, unless necessary, it should be noted that the only faults that software has

are “design faults”; there is no wear and tear in software.

Failure is the inability of a system or component to perform a required

function according to its specifications. A software failure occurs if the behavior of

the software is different from the specified behavior. Failures may be caused due to

functional or performance reasons. A failure is produced only when there is a fault

in the system. However, presence of a fault does not guarantee a failure. In other

works, faults have the potential to cause failures and their presence is a necessary

but not a sufficient condition for failure to occur but not be detected.

Page 59: Telephone Exchange System

Top-Down and Bottom-Up approaches

A system is a hierarchy of modules, for such systems, there are two common ways

modules can be combined, as they are tested, to form a working program: to-down

and bottom-up. In top-down strategy, we start by testing the top of the hierarchy, and

we incrementally add modules that it calls and then test the new combined system.

This approach of testing requires stubs to be written. A stub is a dummy routine that

simulates a module. In the top-down approach, a module (or a collection) cannot be

tested in isolation because they invoke some other modules. To allow the modules to

be tested before their subordinates have been coded, stubs simulate the behavior of

the subordinates.

The bottom-up approach starts from the bottom of the hierarchy. First the modules at

the very bottom, which have no subordinates, are tested. Then these modules are

combined with higher-level modules for testing. At any stage of testing all the

subordinate modules exists and have been tested earlier. To perform bottom-up

testing, drivers are needed to set up the appropriate environment and invoke the

module. It is the job of the driver to invoke the module under testing with the

different set of test cases.

Notice that both top-down and bottom-up approaches are incremental, starting with

testing single modules and then adding untested modules to those that have been

tested, until the entire system is tested. In the first case, stubs must be written to

perform testing, and in the other, drives need to be written. Top-down testing is

advantageous if major flaws occur toward the top of the hierarchy, while bottom-up

is advantageous if the major flaws occur toward the bottom. Often, writing stubs can

be more difficult than writing drivers, because one may need to know beforehand the

set of inputs for the module being simulated by the stubs often simulate the behavior

of a module over a limited, and deciding test cases is often very difficult.

Page 60: Telephone Exchange System

Software Maintenance

Maintenance is the enigma of system development. It holds the software industry

captive, tying up programming resources. Analysts and programmers spend far more

time maintaining programs than they do writing them.

Maintenance can be classified as corrective, adaptive, or perceptive. Corrective

maintenance means repairing processing or performance failures or making changes

because of previously uncorrected problems or false assumptions. Adaptive

maintenance means changing the program function. Perceptive maintenance means

enhancing the performance or modifying the program(s) to respond to the user‟s

additional or changing needs. Of these types, more time and money are spent on

perceptive than on corrective and adaptive maintenance together.

Maintenance covers a wide range of activities, including correcting coding and

design errors, updating documentation and test data, and upgrading user support.

Many activities classified as maintenance are actually enhancements. Maintenance

means restoring something to its original condition. Unlike hardware, however

software does not wear out; it is corrected. In contrast, enhancement means adding

modifying, or redeveloping the code to support changes in the specifications. It is

necessary to keep up with changing user needs and the operational environment.

Although software does not wear out like a piece of hardware, it “ages” and

eventually fails to perform because of cumulative maintenance. Over time the

integrity of the program, test data, and documentation degenerates as a result of

modifications. Eventually, it takes more effort to maintain the application than to

rewire it.

A major problem with software maintenance is its labor- intensive nature (and

therefore the likelihood of errors). Consider a change in the code. Altering the code,

no matter how slight, must be manually introduced into each program because there

is no easy way of making sure that the changes will interface with all the programs.

Reusing the old codes depends heavily on the programmer‟s ability to judge what

code can and cannot be reused. It is an error-prone process that is still perceived by

many as more cost effective than writing programs from scratch.

Page 61: Telephone Exchange System

In Brief

An important aspect of a systems analyst‟s job is to make sure that the new design is

implemented to established standards. The term implementation has different

meanings, ranging from the conversion of a basic application to a complete

replacement of a computer system. The procedure, however, is virtually the same.

Implementation is used here to mean the process of converting a new or a revised

system design into an operational one. Conversion is one aspect of implementation.

The other aspects are the post-implementation review and software maintenance.

Page 62: Telephone Exchange System

Bibliography

Sams Tech Yourself Visual Basic 6, Techmedia Publications.

Mastering Database Programming with Visual Basic 6, Evangelos

Petroustsos, BPB Publications.

Visual Basic 6.0 Programming, Comp-U-Learn.

System Analysis and Design, Second Edition, Elias M Awad, Galgotia

Publications Pvt. Ltd.

An Integrated Approach to Software Engineering, Pankaj Jalote, Narosa

Publishing House.

Page 63: Telephone Exchange System
Page 64: Telephone Exchange System
Page 65: Telephone Exchange System
Page 66: Telephone Exchange System
Page 67: Telephone Exchange System
Page 68: Telephone Exchange System
Page 69: Telephone Exchange System
Page 70: Telephone Exchange System
Page 71: Telephone Exchange System
Page 72: Telephone Exchange System
Page 73: Telephone Exchange System
Page 74: Telephone Exchange System
Page 75: Telephone Exchange System
Page 76: Telephone Exchange System
Page 77: Telephone Exchange System
Page 78: Telephone Exchange System
Page 79: Telephone Exchange System
Page 80: Telephone Exchange System
Page 81: Telephone Exchange System
Page 82: Telephone Exchange System
Page 83: Telephone Exchange System
Page 84: Telephone Exchange System
Page 85: Telephone Exchange System
Page 86: Telephone Exchange System
Page 87: Telephone Exchange System
Page 88: Telephone Exchange System
Page 89: Telephone Exchange System

SOURCE CODE

Dim db As ADODB.Connection

Dim rec As ADODB.Recordset

Private Sub Combo1_click()

If Combo1.Text = "01" Then

Text12.Text = "N-OUT-Gen"

ElseIf Combo1.Text = "02" Then

Text12.Text = "N-OYT-Spl"

ElseIf Combo1.Text = "03" Then

Text12.Text = "N-OYT-SS"

ElseIf Combo1.Text = "04" Then

Text12.Text = "N-OYT-SWS"

ElseIf Combo1.Text = "05" Then

Text12.Text = "N-OYT-G-SE-DOT"

ElseIf Combo1.Text = "06" Then

Text12.Text = "OYT-Gen"

ElseIf Combo1.Text = "07" Then

Text12.Text = "OYT-Spl"

ElseIf Combo1.Text = "08" Then

Text12.Text = "TATKAL"

End If

End Sub

Private Sub Combo2_click()

If Combo2.Text = "01" Then

Text13.Text = "Freedom Fighters"

ElseIf Combo2.Text = "02" Then

Text13.Text = "Gallantry Award Winners"

ElseIf Combo2.Text = "03" Then

Text13.Text = "War Widows"

ElseIf Combo2.Text = "04" Then

Text13.Text = "Disabled Soldiers"

ElseIf Combo2.Text = "05" Then

Text13.Text = "Blind"

ElseIf Combo2.Text = "06" Then

Text13.Text = "Senior Citizens"

Page 90: Telephone Exchange System

ElseIf Combo2.Text = "07" Then

Text13.Text = "Retired DOT Employees"

ElseIf Combo2.Text = "08" Then

Text13.Text = "Serving DOT Employees"

ElseIf Combo2.Text = "09" Then

Text13.Text = "Recognized Educational Institutes"

ElseIf Combo2.Text = "10" Then

Text13.Text = "Orphanages"

ElseIf Combo2.Text = "11" Then

Text13.Text = "Homes for aged,infirm,spastics,handicapped,deaf-dump-mute

persons/voluntary,organization for tribal welfare,institutions recorgnized by Govt."

End If

End Sub

Private Sub Command1_Click()

rec.MoveFirst

Text1.Text = rec!cname

Text2.Text = rec!JName

Text3.Text = rec!fgname

Text4.Text = rec!PGno

Text5.Text = rec!WTno

Text6.Text = rec!Hno

Text7.Text = rec!ST

Text8.Text = rec!City

Text9.Text = rec!Pin

Text10.Text = rec!caddress

Text11.Text = rec!EMail

Text12.Text = rec!CAT

Text13.Text = rec!Cgname

Text14.Text = rec!Tno

Combo1.Text = rec!Ccode

Combo2.Text = rec!Cgcode

Dim a As String

a = rec!Purpose

If a = "Residence" Then

Option1.Value = True

End If

If a = "PSU" Then

Option2.Value = True

Page 91: Telephone Exchange System

End If

If a = "Business" Then

Option3.Value = True

End If

If a = "Govt." Then

Option4.Value = True

End If

Dim b1, b2, b3, b4, b5, b6, b7 As String

b1 = rec!STD

b2 = rec!ISD

b3 = rec!CLI

b4 = rec!Hotline

b5 = rec!Conf

b6 = rec!CF

b7 = rec!AD

If b1 = "Yes" Then

Check1.Value = 1

Else

Check1.Value = 0

End If

If b2 = "Yes" Then

Check2.Value = 1

Else

Check2.Value = 0

End If

If b3 = "Yes" Then

Check3.Value = 1

Else

Check3.Value = 0

End If

If b4 = "Yes" Then

Check4.Value = 1

Else

Check4.Value = 0

End If

If b5 = "Yes" Then

Check5.Value = 1

Else

Check5.Value = 0

End If

Page 92: Telephone Exchange System

If b6 = "Yes" Then

Check6.Value = 1

Else

Check6.Value = 0

End If

If b7 = "Yes" Then

Check7.Value = 1

Else

Check7.Value = 0

End If

End Sub

Private Sub Command2_Click()

rec.MoveNext

If rec.EOF = True Then

rec.MoveLast

End If

Text1.Text = rec!cname

Text2.Text = rec!JName

Text3.Text = rec!fgname

Text4.Text = rec!PGno

Text5.Text = rec!WTno

Text6.Text = rec!Hno

Text7.Text = rec!ST

Text8.Text = rec!City

Text9.Text = rec!Pin

Text10.Text = rec!caddress

Text11.Text = rec!EMail

Text12.Text = rec!CAT

Text13.Text = rec!Cgname

Text14.Text = rec!Tno

Combo1.Text = rec!Ccode

Combo2.Text = rec!Cgcode

Dim a As String

a = rec!Purpose

If a = "Residence" Then

Option1.Value = True

End If

Page 93: Telephone Exchange System

If a = "PSU" Then

Option2.Value = True

End If

If a = "Business" Then

Option3.Value = True

End If

If a = "Govt." Then

Option4.Value = True

End If

Dim b1, b2, b3, b4, b5, b6, b7 As String

b1 = rec!STD

b2 = rec!ISD

b3 = rec!CLI

b4 = rec!Hotline

b5 = rec!Conf

b6 = rec!CF

b7 = rec!AD

If b1 = "Yes" Then

Check1.Value = 1

Else

Check1.Value = 0

End If

If b2 = "Yes" Then

Check2.Value = 1

Else

Check2.Value = 0

End If

If b3 = "Yes" Then

Check3.Value = 1

Else

Check3.Value = 0

End If

If b4 = "Yes" Then

Check4.Value = 1

Else

Check4.Value = 0

End If

If b5 = "Yes" Then

Check5.Value = 1

Else

Page 94: Telephone Exchange System

Check5.Value = 0

End If

If b6 = "Yes" Then

Check6.Value = 1

Else

Check6.Value = 0

End If

If b7 = "Yes" Then

Check7.Value = 1

Else

Check7.Value = 0

End If

End Sub

Private Sub Command3_Click()

rec.MovePrevious

If rec.BOF = True Then

rec.MoveFirst

End If

Text1.Text = rec!cname

Text2.Text = rec!JName

Text3.Text = rec!fgname

Text4.Text = rec!PGno

Text5.Text = rec!WTno

Text6.Text = rec!Hno

Text7.Text = rec!ST

Text8.Text = rec!City

Text9.Text = rec!Pin

Text10.Text = rec!caddress

Text11.Text = rec!EMail

Text12.Text = rec!CAT

Text13.Text = rec!Cgname

Text14.Text = rec!Tno

Combo1.Text = rec!Ccode

Combo2.Text = rec!Cgcode

Dim a As String

Page 95: Telephone Exchange System

a = rec!Purpose

If a = "Residence" Then

Option1.Value = True

End If

If a = "PSU" Then

Option2.Value = True

End If

If a = "Business" Then

Option3.Value = True

End If

If a = "Govt." Then

Option4.Value = True

End If

Dim b1, b2, b3, b4, b5, b6, b7 As String

b1 = rec!STD

b2 = rec!ISD

b3 = rec!CLI

b4 = rec!Hotline

b5 = rec!Conf

b6 = rec!CF

b7 = rec!AD

If b1 = "Yes" Then

Check1.Value = 1

Else

Check1.Value = 0

End If

If b2 = "Yes" Then

Check2.Value = 1

Else

Check2.Value = 0

End If

If b3 = "Yes" Then

Check3.Value = 1

Else

Check3.Value = 0

End If

If b4 = "Yes" Then

Check4.Value = 1

Else

Check4.Value = 0

Page 96: Telephone Exchange System

End If

If b5 = "Yes" Then

Check5.Value = 1

Else

Check5.Value = 0

End If

If b6 = "Yes" Then

Check6.Value = 1

Else

Check6.Value = 0

End If

If b7 = "Yes" Then

Check7.Value = 1

Else

Check7.Value = 0

End If

End Sub

Private Sub Command4_Click()

rec.MoveLast

Text1.Text = rec!cname

Text2.Text = rec!JName

Text3.Text = rec!fgname

Text4.Text = rec!PGno

Text5.Text = rec!WTno

Text6.Text = rec!Hno

Text7.Text = rec!ST

Text8.Text = rec!City

Text9.Text = rec!Pin

Text10.Text = rec!caddress

Text11.Text = rec!EMail

Text12.Text = rec!CAT

Text13.Text = rec!Cgname

Text14.Text = rec!Tno

Combo1.Text = rec!Ccode

Combo2.Text = rec!Cgcode

Dim a As String

Page 97: Telephone Exchange System

a = rec!Purpose

If a = "Residence" Then

Option1.Value = True

End If

If a = "PSU" Then

Option2.Value = True

End If

If a = "Business" Then

Option3.Value = True

End If

If a = "Govt." Then

Option4.Value = True

End If

Dim b1, b2, b3, b4, b5, b6, b7 As String

b1 = rec!STD

b2 = rec!ISD

b3 = rec!CLI

b4 = rec!Hotline

b5 = rec!Conf

b6 = rec!CF

b7 = rec!AD

If b1 = "Yes" Then

Check1.Value = 1

Else

Check1.Value = 0

End If

If b2 = "Yes" Then

Check2.Value = 1

Else

Check2.Value = 0

End If

If b3 = "Yes" Then

Check3.Value = 1

Else

Check3.Value = 0

End If

If b4 = "Yes" Then

Check4.Value = 1

Else

Check4.Value = 0

Page 98: Telephone Exchange System

End If

If b5 = "Yes" Then

Check5.Value = 1

Else

Check5.Value = 0

End If

If b6 = "Yes" Then

Check6.Value = 1

Else

Check6.Value = 0

End If

If b7 = "Yes" Then

Check7.Value = 1

Else

Check7.Value = 0

End If

End Sub

Private Sub Command6_Click()

rec.AddNew

rec!cname = Text1.Text

rec!JName = Text2.Text

rec!fgname = Text3.Text

rec!PGno = Text4.Text

rec!WTno = Text5.Text

rec!Hno = Text6.Text

rec!ST = Text7.Text

rec!City = Text8.Text

rec!Pin = Text9.Text

rec!caddress = Text10.Text

rec!EMail = Text11.Text

rec!Ccode = Combo1.Text

rec!CAT = Text12.Text

'rec!Tno = Text14.Text

rec!Cgcode = Combo2.Text

rec!Cgname = Text13.Text

rec!dis = "no"

If Option1.Value = True Then

rec!Purpose = "Residence"

Page 99: Telephone Exchange System

End If

If Option2.Value = True Then

rec!Purpose = "PSU"

End If

If Option3.Value = True Then

rec!Purpose = "Business"

End If

If Option4.Value = True Then

rec!Purpose = "Govt."

End If

If Check1.Value = 1 Then

rec!STD = "Yes"

Else

rec!STD = "no"

End If

If Check2.Value = 1 Then

rec!ISD = "Yes"

Else

rec!ISD = "no"

End If

If Check3.Value = 1 Then

rec!CLI = "Yes"

Else

rec!CLI = "no"

End If

If Check4.Value = 1 Then

rec!Hotline = "Yes"

Else

rec!Hotline = "no"

End If

If Check5.Value = 1 Then

rec!Conf = "Yes"

Else

rec!Conf = "no"

End If

Page 100: Telephone Exchange System

If Check6.Value = 1 Then

rec!CF = "Yes"

Else

rec!CF = "no"

End If

If Check7.Value = 1 Then

rec!AD = "Yes"

Else

rec!AD = "no"

End If

MsgBox "Record Saved"

rec.Update

End Sub

Private Sub Command7_Click()

Unload Me

End Sub

Private Sub Command8_Click()

form13.Show

Unload Me

End Sub

Private Sub Command9_Click()

Text1.Text = ""

Text2.Text = ""

Text3.Text = ""

Text4.Text = ""

Text5.Text = ""

Text6.Text = ""

Text7.Text = ""

Text8.Text = ""

Text9.Text = ""

Text10.Text = ""

Text11.Text = ""

Text12.Text = ""

Text13.Text = ""

Page 101: Telephone Exchange System

Text14.Text = ""

Combo1.Text = "Select Code"

Combo2.Text = "Select Code"

Option1.Value = False

Option2.Value = False

Option3.Value = False

Option4.Value = False

Check1.Value = 0

Check2.Value = 0

Check3.Value = 0

Check4.Value = 0

Check5.Value = 0

Check6.Value = 0

Check7.Value = 0

End Sub

Private Sub Form_Load()

Set db = New ADODB.Connection

Set rec = New ADODB.Recordset

db.ConnectionString = "dsn=phone;uid=;pwd=;"

db.Open

rec.Open "newconn1", db, adOpenDynamic, adLockOptimistic

Combo1.AddItem "01"

Combo1.AddItem "02"

Combo1.AddItem "03"

Combo1.AddItem "04"

Combo1.AddItem "05"

Combo1.AddItem "06"

Combo1.AddItem "07"

Combo1.AddItem "08"

Combo2.AddItem "01"

Combo2.AddItem "02"

Combo2.AddItem "03"

Combo2.AddItem "04"

Combo2.AddItem "05"

Combo2.AddItem "06"

Page 102: Telephone Exchange System

Combo2.AddItem "07"

Combo2.AddItem "08"

rec!dis = "No"

End Sub

Dim db As ADODB.Connection

Dim rec As ADODB.Recordset

Page 103: Telephone Exchange System

Dim rec1 As ADODB.Recordset

Dim rec2 As ADODB.Recordset

Dim i, j, k, s

Dim am As Integer

Dim flag As Boolean

Private Sub Command1_Click()

rec.AddNew

rec!Tno = Text1.Text

rec!pmr = Text2.Text

rec!cmr = Text3.Text

rec!Mcalls = Text4.Text

rec!nccalls = Text5.Text

rec!Namount = Text6.Text

MsgBox "Record saved"

rec.Update

End Sub

Private Sub Command2_Click()

Unload Me

End Sub

Private Sub Command3_Click()

form13.Show

Unload Me

End Sub

Private Sub Command4_Click()

Dim a1 As Integer, a2 As Integer, a3 As Integer

Dim x As Integer

a1 = Val(Text2.Text)

a2 = Val(Text3.Text)

a3 = Val(Text5.Text)

x = a2 - a1

Text4.Text = x

Dim s As String, s1 As Integer

Dim s2 As Integer

rec2.MoveFirst

s2 = Text1.Text

While rec2.EOF = False

If rec2!Pno = Text1.Text Then

Page 104: Telephone Exchange System

s = rec2!Area

If s = "urban" Then

s1 = x - 50

Text5.Text = s1

End If

If s = "rural" Then

s1 = x - 75

Text5.Text = s1

End If

End If

rec2.MoveNext

Wend

Dim c As Integer

rec2.MoveFirst

c = Val(Text5.Text)

While rec2.EOF = False

If rec2!Pno = Text1.Text Then

Set k = rec2!Area

If k = "rural" Then

If c >= 1 And c <= 150 Then

Text6.Text = am

am = c * 0

ElseIf c > 150 And c <= 400 Then

am = 150 * 0 + (c - 150) * 0.8

Text6.Text = am

ElseIf c > 400 And c <= 500 Then

am = 150 * 0 + 200 * 0.8 + (c - 400) * 1

am = Val(Text6.Text)

ElseIf c > 500 Then

am = 150 * 0 + 200 * 0.8 + 100 * 1 + (c - 500) * 1.2

Text6.Text = am

End If

End If

End If

rec2.MoveNext

Wend

rec2.MoveFirst

c = Text5.Text

While rec2.EOF = False

Page 105: Telephone Exchange System

If rec2!Pno = Text1.Text Then

Set k = rec2!Area

If k = "urban" Then

If c >= 1 And c <= 100 Then

Text6.Text = am

am = c * 0

ElseIf c > 100 And c <= 400 Then

am = 100 * 0 + (c - 100) * 0.8

Text6.Text = am

ElseIf c > 400 And c <= 500 Then

am = 100 * 0 + 200 * 0.8 + (c - 400) * 1

am = Text6.Text

ElseIf c > 500 Then

am = 100 * 0 + 200 * 0.8 + 100 * 1 + (c - 500) * 1.2

Text6.Text = am

End If

End If

End If

rec2.MoveNext

Wend

Dim x1 As Integer, x2 As Integer, x3 As Integer

Dim q1, q2, q3, q4, q5, q6, q7 As String

rec1.MoveFirst

x1 = 0

While rec1.EOF = False

If rec1!Tno = Text1.Text Then

q1 = rec1!STD

q2 = rec1!ISD

q3 = rec1!CLI

q4 = rec1!Hotline

q5 = rec1!Conf

q6 = rec1!CF

q7 = rec1!AD

If q1 = "Yes" Then

x1 = x1 + 1

End If

If q2 = "Yes" Then

x1 = x1 + 1

End If

Page 106: Telephone Exchange System

If q3 = "Yes" Then

x1 = x1 + 1

End If

If q4 = "Yes" Then

x1 = x1 + 1

End If

If q5 = "Yes" Then

x1 = x1 + 1

End If

If q6 = "Yes" Then

x1 = x1 + 1

End If

If q7 = "Yes" Then

x1 = x1 + 1

End If

If x1 >= 3 Then

x2 = 50

ElseIf x1 = 1 Then

x2 = 20

ElseIf x1 = 2 Then

x2 = 40

End If

Text6.Text = Val(Text6.Text) + x2

End If

rec1.MoveNext

Wend

End Sub

Private Sub Form_Load()

Set db = New ADODB.Connection

Set rec = New ADODB.Recordset

Set rec1 = New ADODB.Recordset

Page 107: Telephone Exchange System

Set rec2 = New ADODB.Recordset

db.ConnectionString = "dsn=phone;uid=;pwd=;"

db.Open

rec.Open "bill_prepare", db, adOpenDynamic, adLockOptimistic

rec1.Open "newconn1", db, adOpenDynamic, adLockOptimistic

rec2.Open "payment", db, adOpenDynamic, adLockOptimistic

End Sub

Private Sub Text1_LostFocus()

Dim a As Integer

rec1.MoveFirst

flag = False

While Not rec1.EOF = True

If Text1.Text = rec1!Tno Then

flag = True

Text2.SetFocus

End If

rec1.MoveNext

Wend

If flag = False Then

MsgBox "number does not exist"

Text1.Text = ""

Text1.SetFocus

End If

End Sub

Page 108: Telephone Exchange System

Dim db As ADODB.Connection

Dim rec As ADODB.Recordset

Private Sub Command5_Click(Index As Integer)

rec.MoveFirst

Dim a As Integer

a = Text1.Text

While Not rec.EOF = True

If a = rec!Tno Then

If Option3.Value = True And Option7.Value = True Then

If Option1.Value = True And Option6.Value = True Then

With rec

!Hno = Text8.Text

!ST = Text9.Text

!City = Text10.Text

!Pin = Text11.Text

!caddress = Text12.Text

!EMail = Text13.Text

rec.Update

MsgBox "Record saved"

End With

End If

Else

MsgBox "Record Not Saved"

End If

Page 109: Telephone Exchange System

End If

rec.MoveNext

Wend

End Sub

Private Sub Command7_Click(Index As Integer)

form13.Show

Unload Me

End Sub

Private Sub Command8_Click(Index As Integer)

Unload Me

End Sub

Private Sub Form_Load()

Set db = New ADODB.Connection

Set rec = New ADODB.Recordset

db.ConnectionString = "dsn=phone;uid=;pwd=;"

db.Open

rec.Open "newconn1", db, adOpenDynamic, adLockOptimistic

End Sub

Private Sub Text1_LostFocus()

rec.MoveFirst

Dim a As Integer

a = Text1.Text

While Not rec.EOF = True

If a = rec!Tno Then

With rec

Text2.Text = !WTno

Text3.Text = !cname

Text4.Text = !Hno

Text5.Text = !ST

Text6.Text = !City

Text7.Text = !Pin

End With

End If

rec.MoveNext

Wend

End Sub

Page 110: Telephone Exchange System

Dim a As Integer, b As Integer

Private Sub Command1_Click()

Unload Me

Load Form4

Form4.Show

End Sub

Private Sub Form_Load()

a = 0

b = 0

End Sub

Private Sub Timer1_Timer()

If a = 1 Then

Picture = LoadPicture("c:\program Files\microsoft visual

studio\vb98\project\REG.jpg")

a = 2

ElseIf a = 2 Then

Page 111: Telephone Exchange System

Picture = LoadPicture("c:\program Files\microsoft visual

studio\vb98\project\Eula.jpg")

a = 3

ElseIf a = 3 Then

Picture = LoadPicture("c:\program Files\microsoft visual

studio\vb98\project\DIALTONE.jpg")

a = 4

ElseIf a = 4 Then

Picture = LoadPicture("c:\program Files\microsoft visual

studio\vb98\project\TAPI.jpg")

a = 1

Else

a = 1

End If

End Sub

Private Sub Timer2_Timer()

If b = 0 Then

Label7.Caption = "This Project Title Is Based On BSNL"

b = 1

ElseIf b = 1 Then

Label7.Caption = "This Project IS Prepared by Jagmohan,Harjeet And Paramjeet"

b = 2

ElseIf b = 2 Then

Label7.Caption = "I am The Student Of MCA 6th Sem Of _______ Study Centre

,_________ "

b = 3

ElseIf b = 3 Then

Label7.Caption = "This Project Is Completed In The Guidance Of Mr. _______"

ElseIf b = 4 Then

Label7.Caption = "My Project Title Is Telephone System Automation "

b = 0

Else

b = 0

End If

End Sub

Page 112: Telephone Exchange System

Dim db As ADODB.Connection

Dim rec As ADODB.Recordset

Dim rec1 As ADODB.Recordset

Dim rec2 As ADODB.Recordset

Dim b As Integer

Dim a As Integer

Private Sub Command1_Click()

Unload Me

Load Form1

Form1.Show

End Sub

Private Sub Command10_Click()

Unload Me

Load Form9

Form9.Show

Page 113: Telephone Exchange System

End Sub

Private Sub Command11_Click()

Unload Me

Load Form2

Form2.Show

End Sub

Private Sub Command12_Click()

Unload Me

Load Form7

Form7.Show

End Sub

Private Sub Command13_Click()

Unload Me

Load Form8

Form8.Show

End Sub

Private Sub Command14_Click()

Unload Me

Load Form17

Form17.Show

End Sub

Private Sub Command2_Click()

Unload Me

Load Form3

Form3.Show

End Sub

Private Sub Command3_Click()

Unload Me

Load Form11

Form11.Show

End Sub

Private Sub Command4_Click()

Page 114: Telephone Exchange System

Unload Me

Load Forma1

Forma1.Show

End Sub

Private Sub Command5_Click()

Unload Me

Load Form6

Form6.Show

End Sub

Private Sub Command6_Click()

Unload Me

Load Form14

Form14.Show

End Sub

Private Sub Command7_Click()

Unload Me

Load Form10

Form10.Show

End Sub

Private Sub Command8_Click()

Unload Me

Load Form16

Form16.Show

End Sub

Private Sub Command9_Click()

MsgBox ("Thanks To U For Using My Project")

MsgBox ("Have A Nice Day! Good Bye")

Unload Me

End Sub

Private Sub Form_Load()

b = 0

a = 0

Page 115: Telephone Exchange System

End Sub

Private Sub Timer1_Timer()

If b = 0 Then

Label2.Caption = "<----------Wel Come To 'Telephone Exchange System'---------->"

b = 1

ElseIf b = 1 Then

Label2.Caption = " If Do You Want Any Service,Then Click Particulur Button"

b = 2

ElseIf b = 2 Then

Label2.Caption = "<----------Wel Come To 'Telephone Exchange System'---------->"

b = 3

ElseIf b = 3 Then

Label2.Caption = " If Do You Want Any Service,Then Click Particulur Button"

b = 4

ElseIf b = 4 Then

Label2.Caption = "<----------Wel Come To 'Telephone Exchange System'--------->"

b = 5

ElseIf b = 5 Then

Label2.Caption = " If Do You Want Any Service,Then Click Particulur Button"

b = 0

Else

b = 0

End If

End Sub

Private Sub Timer2_Timer()

If a = 0 Then

Label3.Caption = "*"

a = 1

ElseIf a = 1 Then

Label5.Caption = "*"

a = 2

ElseIf a = 2 Then

Label6.Caption = "*"

a = 3

ElseIf a = 3 Then

Label7.Caption = "*"

a = 4

Page 116: Telephone Exchange System

ElseIf a = 4 Then

Label8.Caption = "*"

a = 5

ElseIf a = 5 Then

Label9.Caption = "*"

a = 6

ElseIf a = 6 Then

Label10.Caption = "*"

a = 7

ElseIf a = 7 Then

Label4.Caption = "*"

a = 8

ElseIf a = 8 Then

Label11.Caption = "*"

a = 9

ElseIf a = 9 Then

Label12.Caption = "*"

a = 10

ElseIf a = 10 Then

Label13.Caption = "*"

a = 11

ElseIf a = 11 Then

Label14.Caption = "*"

a = 12

ElseIf a = 12 Then

Label15.Caption = "*"

a = 13

ElseIf a = 13 Then

Label16.Caption = "*"

a = 0

Else

b = 0

End If

End Sub

Page 117: Telephone Exchange System

Dim db As ADODB.Connection

Dim rec As ADODB.Recordset

Dim rec1 As ADODB.Recordset

Dim rec2 As ADODB.Recordset

Private Sub Command1_Click()

rec1.AddNew

Page 118: Telephone Exchange System

rec1!Tno = Text1.Text

rec1!dreconn = Text2.Text

rec1!pamount = Text3.Text

rec1.Update

rec.MoveFirst

Dim a As Integer

a = Text1.Text

rec2.MoveFirst

While Not rec2.EOF = True

If a = rec2!Tno Then

rec2!dis = "no"

rec2.Update

MsgBox "This Telephone Number Is Reconnected"

End If

rec2.MoveNext

Wend

rec.MoveFirst

a = Text1.Text

While Not rec.EOF = True

If a = rec!Tno Then

rec.Delete

MsgBox "This Record Deleted In Disconnect Table"

End If

rec.MoveNext

Wend

End Sub

Private Sub Command2_Click()

Unload Me

Load form13

form13.Show

End Sub

Private Sub Command3_Click()

Unload Me

End Sub

Page 119: Telephone Exchange System

Private Sub Form_Load()

Set db = New ADODB.Connection

Set rec = New ADODB.Recordset

Set rec1 = New ADODB.Recordset

Set rec2 = New ADODB.Recordset

db.ConnectionString = "dsn=phone;uid=;pwd=;"

db.Open

rec.Open "disconn", db, adOpenDynamic, adLockOptimistic

rec1.Open "reconnect", db, adOpenDynamic, adLockOptimistic

rec2.Open "newconn1", db, adOpenDynamic, adLockOptimistic

Text2.Text = Date

End Sub

Private Sub Text1_LostFocus()

Dim a As Integer

Dim b As Integer

b = 0

a = Text1.Text

rec.MoveFirst

While Not rec.EOF = True

If a = rec!Tno Then

b = 1

Text3.Text = 200

End If

rec.MoveNext

Wend

If b = 1 Then

Text2.SetFocus

Else

MsgBox ("Reply")

Text1.Text = ""

Text1.SetFocus

End If

End Sub

Dim db As ADODB.Connection

Page 120: Telephone Exchange System

Dim rec As ADODB.Recordset

Dim rec1 As ADODB.Recordset

Dim rec2 As ADODB.Recordset

Dim rec3 As ADODB.Recordset

Dim a3 As Integer

Private Sub Command1_Click()

Form9.Show

End Sub

Private Sub Command2_Click()

rec3.AddNew

rec3!Pno = Text1.Text

rec3!sname = Text2.Text

rec3!SAddress = Text3.Text

rec3!SFname = Text4.Text

rec3!Bill_Issue_Date = Text5.Text

rec3!Period_of_bill = Text7.Text

rec3!previous_meter_reading = Text8.Text

rec3!current_meter_reading = Text9.Text

rec3!metered_Calls = Text10.Text

rec3!free_Calls = Text11.Text

rec3!netchargable_calls = Text12.Text

rec3!service_tax = Text15.Text

rec3!total_payable_before_date = Text16.Text

rec3!Surcharge = Text17.Text

'rec3!Bill_Payable_after_due_date = Text18.Text

rec3!payable_upto = DTPicker1.Value

MsgBox "Record Saved"

rec3.Update

End Sub

Private Sub Command3_Click()

Unload Me

End Sub

Private Sub Form_Load()

Set db = New ADODB.Connection

Set rec = New ADODB.Recordset

Set rec1 = New ADODB.Recordset

Page 121: Telephone Exchange System

Set rec2 = New ADODB.Recordset

Set rec3 = New ADODB.Recordset

db.ConnectionString = "dsn=phone;uid=;pwd=;"

db.Open

rec.Open "newconn1", db, adOpenDynamic, adLockOptimistic

rec1.Open "bill_prepare", db, adOpenDynamic, adLockOptimistic

rec2.Open "payment", db, adOpenDynamic, adLockOptimistic

rec3.Open "show_bill", db, adOpenDynamic, adLockOptimistic

End Sub

Private Sub Text1_LostFocus()

rec.MoveFirst

Dim a As Integer

a = Text1.Text

While Not rec.EOF = True

If a = rec!Tno Then

Text2.Text = rec!cname

Text3.Text = rec!caddress

Text4.Text = rec!fgname

End If

rec.MoveNext

Wend

rec1.MoveFirst

Dim a1 As Integer

a1 = Text1.Text

While Not rec1.EOF = True

If a1 = rec1!Tno Then

Text5.Text = Date

Text7.Text = "Two Months"

Text8.Text = rec1!pmr

Text9.Text = rec1!cmr

Text10.Text = rec1!Mcalls

Text12.Text = rec1!nccalls

Text16.Text = rec1!Namount

End If

rec1.MoveNext

Wend

Dim s As String, s1 As Integer

Dim s2 As Integer

Page 122: Telephone Exchange System

rec2.MoveFirst

s2 = Text1.Text

While rec2.EOF = False

If rec2!Pno = Text1.Text Then

s = rec2!Area

If s = "urban" Then

s1 = 100

Text11.Text = s1

Text13.Text = 300

a3 = Text16.Text

Text15.Text = a3 * (5 / 100)

Text16.Text = Val(Text16.Text) + Val(Text13.Text) + Val(Text15.Text)

Text17.Text = a3 * (10 / 100)

Text18.Text = Val(Text16.Text) + Val(Text17.Text)

End If

If s = "rural" Then

s1 = 150

Text11.Text = s1

Text13.Text = 220

a3 = Text16.Text

Text15.Text = a3 * (5 / 100)

Text16.Text = Val(Text16.Text) + Val(Text13.Text) + Val(Text15.Text)

Text17.Text = a3 * (10 / 100)

Text18.Text = Val(Text16.Text) + Val(Text17.Text)

End If

End If

rec2.MoveNext

Wend

Text12.Text = Val(Text10.Text) - Val(Text11.Text)

End Sub

Page 123: Telephone Exchange System

Dim db As ADODB.Connection

Dim rec As ADODB.Recordset

Dim rec1 As ADODB.Recordset

Private Sub display()

Dim a As String

a = rec!Mode

Text1.Text = rec!Tno

Text2.Text = rec!TPAmount

Text3.Text = rec!PDate

Text4.Text = rec!DNo

Text6.Text = rec!DBank

If a = "Cash" Then

Option1.Value = True

End If

If a = "Demand Draft" Then

Option2.Value = True

End If

End Sub

Private Sub Command1_Click()

rec.AddNew

If Option1.Value = True Then

a = "Cash"

Text4.Text = 0

Text6.Text = "Nil"

Option2.Enabled = False

End If

If Option2.Value = True Then

a = "Draft"

Option1.Enabled = False

End If

Text3.Text = Date

'rec!Mode = a

Page 124: Telephone Exchange System

rec!Tno = Text1.Text

rec!TPAmount = Text2.Text

rec!PDate = Text3.Text

rec!DNo = Text4.Text

rec!DBank = Text6.Text

rec.Update

End Sub

Private Sub Command2_Click()

Unload Me

Load form13

form13.Show

End Sub

Private Sub Command3_Click()

Text1.Text = ""

Text2.Text = ""

Text3.Text = ""

Text4.Text = ""

Text6.Text = ""

Option1.Value = False

Option2.Value = False

Text1.SetFocus

End Sub

Private Sub Command4_Click()

Dim dat As Date

issue = Date

duedt = issue + 21

disdt = issue + 35

If MsgBox(issue, vbOKOnly, " Bill Issue Date") = vbOK Then

If MsgBox(duedt, vbOKOnly, " Bill can be pay upto Date Without surcharge") =

vbOK Then

If MsgBox(disdt, vbOKOnly, "Bill can be pay upto this date with surcharges") =

vbOK Then

End If

End If

End If

dat = Text3.Text

MsgBox (dat)

Page 125: Telephone Exchange System

am = Val(Text2.Text)

If MsgBox(am, vbOKOnly, "The Actual Amount Is") = vbOK Then

End If

rec1.MoveFirst

While rec1.EOF = False

If rec1!Tno = Text1.Text Then

If dat >= issue And dat <= duedt Then

MsgBox ("You Pay Your Bill Before Last Date,So Here is no any Surcharge")

charge = 0

End If

If dat > duedt And dat <= disdt Then

MsgBox ("U Pay Your Bill After The Due Date,So Pay It With Surcharge")

GoTo start

End If

If dat > disdt Then

MsgBox ("UR Phone Has Disconnected Now")

End If

start:

If am >= 1 And am <= 500 Then

charge = 10

ElseIf am > 500 And am <= 1000 Then

charge = 20

ElseIf am > 1000 And am <= 2000 Then

charge = 40

ElseIf am > 2000 And am <= 3500 Then

charge = 70

ElseIf am > 3500 And am <= 5000 Then

charge = 100

ElseIf am > 5000 And am <= 7500 Then

charge = 150

ElseIf am > 7500 And am <= 10000 Then

charge = 200

ElseIf am > 10000 And am <= 20000 Then

charge = 400

ElseIf am > 20000 And am <= 50000 Then

charge = 1000

ElseIf am > 50000 Then

charge = 2000

Page 126: Telephone Exchange System

End If

Text2.Text = am + charge

End If

rec1.MoveNext

Wend

End Sub

Private Sub Command5_Click()

Unload Me

End Sub

Private Sub Form_Load()

Set db = New ADODB.Connection

Set rec = New ADODB.Recordset

Set rec1 = New ADODB.Recordset

db.ConnectionString = "dsn=phone;uid=;pwd=;"

db.Open

rec.Open "pay_bill", db, adOpenDynamic, adLockOptimistic

rec1.Open "bill_Prepare", db, adOpenDynamic, adLockOptimistic

Option1.Value = True

Option2.Value = True

End Sub

Private Sub Option1_Click()

If Option1.Value = True Then

Text4.Text = 0

Text6.Text = "Nil"

End If

End Sub

Private Sub Option2_Click()

If Option2.Value = True Then

Text4.Text = ""

Text6.Text = ""

'Text4.SetFocus

End If

End Sub

Private Sub Option2_LostFocus()

Text4.SetFocus

Page 127: Telephone Exchange System

End Sub

Private Sub Text1_LostFocus()

rec1.MoveFirst

While rec1.EOF = False

If rec1!Tno = Text1.Text Then

Text2.Text = rec1!Namount

Text3.Text = Date

End If

rec1.MoveNext

Wend

End Sub

Private Sub Command1_Click()

If Text1.Text = 111 Then

Form5.Show

Unload Me

Else

MsgBox "Please Enter Correct Number"

Text1.Text = ""

Text1.SetFocus

End If

End Sub

Private Sub Command2_Click()

Unload Me

End Sub

Private Sub Command3_Click()

form13.Show

Unload Me

End Sub

Page 128: Telephone Exchange System

Dim db As ADODB.Connection

Dim rec As ADODB.Recordset

Dim rec1 As ADODB.Recordset

Dim rec2 As ADODB.Recordset

Private Sub Command1_Click()

rec.MoveFirst

Text1.Text = rec!Tno

Text2.Text = rec!namesub

DTPicker1.Value = rec!dbillp

Text4.Text = rec!ddiss

Dim a As String

a = rec!Purpose

If a = "Bill Not Pay" Then

Option1.Value = True

End If

If a = "WithDraw" Then

Option2.Value = True

End If

Page 129: Telephone Exchange System

End Sub

Private Sub Command10_Click()

Unload Me

End Sub

Private Sub Command2_Click()

rec.MovePrevious

If rec.BOF = True Then

rec.MoveFirst

End If

Text1.Text = rec!Tno

Text2.Text = rec!namesub

DTPicker1.Value = rec!dbillp

Text4.Text = rec!ddiss

Dim a As String

a = rec!Purpose

If a = "Bill Not Pay" Then

Option1.Value = True

End If

If a = "WithDraw" Then

Option2.Value = True

End If

End Sub

Private Sub Command3_Click()

rec.MoveNext

If rec.EOF = True Then

rec.MoveLast

End If

Text1.Text = rec!Tno

Text2.Text = rec!namesub

DTPicker1.Value = rec!dbillp

Text4.Text = rec!ddiss

Dim a As String

a = rec!Purpose

If a = "Bill Not Pay" Then

Page 130: Telephone Exchange System

Option1.Value = True

End If

If a = "WithDraw" Then

Option2.Value = True

End If

End Sub

Private Sub Command5_Click()

rec.MoveLast

Text1.Text = rec!Tno

Text2.Text = rec!namesub

DTPicker1.Value = rec!dbillp

Text4.Text = rec!ddiss

Dim a As String

a = rec!Purpose

If a = "Bill Not Pay" Then

Option1.Value = True

End If

If a = "WithDraw" Then

Option2.Value = True

End If

End Sub

Private Sub Command7_Click()

Dim a As Integer

a = Text1.Text

rec2.MoveFirst

While Not rec2.EOF = True

If a = rec2!Tno Then

rec2!dis = "yes"

rec2.Update

End If

rec2.MoveNext

Wend

rec.AddNew

rec!Tno = Text1.Text

Page 131: Telephone Exchange System

rec!namesub = Text2.Text

rec!dbillp = DTPicker1.Value

rec!ddiss = Text4.Text

If Option1.Value = True Then

rec!Purpose = "Bill Not Pay"

End If

If Option2.Value = True Then

rec!Purpose = "Withdraw"

End If

MsgBox "This Number Is Disconnect"

rec.Update

End Sub

Private Sub Command9_Click()

form13.Show

Unload Me

End Sub

Private Sub Form_Load()

Set db = New ADODB.Connection

Set rec = New ADODB.Recordset

Set rec1 = New ADODB.Recordset

Set rec2 = New ADODB.Recordset

db.ConnectionString = "dsn=phone;uid=;pwd=;"

db.Open

rec.Open "disconn", db, adOpenDynamic, adLockOptimistic

rec1.Open "payment", db, adOpenDynamic, adLockOptimistic

rec2.Open "newconn1", db, adOpenDynamic, adLockOptimistic

Text4.Text = Date

End Sub

Private Sub Text1_LostFocus()

Dim a As Integer

rec1.MoveFirst

While Not rec1.EOF = True

If Text1.Text = rec1!Pno Then

Text2.Text = rec1!cuname

End If

rec1.MoveNext

Wend

Page 132: Telephone Exchange System

End Sub

Dim db As ADODB.Connection

Dim rec As ADODB.Recordset

Private Sub Combo1_click()

Dim e As Long, ar As String

e = Val(Text6.Text)

Page 133: Telephone Exchange System

ar = Combo1.Text

If e < 100 Then

If ar = "rural" Or ar = "urban" Then

Text10.Text = 100

End If

ElseIf e > 100 And e <= 1000 Then

If ar = "urban" Then

Text10.Text = 240

End If

If ar = "rural" Then

Text10.Text = 100

End If

ElseIf e > 1000 And e <= 30000 Then

If ar = "urban" Then

Text10.Text = 240

End If

If ar = "rural" Then

Text10.Text = 220

End If

ElseIf e > 30000 And e <= 100000 Then

If ar = "urban" Then

Text10.Text = 360

End If

If ar = "rural" Then

Text10.Text = 300

End If

ElseIf e > 100000 And e <= 300000 Then

If ar = "urban" Then

Text10.Text = 500

End If

If ar = "rural" Then

Text10.Text = 420

End If

ElseIf e > 30000 Then

If ar = "urban" Then

Text10.Text = 300

End If

If ar = "rural" Then

Text10.Text = 420

End If

Page 134: Telephone Exchange System

End If

End Sub

Private Sub Combo2_click()

If Combo2.Text = "01" Then

Text7.Text = "N-OUT-Gen"

ElseIf Combo2.Text = "02" Then

Text7.Text = "N-OYT-Spl"

ElseIf Combo2.Text = "03" Then

Text7.Text = "N-OYT-SS"

ElseIf Combo2.Text = "04" Then

Text7.Text = "N-OYT-SWS"

ElseIf Combo2.Text = "05" Then

Text7.Text = "N-OYT-G-SE-DOT"

ElseIf Combo2.Text = "06" Then

Text7.Text = "OYT-Gen"

ElseIf Combo2.Text = "07" Then

Text7.Text = "OYT-Spl"

ElseIf Combo2.Text = "08" Then

Text7.Text = "TATKAL"

End If

End Sub

Private Sub Combo3_Click()

If Combo3.Text = "01" Then

Text8.Text = "Freedom Fighters"

ElseIf Combo3.Text = "02" Then

Text8.Text = "Gallantry Award Winners"

ElseIf Combo3.Text = "03" Then

Text8.Text = "War Widows"

ElseIf Combo3.Text = "04" Then

Text8.Text = "Disabled Soldiers"

ElseIf Combo3.Text = "05" Then

Text8.Text = "Blind"

ElseIf Combo3.Text = "06" Then

Text8.Text = "Senior Citizens"

ElseIf Combo3.Text = "07" Then

Text8.Text = "Retired DOT Employees"

ElseIf Combo3.Text = "08" Then

Page 135: Telephone Exchange System

Text8.Text = "Serving DOT Employees"

ElseIf Combo3.Text = "09" Then

Text8.Text = "Recognized Educational Institutes"

ElseIf Combo3.Text = "10" Then

Text8.Text = "Orphanages"

ElseIf Combo3.Text = "11" Then

Text8.Text = "Homes for aged,infirm,spastics,handicapped,deaf-dump-mute

persons/voluntary,organization for tribal welfare,institutions recorgnized by Govt."

End If

End Sub

Private Sub Command1_Click()

rec.MoveFirst

Text1.Text = rec!cuname

Text2.Text = rec!Pno

Text3.Text = rec!JName

Text4.Text = rec!DNo

Text5.Text = rec!Bname

Text6.Text = rec!Exc

Text7.Text = rec!cname

Text8.Text = rec!Cgname

Text9.Text = rec!Ifee

Text10.Text = rec!Rmonth

Text11.Text = rec!Namount

Text12.Text = rec!PDate

Combo1.Text = rec!Area

Combo2.Text = rec!Ccode

Combo3.Text = rec!Cgcode

Dim a As String

a = rec!pmode

If a = "Cash" Then

Option1.Value = True

End If

If a = "Draft" Then

Option2.Value = True

End If

Page 136: Telephone Exchange System

End Sub

Private Sub Command2_Click()

rec.MovePrevious

If rec.BOF = True Then

rec.MoveFirst

End If

Text1.Text = rec!cuname

Text2.Text = rec!Pno

Text3.Text = rec!JName

Text4.Text = rec!DNo

Text5.Text = rec!Bname

Text6.Text = rec!Exc

Text7.Text = rec!cname

Text8.Text = rec!Cgname

Text9.Text = rec!Ifee

Text10.Text = rec!Rmonth

Text11.Text = rec!Namount

Text12.Text = rec!PDate

Combo1.Text = rec!Area

Combo2.Text = rec!Ccode

Combo3.Text = rec!Cgcode

End Sub

Private Sub Command3_Click()

rec.MoveLast

Text1.Text = rec!cuname

Text2.Text = rec!Pno

Text3.Text = rec!JName

Text4.Text = rec!DNo

Text5.Text = rec!Bname

Text6.Text = rec!Exc

Text7.Text = rec!cname

Text8.Text = rec!Cgname

Text9.Text = rec!Ifee

Text10.Text = rec!Rmonth

Text11.Text = rec!Namount

Text12.Text = rec!PDate

Combo1.Text = rec!Area

Page 137: Telephone Exchange System

Combo2.Text = rec!Ccode

Combo3.Text = rec!Cgcode

End Sub

Private Sub Command4_Click()

rec.MoveNext

If rec.EOF = True Then

rec.MoveLast

End If

Text1.Text = rec!cuname

Text2.Text = rec!Pno

Text3.Text = rec!JName

Text4.Text = rec!DNo

Text5.Text = rec!Bname

Text6.Text = rec!Exc

Text7.Text = rec!cname

Text8.Text = rec!Cgname

Text9.Text = rec!Ifee

Text10.Text = rec!Rmonth

Text11.Text = rec!Namount

Text12.Text = rec!PDate

Combo1.Text = rec!Area

Combo2.Text = rec!Ccode

Combo3.Text = rec!Cgcode

Dim a As String

a = rec!pmode

If a = "cash" Then

Option1.Value = True

End If

If a = "Draft/cheque" Then

Option2.Value = True

End If

End Sub

Private Sub Command5_Click()

Dim x As String, b As String, c As String

Page 138: Telephone Exchange System

If Option3.Value = True Then

x = "Yes"

End If

If Option4.Value = True Then

x = "No"

End If

If Option5.Value = True Then

b = "Yes"

End If

If Option6.Value = True Then

b = "No"

End If

If Combo2.Text = "01" Or Combo2.Text = "02" Or Combo2.Text = "03" Then

If x = "Yes" And b = "Yes" Then

Text11.Text = Val(Text9.Text) + 2160

ElseIf x = "Yes" And b = "No" Then

Text11.Text = (Val(Text9.Text) + (2160 - 500))

ElseIf x = "No" And b = "Yes" Then

Text11.Text = (Val(Text9.Text) + (2160 - 250))

ElseIf x = "No" And b = "No" Then

Text11.Text = (Val(Text9.Text) + (2160 - 250 - 500))

End If

End If

If Combo2.Text = "04" Or Combo2.Text = "05" Then

If x = "Yes" And b = "Yes" Then

Text11.Text = Val(Text9.Text)

ElseIf x = "Yes" And b = "No" Then

Text11.Text = Val(Text9.Text) - 500

ElseIf x = "No" And b = "Yes" Then

Text11.Text = Val(Text9.Text) - 250

ElseIf x = "No" And b = "No" Then

Text11.Text = Val(Text9.Text) - 250 - 500

End If

End If

If Combo2.Text = "06" Or Combo2.Text = "07" Then

r = Val(Text10.Text)

Page 139: Telephone Exchange System

Text10.Text = r - 80

If x = "Yes" And b = "Yes" Then

Text11.Text = Val(Text9.Text) + 10000

ElseIf x = "Yes" And b = "No" Then

Text11.Text = (Val(Text9.Text) + (10000 - 500))

ElseIf x = "No" And b = "Yes" Then

Text11.Text = (Val(Text9.Text) + (10000 - 250))

ElseIf x = "No" And b = "No" Then

Text11.Text = (Val(Text9.Text) + (10000 - 250 - 500))

End If

End If

If Combo2.Text = "08" Then

If x = "Yes" And b = "Yes" Then

Text11.Text = Val(Text9.Text) + 30000

ElseIf x = "Yes" And b = "No" Then

Text11.Text = (Val(Text9.Text) + (30000 - 500))

ElseIf x = "No" And b = "Yes" Then

Text11.Text = (Val(Text9.Text) + (30000 - 250))

ElseIf x = "No" And b = "No" Then

Text11.Text = (Val(Text9.Text) + (30000 - 250 - 500))

End If

End If

If Combo3.Text = "01" Or Combo3.Text = "02" Or Combo3.Text = "03" Or

Combo3.Text = "04" Then

Text9.Text = 0

'Text3.Text = 2160

End If

If Combo3.Text = "01" Or Combo3.Text = "03" Or Combo3.Text = "04" Then

con = Val(Text10.Text)

Text10.Text = con / 2

End If

If Combo3.Text = "05" And Combo2.Text = "01" Then

con = Val(Text10.Text)

Text10.Text = con / 2

End If

If Combo2.Text = "04" And Combo3.Text = "01" Then

Text11.Text = 0

Page 140: Telephone Exchange System

Text9.Text = 0

con = Val(Text10.Text)

Text10.Text = con / 2

End If

If Combo3.Text = "09" Or Combo3.Text = "10" Or Combo3.Text = "11" Then

rn = Val(Text10.Text)

Text10.Text = rn - (rn * 25 / 100)

End If

If Combo3.Text = "02" Then

Text10.Text = 0

Text11.Text = 0

Text9.Text = 0

End If

kk = Val(Text2.Text)

If MsgBox(kk, vbOKOnly, "U Have Alloted the Phone No") = vbOK Then

End If

Text12.Text = Date

End Sub

Private Sub Command6_Click()

rec.AddNew

rec!cuname = Text1.Text

rec!Pno = Text2.Text

rec!JName = Text3.Text

rec!DNo = Text4.Text

rec!Bname = Text5.Text

rec!Exc = Text6.Text

rec!cname = Text7.Text

rec!Cgname = Text8.Text

rec!Ifee = Text9.Text

rec!Rmonth = Text10.Text

rec!Namount = Text11.Text

rec!PDate = Text12.Text

rec!Area = Combo1.Text

rec!Ccode = Combo2.Text

Page 141: Telephone Exchange System

'rec!Cgcode = Text13.Text

MsgBox "Record saved"

rec.Update

End Sub

Private Sub Command7_Click()

form13.Show

Unload Me

End Sub

Private Sub Command8_Click()

Unload Me

End Sub

Private Sub Command9_Click()

End Sub

Private Sub Form_Load()

Set db = New ADODB.Connection

Set rec = New ADODB.Recordset

db.ConnectionString = "dsn=phone;uid=;pwd=;"

db.Open

rec.Open "payment", db, adOpenDynamic, adLockOptimistic

Combo1.AddItem "rural"

Combo1.AddItem "urban"

Combo2.AddItem "01"

Combo2.AddItem "02"

Combo2.AddItem "03"

Combo2.AddItem "04"

Combo2.AddItem "05"

Combo2.AddItem "06"

Combo2.AddItem "07"

Combo2.AddItem "08"

Combo3.AddItem "01"

Combo3.AddItem "02"

Combo3.AddItem "03"

Page 142: Telephone Exchange System

Combo3.AddItem "04"

Combo3.AddItem "05"

Combo3.AddItem "06"

Combo3.AddItem "07"

Combo3.AddItem "08"

Combo3.AddItem "09"

Combo3.AddItem "10"

End Sub

Private Sub Option1_Click()

Text4.Text = "0"

Text5.Text = "Null"

Text4.Enabled = False

Text5.Enabled = False

End Sub

Private Sub Option2_Click()

Text4.Enabled = True

Text5.Enabled = True

End Sub

Private Sub Text6_lostfocus()

a = Val(Text6.Text)

If a <= 500 Then

Text9.Text = 300 + (300 * 5 / 100)

Else

Text9.Text = 800 + (800 * 5 / 100)

End If

End Sub

Dim a As Integer

Dim b As Integer

Private Sub Command1_Click()

Dim a As String

Dim b As String

a = Text1.Text

Page 143: Telephone Exchange System

b = Text2.Text

If a = "Hello" And b = "1234" Then

form13.Show

Unload Me

Else

MsgBox ("Enter Correct Name and password")

End If

End Sub

Private Sub Command2_Click()

Unload Me

End Sub

Private Sub Form_Load()

Text1.Text = "Hello"

Text2.Text = ""

End Sub

Private Sub Timer1_Timer()

If a = 1 Then

Picture = LoadPicture("c:\program files\microsoft visual

Studio\vb98\project\installd.jpg")

a = 2

ElseIf a = 2 Then

Picture = LoadPicture("c:\program files\microsoft visual

Studio\vb98\project\msn.jpg")

a = 3

ElseIf a = 3 Then

Picture = LoadPicture("c:\program files\microsoft visual

Studio\vb98\project\pid.jpg")

a = 4

ElseIf a = 4 Then

Picture = LoadPicture("c:\program files\microsoft visual

Studio\vb98\project\start.jpg")

a = 1

Else

a = 1

End If

Page 144: Telephone Exchange System

End Sub

Private Sub Timer2_Timer()

If b = 0 Then

Label3.Caption = "Wel Come To You Telephone Exchange System"

b = 1

ElseIf b = 1 Then

Label3.Caption = "This Project Title Is Based On BSNL"

b = 2

ElseIf b = 2 Then

Label3.Caption = "Please Enter The Password"

b = 3

ElseIf b = 3 Then

Label3.Caption = " Sir Please Enter The Password"

b = 4

ElseIf b = 4 Then

Label3.Caption = "Sir Please Enter The Correct Password"

b = 0

Else

b = 0

End If

End Sub

Dim db As ADODB.Connection

Dim rec As ADODB.Recordset

Dim rec1 As ADODB.Recordset

Dim flag As Boolean

Private Sub Command1_Click()

Text1.Text = ""

Text2.Text = ""

Text3.Text = ""

Text4.Text = Date

End Sub

Private Sub Command3_Click()

Unload Me

End Sub

Page 145: Telephone Exchange System

Private Sub Command2_Click()

rec1.AddNew

rec1!Tno = Text1.Text

rec1!sname = Text2.Text

rec1!address = Text3.Text

rec1!Date = Text4.Text

MsgBox "This Number Is Stored"

rec1.Update

End Sub

Private Sub Command4_Click()

form13.Show

Unload Me

End Sub

Private Sub Form_Load()

Set db = New ADODB.Connection

Set rec = New ADODB.Recordset

Set rec1 = New ADODB.Recordset

db.ConnectionString = "dsn=phone;uid=;pwd=;"

db.Open

rec1.Open "complaint", db, adOpenDynamic, adLockOptimistic

rec.Open "newconn1", db, adOpenDynamic, adLockOptimistic

Text4.Text = Date

End Sub

Private Sub Text1_LostFocus()

Dim a As Integer

rec.MoveFirst

flag = True

While Not rec.EOF = True

If Text1.Text = rec!Tno Then

flag = False

Text2.Text = rec!cname

Text3.Text = rec!caddress

End If

rec.MoveNext

Wend

If flag = True Then

MsgBox "Please Enter The Correct No."

Page 146: Telephone Exchange System

Text1.Text = ""

Text1.SetFocus

End If

End Sub

Dim db As ADODB.Connection

Dim rec As ADODB.Recordset

Private Sub Command1_Click()

rec.MoveFirst

Text1.Text = rec!Tno

Text2.Text = rec!cname

Text3.Text = rec!Hno

Text4.Text = rec!ST

Text5.Text = rec!City

Text6.Text = rec!Pin

Page 147: Telephone Exchange System

Dim b1, b2, b3, b4, b5, b6, b7 As String

b1 = rec!STD

b2 = rec!ISD

b3 = rec!CLI

b4 = rec!Hotline

b5 = rec!Conf

b6 = rec!CF

b7 = rec!AD

If b1 = "Yes" Then

Check1.Value = 1

Else

Check1.Value = 0

End If

If b2 = "Yes" Then

Check2.Value = 1

Else

Check2.Value = 0

End If

If b3 = "Yes" Then

Check3.Value = 1

Else

Check3.Value = 0

End If

If b4 = "Yes" Then

Check4.Value = 1

Else

Check4.Value = 0

End If

If b5 = "Yes" Then

Check5.Value = 1

Else

Check5.Value = 0

End If

If b6 = "Yes" Then

Check6.Value = 1

Else

Check6.Value = 0

End If

If b7 = "Yes" Then

Check7.Value = 1

Page 148: Telephone Exchange System

Else

Check7.Value = 0

End If

End Sub

Private Sub Command2_Click()

rec.MoveNext

If rec.EOF = True Then

rec.MoveLast

End If

Text1.Text = rec!Tno

Text2.Text = rec!cname

Text3.Text = rec!Hno

Text4.Text = rec!ST

Text5.Text = rec!City

Text6.Text = rec!Pin

Dim b1, b2, b3, b4, b5, b6, b7 As String

b1 = rec!STD

b2 = rec!ISD

b3 = rec!CLI

b4 = rec!Hotline

b5 = rec!Conf

b6 = rec!CF

b7 = rec!AD

If b1 = "Yes" Then

Check1.Value = 1

Else

Check1.Value = 0

End If

If b2 = "Yes" Then

Check2.Value = 1

Else

Check2.Value = 0

End If

If b3 = "Yes" Then

Check3.Value = 1

Else

Check3.Value = 0

End If

Page 149: Telephone Exchange System

If b4 = "Yes" Then

Check4.Value = 1

Else

Check4.Value = 0

End If

If b5 = "Yes" Then

Check5.Value = 1

Else

Check5.Value = 0

End If

If b6 = "Yes" Then

Check6.Value = 1

Else

Check6.Value = 0

End If

If b7 = "Yes" Then

Check7.Value = 1

Else

Check7.Value = 0

End If

End Sub

Private Sub Command3_Click()

rec.MovePrevious

If rec.BOF = True Then

rec.MoveFirst

End If

Text1.Text = rec!Tno

Text2.Text = rec!cname

Text3.Text = rec!Hno

Text4.Text = rec!ST

Text5.Text = rec!City

Text6.Text = rec!Pin

Dim b1, b2, b3, b4, b5, b6, b7 As String

b1 = rec!STD

b2 = rec!ISD

b3 = rec!CLI

b4 = rec!Hotline

Page 150: Telephone Exchange System

b5 = rec!Conf

b6 = rec!CF

b7 = rec!AD

If b1 = "Yes" Then

Check1.Value = 1

Else

Check1.Value = 0

End If

If b2 = "Yes" Then

Check2.Value = 1

Else

Check2.Value = 0

End If

If b3 = "Yes" Then

Check3.Value = 1

Else

Check3.Value = 0

End If

If b4 = "Yes" Then

Check4.Value = 1

Else

Check4.Value = 0

End If

If b5 = "Yes" Then

Check5.Value = 1

Else

Check5.Value = 0

End If

If b6 = "Yes" Then

Check6.Value = 1

Else

Check6.Value = 0

End If

If b7 = "Yes" Then

Check7.Value = 1

Else

Check7.Value = 0

End If

End Sub

Page 151: Telephone Exchange System

Private Sub Command4_Click()

rec.MoveLast

Text1.Text = rec!Tno

Text2.Text = rec!cname

Text3.Text = rec!Hno

Text4.Text = rec!ST

Text5.Text = rec!City

Text6.Text = rec!Pin

Dim b1, b2, b3, b4, b5, b6, b7 As String

b1 = rec!STD

b2 = rec!ISD

b3 = rec!CLI

b4 = rec!Hotline

b5 = rec!Conf

b6 = rec!CF

b7 = rec!AD

If b1 = "Yes" Then

Check1.Value = 1

Else

Check1.Value = 0

End If

If b2 = "Yes" Then

Check2.Value = 1

Else

Check2.Value = 0

End If

If b3 = "Yes" Then

Check3.Value = 1

Else

Check3.Value = 0

End If

If b4 = "Yes" Then

Check4.Value = 1

Else

Check4.Value = 0

End If

If b5 = "Yes" Then

Check5.Value = 1

Else

Check5.Value = 0

Page 152: Telephone Exchange System

End If

If b6 = "Yes" Then

Check6.Value = 1

Else

Check6.Value = 0

End If

If b7 = "Yes" Then

Check7.Value = 1

Else

Check7.Value = 0

End If

End Sub

Private Sub Command5_Click()

Dim a As Integer

a = Text1.Text

rec.MoveFirst

While Not rec.EOF = True

If a = rec!Tno Then

rec!Tno = Text1.Text

rec!cname = Text2.Text

rec!Hno = Text3.Text

rec!ST = Text4.Text

rec!City = Text5.Text

rec!Pin = Text6.Text

If Check1.Value = 0 Then

rec!STD = "NO"

Else

rec!STD = "Yes"

End If

If Check2.Value = 0 Then

rec!ISD = "No"

Else

rec!ISD = "Yes"

End If

If Check3.Value = 0 Then

rec!CLI = "No"

Else

rec!CLI = "Yes"

Page 153: Telephone Exchange System

End If

If Check4.Value = 0 Then

rec!Hotline = "No"

Else

rec!Hotline = "Yes"

End If

If Check5.Value = 0 Then

rec!Conf = "No"

Else

rec!Conf = "Yes"

End If

If Check6.Value = 0 Then

rec!CF = "No"

Else

rec!CF = "Yes"

End If

If Check7.Value = 0 Then

rec!AD = "No"

Else

rec!AD = "Yes"

End If

MsgBox "record Saved"

rec.Update

End If

rec.MoveNext

Wend

Text7.Text = Date

End Sub

Private Sub Command6_Click()

Unload Me

End Sub

Private Sub Command7_Click()

form13.Show

Unload Me

Page 154: Telephone Exchange System

End Sub

Private Sub Form_Load()

Set db = New ADODB.Connection

Set rec = New ADODB.Recordset

db.ConnectionString = "dsn=phone;uid=;pwd=;"

db.Open

rec.Open "newconn1", db, adOpenDynamic, adLockOptimistic

End Sub

Private Sub Text1_LostFocus()

rec.MoveFirst

Dim a As Integer

While Not rec.EOF = True

If Text1.Text = rec!Tno Then

Text2.Text = rec!cname

Text3.Text = rec!Hno

Text4.Text = rec!ST

Text5.Text = rec!City

Text6.Text = rec!Pin

Dim s1, s2, s3, s4, s5, s6, s7 As String

s1 = rec!STD

s2 = rec!ISD

s3 = rec!CLI

s4 = rec!Hotline

s5 = rec!Conf

s6 = rec!CF

s7 = rec!AD

If s1 = "Yes" Then

Check1.Value = 1

Else

Check1.Value = 0

End If

If s2 = "Yes" Then

Check2.Value = 1

Else

Check2.Value = 0

Page 155: Telephone Exchange System

End If

If s3 = "Yes" Then

Check3.Value = 1

Else

Check3.Value = 0

End If

If s4 = "Yes" Then

Check4.Value = 1

Else

Check4.Value = 0

End If

If s5 = "Yes" Then

Check5.Value = 1

Else

Check5.Value = 0

End If

If s6 = "Yes" Then

Check6.Value = 1

Else

Check6.Value = 0

End If

If s7 = "Yes" Then

Check7.Value = 1

Else

Check7.Value = 0

End If

End If

rec.MoveNext

Wend

End Sub

Page 156: Telephone Exchange System

Dim db As ADODB.Connection

Dim rec As ADODB.Recordset

Dim rec1 As ADODB.Recordset

Dim flag As Boolean

Private Sub Command1_Click(Index As Integer)

rec.MoveFirst

Text1.Text = rec!egpfno

Text2.Text = rec!ename

Text3.Text = rec!FName

Text4.Text = rec!EAddress

Text5.Text = rec!Pin

Text6.Text = rec!DBirth

Text7.Text = rec!DJoining

Text8.Text = rec!Group

Text9.Text = rec!BPay

Combo1.Text = rec!Department

Combo2.Text = rec!Destination

Dim a As String

a = rec!Sex

If a = "Male" Then

Option1.Value = True

End If

If a = "Female" Then

Page 157: Telephone Exchange System

Option2.Value = True

End If

End Sub

Private Sub Command10_Click(Index As Integer)

form13.Show

Unload Me

End Sub

Private Sub Command2_Click(Index As Integer)

rec.MoveNext

If rec.EOF = True Then

rec.MoveLast

End If

Text1.Text = rec!egpfno

Text2.Text = rec!ename

Text3.Text = rec!FName

Text4.Text = rec!EAddress

Text5.Text = rec!Pin

Text6.Text = rec!DBirth

Text7.Text = rec!DJoining

Text8.Text = rec!Group

Text9.Text = rec!BPay

Combo1.Text = rec!Department

Combo2.Text = rec!Destination

Dim a As String

a = rec!Sex

If a = "Male" Then

Option1.Value = True

End If

If a = "Female" Then

Option2.Value = True

End If

End Sub

Private Sub Command3_Click(Index As Integer)

rec.MovePrevious

Page 158: Telephone Exchange System

If rec.BOF = True Then

rec.MoveFirst

End If

Text1.Text = rec!egpfno

Text2.Text = rec!ename

Text3.Text = rec!FName

Text4.Text = rec!EAddress

Text5.Text = rec!Pin

Text6.Text = rec!DBirth

Text7.Text = rec!DJoining

Text8.Text = rec!Group

Text9.Text = rec!BPay

Combo1.Text = rec!Department

Combo2.Text = rec!Destination

Dim a As String

a = rec!Sex

If a = "Male" Then

Option1.Value = True

End If

If a = "Female" Then

Option2.Value = True

End If

End Sub

Private Sub Command4_Click(Index As Integer)

rec.MoveLast

Text1.Text = rec!egpfno

Text2.Text = rec!ename

Text3.Text = rec!FName

Text4.Text = rec!EAddress

Text5.Text = rec!Pin

Text6.Text = rec!DBirth

Text7.Text = rec!DJoining

Text8.Text = rec!Group

Text9.Text = rec!BPay

Combo1.Text = rec!Department

Combo2.Text = rec!Destination

Page 159: Telephone Exchange System

Dim a As String

a = rec!Sex

If a = "Male" Then

Option1.Value = True

End If

If a = "Female" Then

Option2.Value = True

End If

End Sub

Private Sub Command5_Click(Index As Integer)

Text1.Text = ""

Text2.Text = ""

Text3.Text = ""

Text4.Text = ""

Text5.Text = ""

Text6.Text = ""

Text7.Text = ""

Text8.Text = ""

Text9.Text = ""

Combo1.Text = ""

Combo2.Text = ""

Option1.Value = False

Option2.Value = False

End Sub

Private Sub Command6_Click(Index As Integer)

rec.Delete

Text1.Text = ""

Text2.Text = ""

Text3.Text = ""

Text4.Text = ""

Text5.Text = ""

Text6.Text = ""

Text7.Text = ""

Text8.Text = ""

Text9.Text = ""

Combo1.Text = ""

Page 160: Telephone Exchange System

Combo2.Text = ""

Option1.Value = False

Option2.Value = False

MsgBox "Record Deleted"

rec.Close

rec.MoveFirst

End Sub

Private Sub Command7_Click(Index As Integer)

rec.AddNew

rec1.AddNew

rec!egpfno = Text1.Text

rec1!egpfno = Text1.Text

rec1!ename = Text2.Text

rec!ename = Text2.Text

rec!FName = Text3.Text

rec!EAddress = Text4.Text

rec!Pin = Text5.Text

rec!DBirth = Text6.Text

rec!DJoining = Text7.Text

rec!Group = Text8.Text

rec!BPay = Text9.Text

rec!Department = Combo1.Text

rec!Destination = Combo2.Text

If Option1.Value = True Then

rec!Sex = "Male"

End If

If Option2.Value = True Then

rec!Sex = "Female"

End If

MsgBox "Record Saved"

rec.Update

rec1.Update

End Sub

Private Sub Command8_Click(Index As Integer)

Page 161: Telephone Exchange System

Unload Me

End Sub

Private Sub Form_Load()

Set db = New ADODB.Connection

Set rec = New ADODB.Recordset

Set rec1 = New ADODB.Recordset

db.ConnectionString = "dsn=phone;uid=;pwd=;"

db.Open

rec.Open "emp", db, adOpenDynamic, adLockOptimistic

rec1.Open "emp_pay", db, adOpenDynamic, adLockOptimistic

Combo1.AddItem "Maintance"

Combo1.AddItem "Account"

Combo1.AddItem "Finance"

Combo2.AddItem "_________"

Combo2.AddItem "Moga"

Combo2.AddItem "Patiala"

End Sub

Private Sub Text1_LostFocus()

Dim a As Integer

rec.MoveFirst

flag = False

While Not rec.EOF = True

If Text1.Text = rec!egpfno And Text1.Text = rec!egpfno Then

flag = True

MsgBox "This number has already exist"

MsgBox "Please Enter Other Number"

Text1.Text = ""

Text1.SetFocus

End If

rec.MoveNext

Wend

If flag = False Then

Text2.SetFocus

End If

End Sub

Page 162: Telephone Exchange System

Dim db As ADODB.Connection

Dim rec As ADODB.Recordset

Private Sub Command5_Click(Index As Integer)

Dim a, b, c As Double

a = Val(Text8.Text)

b = Val(Text9.Text)

c = Val(Text10.Text)

Page 163: Telephone Exchange System

Text11.Text = Val(a + b + c)

Dim a1, a2, a3 As Double

a1 = Val(Text3.Text)

a2 = Val(Text7.Text)

a3 = Val(Text11.Text)

Text12.Text = a1 + a2 - a3

End Sub

Private Sub Command7_Click(Index As Integer)

rec.MoveFirst

While Not rec.EOF = True

If rec!egpfno = Text1.Text Then

rec!ename = Text2.Text

rec!BPay = Text3.Text

rec!HRA = Text4.Text

rec!DA = Text5.Text

rec!GTA = Text6.Text

rec!total = Text7.Text

rec!GPF = Text8.Text

rec!ITax = Text9.Text

rec!Gpfad = Text10.Text

rec!TD = Text11.Text

rec!NSalary = Text12.Text

If Option1.Value = True Then

rec!HLIssue = "Yes"

End If

If Option2.Value = True Then

rec!HLIssue = "No"

End If

rec.Update

MsgBox "record saved"

End If

rec.MoveNext

Wend

End Sub

Private Sub Command8_Click(Index As Integer)

Unload Me

Page 164: Telephone Exchange System

End Sub

Private Sub Command9_Click(Index As Integer)

form13.Show

Unload Me

End Sub

Private Sub Form_Load()

Set db = New ADODB.Connection

Set rec = New ADODB.Recordset

db.ConnectionString = "dsn=phone;uid=;pwd=;"

db.Open

rec.Open "emp_pay", db, adOpenDynamic, adLockOptimistic

End Sub

Private Sub Text1_LostFocus()

rec.MoveFirst

Dim a As Integer

a = Text1.Text

While Not rec.EOF = True

If a = rec!egpfno Then

Text2.Text = rec!ename

End If

rec.MoveNext

Wend

End Sub

Private Sub Text3_LostFocus()

Dim a As Double

Dim h As Double, d As Double, t As Double

a = Text3.Text

If a < 5000 Then

h = (a * 25) / 100

Text4.Text = h

d = (a * 55) / 100

Text5.Text = d

t = (a * 15) / 100

Text6.Text = t

Page 165: Telephone Exchange System

Text7.Text = h + d + t

End If

If a >= 5000 And a < 10000 Then

h = (a * 30) / 100

Text4.Text = h

d = (a * 60) / 100

Text5.Text = d

t = (a * 20) / 100

Text6.Text = t

Text7.Text = h + d + t

End If

If a > 10000 Then

h = (a * 40) / 100

Text4.Text = h

d = (a * 70) / 100

Text5.Text = d

t = (a * 30) / 100

Text6.Text = t

Text7.Text = h + d + t

End If

Dim pf As Double, tax As Double

a = Text3.Text

If a < 5000 Then

pf = (a * 10) / 100

Text8.Text = pf

tax = (a * 10) / 100

Text9.Text = tax

Text11.Text = pf + tax

End If

If a >= 5000 And a < 10000 Then

pf = (a * 10) / 100

Text8.Text = pf

tax = (a * 10) / 100

Text9.Text = tax

Text11.Text = pf + tax

End If

If a > 10000 Then

Page 166: Telephone Exchange System

pf = (a * 10) / 100

Text8.Text = pf

tax = (a * 10) / 100

Text9.Text = tax

Text11.Text = pf + tax

End If

End Sub

Page 167: Telephone Exchange System

Dim db As ADODB.Connection

Dim rec As ADODB.Recordset

Dim a As Integer

Private Sub Command1_Click()

a = Text1.Text

rec.MoveFirst

While rec.EOF = False

b = rec!Tno

If Text1.Text = rec!Tno Then

Unload Me

Load Form9

DataReport1.Show

End If

rec.MoveNext

Wend

End Sub

Private Sub Command2_Click()

form13.Show

Unload Me

End Sub

Private Sub Command4_Click()

Unload Me

End Sub

Private Sub Form_Load()

Set db = New ADODB.Connection

Set rec = New ADODB.Recordset

db.ConnectionString = "dsn=phone;uid=;pwd=;"

db.Open

rec.Open "newconn1", db, adOpenDynamic, adLockOptimistic

End Sub

Page 168: Telephone Exchange System

Dim db As ADODB.Connection

Dim rec As ADODB.Recordset

Dim counter As Integer

Private Sub Command1_Click()

rec.MoveFirst

Text1.Text = rec!Tno

Text2.Text = rec!cname

Text3.Text = rec!Hno

Text4.Text = rec!ST

Text5.Text = rec!City

Text6.Text = rec!Pin

Text8.Text = rec!Later_facility

Dim b1, b2, b3, b4, b5, b6, b7 As String

b1 = rec!STD

b2 = rec!ISD

b3 = rec!CLI

b4 = rec!Hotline

b5 = rec!Conf

b6 = rec!CF

b7 = rec!AD

If b1 = "Yes" Then

Check1.Value = 1

Else

Check1.Value = 0

End If

If b2 = "Yes" Then

Check2.Value = 1

Else

Check2.Value = 0

End If

If b3 = "Yes" Then

Page 169: Telephone Exchange System

Check3.Value = 1

Else

Check3.Value = 0

End If

If b4 = "Yes" Then

Check4.Value = 1

Else

Check4.Value = 0

End If

If b5 = "Yes" Then

Check5.Value = 1

Else

Check5.Value = 0

End If

If b6 = "Yes" Then

Check6.Value = 1

Else

Check6.Value = 0

End If

If b7 = "Yes" Then

Check7.Value = 1

Else

Check7.Value = 0

End If

End Sub

Private Sub Command2_Click()

rec.MoveNext

If rec.EOF = True Then

rec.MoveLast

End If

Text1.Text = rec!Tno

Text2.Text = rec!cname

Text3.Text = rec!Hno

Text4.Text = rec!ST

Text5.Text = rec!City

Text6.Text = rec!Pin

Text8.Text = rec!Later_facility

Dim b1, b2, b3, b4, b5, b6, b7 As String

Page 170: Telephone Exchange System

b1 = rec!STD

b2 = rec!ISD

b3 = rec!CLI

b4 = rec!Hotline

b5 = rec!Conf

b6 = rec!CF

b7 = rec!AD

If b1 = "Yes" Then

Check1.Value = 1

Else

Check1.Value = 0

End If

If b2 = "Yes" Then

Check2.Value = 1

Else

Check2.Value = 0

End If

If b3 = "Yes" Then

Check3.Value = 1

Else

Check3.Value = 0

End If

If b4 = "Yes" Then

Check4.Value = 1

Else

Check4.Value = 0

End If

If b5 = "Yes" Then

Check5.Value = 1

Else

Check5.Value = 0

End If

If b6 = "Yes" Then

Check6.Value = 1

Else

Check6.Value = 0

End If

If b7 = "Yes" Then

Check7.Value = 1

Else

Page 171: Telephone Exchange System

Check7.Value = 0

End If

End Sub

Private Sub Command3_Click()

rec.MovePrevious

If rec.BOF = True Then

rec.MoveFirst

End If

Text1.Text = rec!Tno

Text2.Text = rec!cname

Text3.Text = rec!Hno

Text4.Text = rec!ST

Text5.Text = rec!City

Text6.Text = rec!Pin

Text8.Text = rec!Later_facility

Dim b1, b2, b3, b4, b5, b6, b7 As String

b1 = rec!STD

b2 = rec!ISD

b3 = rec!CLI

b4 = rec!Hotline

b5 = rec!Conf

b6 = rec!CF

b7 = rec!AD

If b1 = "Yes" Then

Check1.Value = 1

Else

Check1.Value = 0

End If

If b2 = "Yes" Then

Check2.Value = 1

Else

Check2.Value = 0

End If

If b3 = "Yes" Then

Check3.Value = 1

Else

Check3.Value = 0

Page 172: Telephone Exchange System

End If

If b4 = "Yes" Then

Check4.Value = 1

Else

Check4.Value = 0

End If

If b5 = "Yes" Then

Check5.Value = 1

Else

Check5.Value = 0

End If

If b6 = "Yes" Then

Check6.Value = 1

Else

Check6.Value = 0

End If

If b7 = "Yes" Then

Check7.Value = 1

Else

Check7.Value = 0

End If

End Sub

Private Sub Command4_Click()

rec.MoveLast

Text1.Text = rec!Tno

Text2.Text = rec!cname

Text3.Text = rec!Hno

Text4.Text = rec!ST

Text5.Text = rec!City

Text6.Text = rec!Pin

Text8.Text = rec!Later_facility

Dim b1, b2, b3, b4, b5, b6, b7 As String

b1 = rec!STD

b2 = rec!ISD

b3 = rec!CLI

b4 = rec!Hotline

b5 = rec!Conf

Page 173: Telephone Exchange System

b6 = rec!CF

b7 = rec!AD

If b1 = "Yes" Then

Check1.Value = 1

Else

Check1.Value = 0

End If

If b2 = "Yes" Then

Check2.Value = 1

Else

Check2.Value = 0

End If

If b3 = "Yes" Then

Check3.Value = 1

Else

Check3.Value = 0

End If

If b4 = "Yes" Then

Check4.Value = 1

Else

Check4.Value = 0

End If

If b5 = "Yes" Then

Check5.Value = 1

Else

Check5.Value = 0

End If

If b6 = "Yes" Then

Check6.Value = 1

Else

Check6.Value = 0

End If

If b7 = "Yes" Then

Check7.Value = 1

Else

Check7.Value = 0

End If

End Sub

Page 174: Telephone Exchange System

Private Sub Command5_Click()

Dim a As Integer

a = Text1.Text

rec.MoveFirst

While Not rec.EOF = True

If a = rec!Tno Then

rec!Tno = Text1.Text

rec!cname = Text2.Text

rec!Hno = Text3.Text

rec!ST = Text4.Text

rec!City = Text5.Text

rec!Pin = Text6.Text

rec!Later_facility = Text8.Text

counter = 0

If Check1.Value = 1 Then

rec!STD = "Yes"

counter = counter + 1

Else

rec!STD = "No"

End If

If Check2.Value = 1 Then

rec!ISD = "Yes"

counter = counter + 1

Else

rec!ISD = "No"

End If

If Check3.Value = 1 Then

counter = counter + 1

rec!CLI = "Yes"

Else

rec!CLI = "No"

End If

If Check4.Value = 1 Then

rec!Hotline = "Yes"

counter = counter + 1

Else

rec!Hotline = "No"

End If

If Check5.Value = 1 Then

rec!Conf = "Yes"

Page 175: Telephone Exchange System

counter = counter + 1

Else

rec!Conf = "No"

End If

If Check6.Value = 1 Then

rec!CF = "Yes"

counter = counter + 1

Else

rec!CF = "No"

End If

If Check7.Value = 1 Then

counter = counter + 1

rec!AD = "Yes"

Else

rec!AD = "No"

End If

If counter = 0 Then

Text8.Text = 0

End If

If counter = 1 Then

Text8.Text = 30

End If

If counter > 1 Then

Text8.Text = 50

End If

MsgBox "record saved"

rec.Update

End If

rec.MoveNext

Wend

Text7.Text = Date

End Sub

Private Sub Command6_Click()

Unload Me

End Sub

Page 176: Telephone Exchange System

Private Sub Command7_Click()

form13.Show

Unload Me

End Sub

Private Sub Command8_Click()

Dim a As Integer

a = Text1.Text

rec.MoveFirst

While Not rec.EOF = True

If a = rec!Tno Then

rec!Tno = Text1.Text

rec!cname = Text2.Text

rec!Hno = Text3.Text

rec!ST = Text4.Text

rec!City = Text5.Text

rec!Pin = Text6.Text

counter = 0

If Check1.Value = 1 Then

rec!STD = "Yes"

counter = counter + 1

Else

rec!STD = "No"

End If

If Check2.Value = 1 Then

rec!ISD = "Yes"

counter = counter + 1

Else

rec!ISD = "No"

End If

If Check3.Value = 1 Then

counter = counter + 1

rec!CLI = "Yes"

Else

rec!CLI = "No"

End If

If Check4.Value = 1 Then

rec!Hotline = "Yes"

counter = counter + 1

Page 177: Telephone Exchange System

Else

rec!Hotline = "No"

End If

If Check5.Value = 1 Then

rec!Conf = "Yes"

counter = counter + 1

Else

rec!Conf = "No"

End If

If Check6.Value = 1 Then

rec!CF = "Yes"

counter = counter + 1

Else

rec!CF = "No"

End If

If Check7.Value = 1 Then

counter = counter + 1

rec!AD = "Yes"

Else

rec!AD = "No"

End If

If counter = 0 Then

Text8.Text = "0"

End If

If counter = 1 Then

Text8.Text = 30

End If

If counter > 1 Then

Text8.Text = 50

End If

End If

rec.MoveNext

Wend

Text7.Text = Date

End Sub

Private Sub Form_Load()

Set db = New ADODB.Connection

Set rec = New ADODB.Recordset

db.ConnectionString = "dsn=phone;uid=;pwd=;"

Page 178: Telephone Exchange System

db.Open

rec.Open "newconn1", db, adOpenDynamic, adLockOptimistic

Text7.Text = Date

End Sub

Private Sub Text1_LostFocus()

rec.MoveFirst

Dim a As Integer

While Not rec.EOF = True

If Text1.Text = rec!Tno Then

Text2.Text = rec!cname

Text3.Text = rec!Hno

Text4.Text = rec!ST

Text5.Text = rec!City

Text6.Text = rec!Pin

Dim s1, s2, s3, s4, s5, s6, s7 As String

s1 = rec!STD

s2 = rec!ISD

s3 = rec!CLI

s4 = rec!Hotline

s5 = rec!Conf

s6 = rec!CF

s7 = rec!AD

If s1 = "Yes" Then

Check1.Value = 1

Else

Check1.Value = 0

End If

If s2 = "Yes" Then

Check2.Value = 1

Else

Check2.Value = 0

End If

If s3 = "Yes" Then

Check3.Value = 1

Else

Check3.Value = 0

End If

Page 179: Telephone Exchange System

If s4 = "Yes" Then

Check4.Value = 1

Else

Check4.Value = 0

End If

If s5 = "Yes" Then

Check5.Value = 1

Else

Check5.Value = 0

End If

If s6 = "Yes" Then

Check6.Value = 1

Else

Check6.Value = 0

End If

If s7 = "Yes" Then

Check7.Value = 1

Else

Check7.Value = 0

End If

End If

rec.MoveNext

Wend

End Sub