Вы находитесь на странице: 1из 58

1.

INTRODUCTION
Now a days computer plays a vital role in all works of the human life. One of the
powerful sources, which are responsible for the present rapid development in all the fields, is
definitely the computer itself.

The project work entitled RAILWAY TICKET RESERVATION SYSTEM has been
developed using Microsoft Visual Basic 6.0 front end and Ms-Access as back end in Windows
XP platform. This Application supports the management in maintenance of Passenger
information; Flight information, Tickets Reservation, Tickets cancellation and related
informations are maintained. It produces daily, weekly, monthly and yearly reports of Airline
Reservation System.

This project is modularly designed. It has four modules.

1. Maintenance Modules
2. Tickets Modules
3. Enquiry Modules
4. Report Modules

1
1.1ABOUT THE ORGANIZATION
About Us
The organization has carved a niche for itself in the IT industry and has increased its
business by acquiring some major domestic projects from the first year of its operations. No
doubt the company has been able to make a name for itself in a relatively short span of time only
because of its ability and commitments to ensure customer satisfaction by rewarding quality
work on right time and in a right manner.

Pie-Cher Infotech is an India based Project training and development Institute


incorporated in the year 2012. We have tie-up in top MNC companies and develop software for
the client companies as their requirements. Pie-Cher Infotech is a multi-faceted organization
formed with a vision to become leader in various domains such as Training, Software
development.

Pie-Cher Infotech is a leading global IT services company, working with clients in the
areas that impact and redefines the core of their businesses. Pie-Cher Infotech is mainly focuses
on 'Project development and Training ', underlined by innovation and value creation, and offers
integrated portfolio of services including College students Final year Project guidance and
Developing new project for their clients.

Pie-Cher Infotech is the leading institute in training the advanced software like Java, EJB, ASP,
and JSP etc. They trained more than 2000 students per year and developed many real time
software. These projects use the new technologies like ASP/XML, Java & JSP.

That company corporate office in ERODE. It controls the core and branch companies.
The company has three young and creative Directors. Each director controls the separate work
in the company. Their creative ideas only show the company different from other companies.

The whole credit of the growth of Pie-Cher Infotech goes to the Directors,
Mr.P.Arumugam .M.Phil., P.Raja.,M.E, and Mr.S.Siddiq.,M.Phil. Their dedication in the
development of Pie-Cher Infotech makes the speed & steady growth.

2
ORGANIZATION CHART

BOARD OF DIRECTORS

MANAGING DIRECTORS

TICKET RESERVATION TICKET CANCELLATION

ADMINISTRATION DEPARTMENT TECHNICAL DEPARTMENT HEAD

ACCOUNTS DEPARTMENT CONSUMER DEPARTMRENT

CHECKING DEPARTMENT

SERVICE DEPARTMENT

3
1.2 HARDWARE SPECIFICATION

PROCESSOR NAME : INTEL PENTIUM IV

PROCESSOR SPEED : 2.0GHZ

HARD DISK CAPACITY : 160GB

RAM : 2 GB

MONITOR : 14 ZENITH

MOUSE : OPTICAL MOUSE

KEYBOARD : LOGITECH 108 KEYS

I.3 SOFTWARE SPECIFICATION

FRONT-END : VISUAL BASIC 6.0


BACK-END : MS- ACCESS 7.0
OPERATING SYSTEM : WINDOWS XP PROFESSIONAL

4
USE OF LANGUAGE:

FRONT END: VISUAL BASIC 6.0:

Visual Basic (VB) is the third-generation event-driven programming language and


integrated development environment (IDE) from Microsoft for its COM programming model.
VB is also considered a relatively easy to learn and use programming language, because of its
graphical development features and BASIC heritage.

Visual Basic was derived from BASIC and enables the rapid application development
(RAD) of graphical user interface (GUI) applications, access to databases using Data Access
Objects DAO, Remote Data Objects RDO, or ActiveX Data Objects ADO, and creation of
ActiveX controls and objects. Scripting languages such as VBA and VBScript are syntactically
similar to Visual Basic, but perform differently.

A programmer can put together an application using the components provided with
Visual Basic itself. Programs written in Visual Basic can also use the Windows API, but doing so
requires external function declarations.

The original Visual Basic for DOS and Visual Basic For Windows were introduced in
1991. Visual Basic 3.0 (a vast improvement over previous versions) was released in 1993. Visual
Basic 4.0 released in late 1995 (added 32 bit application support). Visual Basic 5.0 released in
late 1996. New environment, supported creation of ActiveX controls, deleted 16 bit application
support.

FEATURES :

Faster compiler
New ActiveX data control object
Allows database integration with wide variety of applications
New data report designer
New Package & Deployment Wizard
Additional internet capabilities.
If the user ever used Visual Basic 3, the user too could have known everything. Visual
Basic 3 was a reasonably small but powerful language.
5
Visual Basic 4 added classes to the language and made Visual Basic much more
complicated. Versions 4, 5, and 6 added more support for database programming and
other topics such as custom controls, but Visual Basic was still a fairly understandable
language, and if the user took the time the user could become an expert in just about
all of it.
Associated technologies have been added to the language at an ever - increasing rate,
so, today, it is impossible for anyone to be an expert on every topic that deals with
Visual Basic.

6
BACKEND: MS ACCESS 7.0:

The parts of an Access database:

The following sections are short descriptions of the parts of a typical Access database. To
learn more about each part, follow the links in the See Also section of this article.

Tables
Forms
Reports
Queries
Macros
Tables:

A database table is similar in appearance to a spreadsheet, in that data is stored in rows


and columns. As a result, it is usually quite easy to import a spreadsheet into a database table.
The main difference between storing your data in a spreadsheet and storing it in a database is in
how the data is organized.

Forms:

Forms are sometimes referred to as "data entry screens." They are the interfaces you use
to work with your data, and they often contain command buttons that perform various
commands. You can create a database without using forms by simply editing your data in the
table datasheets. However, most database users prefer to use forms for viewing, entering, and
editing data in the tables.

Reports:

Reports are what you use to summarize and present data in the tables. A report usually
answers a specific question, such as "How much money did we receive from each customer this
year?" or "What cities are our customers located in?" Each report can be formatted to present the
information in the most readable way possible.

7
Queries:

Queries are the real workhorses in a database, and can perform many different functions.
Their most common function is to retrieve specific data from the tables. The data you want to see
is usually spread across several tables, and queries allow you to view it in a single datasheet.
Also, since you usually don't want to see all the records at once, queries let you add criteria to
"filter" the data down to just the records you want. Queries often serve as the record source for
forms and reports.

Macros:

Macros in Access can be thought of as a simplified programming language which you can
use to add functionality to your database. For example, you can attach a macro to a command
button on a form so that the macro runs whenever the button is clicked. Macros contain actions
that perform tasks, such as opening a report, running a query, or closing the database. Most
database operations that you do manually can be automated by using macros, so they can be
great time-saving devices.

FEATURES :

Microsoft Access 7.0 offers many new and improved features to help you help create
powerful database applications.

New objects, properties, methods and other language elements.


Accessing the Internet or an Internet from your application.
Creating custom objects with class modules.
Customizing menus and toolbars in your application
Removing source code from your application
Replicating only a specified part of a database using new features in the
module window.
Creating a tabbed dialog boxes or manipulates page from the tab control.
Setting reference programmatically, using the enhanced debug window,
improving compilation performance.

8
II. SYSTEM ANALYSIS

2.1 PROBLEM DEFINITION:


System Analysis is the process of gathering and interpreting facts, diagnosing problems
and using the information to recommend improvements to the existing system. The major steps
are defining Software Requirements, studying the present system to verify the problem and
defining the performance expected by the management team to meet the user expectations.
2.2 EXISTING SYSTEM

In this existing system, the reports are made manually and it becomes a tedious task. The
preparation of reservation form, passenger details and train details are carried out by longhand
effort. So, to maintain the data and information takes very long time effort. The existing
system of airline reservation system is done manually.

Drawbacks of the existing system:

Takes lot of time for preparing bills


Large amount of time is needed for preparing airline statements
Maintaining accounts is a tedious process
Only important reports are generated
Sometimes, the reports are generated with errors
No security is maintained
Lot of human labor is required
Time consuming process

9
2.3 PROPOSED SYSTEM

Train reservation system manages all the operations of the reservation. The proposed
system is a change to expand or improve business performance and competitive achievements.

The system does the following activities to overcome the difficulties of the existing
system. The project is designed in visual basic which is user friendly.

Advantages of the proposed system:

Reduces the amount of time taken for preparing Train statements and
maintaining accounts
All possible reports are being generated
Security is maintained wherever it is need
Maintaining the route information of each and every travels.
Maintenance of reservation and cancellation of tickets in a more efficient way
which includes the automatic fetching of available seats during reservation.

10
III SYSTEM DESIGN

3.1 SYSTEM DATA FLOW DIAGRAM

Start

Process input form

No
Is information valid?

Yes

Reservation database
is updated

End

11
3.2 FILE SPECIFICATION

TABLE NAME: PASSENGER DETAIL


PURPOSE : PASSENGER PERSONAL DETAILS
PRIAMARY KEY: PASSPORT NUMBER

FIELD NAME DATA TYPE SIZE


Passport Number Number 60
Passenger Name Text 60
Phone Number Number 15
Cell Number Number 10
DOB Date 10
Sex Text 10
Qualification Text 20
State Text 20
Address Text 100

TABLE NAME: TRAIN DETAIL


PURPOSE : TRAIN DETAILS

12
PRIAMARY KEY: TRAIN NUMBER

FIELD NAME DATA TYPE SIZE


Train number Text 10
Departure time Date & Time 10
Arrival time Date & Time 10
Economic Seats Text 20
Source Text 20
Destination Voucher 20
Schedule Text 20
Business Seats Voucher 20

13
TABLE NAME: RESERVATION FROM

PURPOSE : TRAVELLING DETAILS


PRIAMARY KEY: TICKET NUMBER

FIELD NAME DATA TYPE SIZE

Ticket Number Number 20

Passenger number Number 20

Train Number Number 10

Travel Date Date 10

Class Voucher 10

Fare Double 10

Source Text 10

Destination Text 20

Status Text 10

Meals Text 20

Citizenship Text 10

Seat Number Integer 10

Booking Date Date 10

14
TABLE NAME: CANCELLATION FORM
PURPOSE : CANCEL THE RESERVED TICKET
PRIAMARY KEY: TICKET NUMBER
FIELD NAME DATA TYPE SIZE

Ticket Number Number 20

Passenger Name Text 20

Passenger Number Number 20

Address Text 100

Citizenship Text 20

Sex Text 10

Train Number Text 20

From Text 20

To Text 30

Meals Text 30

Status Text 30

Fare Text 30

Traveling Date Date 30

Boarding Place Voucher 30

Destination Text 30

Class Number 20

Seat Number Number 30

Amount Deducted Number 30

Amount Refunded Number 30

3.3 PROCEDURE DESIGN

The procedure for each module of the system is designed in such a manner that the user

while running the system they can get the guidance from the message and it is user friendly one.

15
For each input tables and master tables the procedure is designed in such a way that the user can

add / delete /edit / save any record from the table.

In this project commonly used command button are:

ADD:

It provides facility to add new records in the database about the details of stock and

employee details etc.

NEW:

This command is used to add the new record

SAVE:

Using this button user can save the records to the database.

UPDATE:

In this command button used to update the stored information from the database.

EXIT:

Exit the application

INPUT DESIGN

16
Input Design is one of the most expensive phases of the operation of computerized
system and is often the major problem of a system. A large number of problems with a system
can usually be tracked backs to fault input design and method.

Needless to say, therefore, that the input data is the lifeblood of a system and have to be
analyzed and designed with at most case and consideration.

The decisions made during the input design are

To provide cost effective method of input


To achieve the highest possible level of accuracy
To ensure that input is understand by the user.

System analysis decide the following input design details like, what data to input, what
medium to use, how the data should be arranged or coded, data items and transaction need
validations to detect errors and at last the dialogue to guide user in providing input.

Input data of a system may not be necessarily is raw data captured in the system from
scratch. These can also be the output of another system or subsystem. The design of input covers
all phases of input from the creation of initial data to actual entering the data to the system for
processing. The design of input involves identifying the data needed, specifying the
characteristics of each data item, capturing & preparing data for computer processing and
ensuring correctness of data.

17
OUTPUT DESIGN

Output Design generally refers to the result and information that are generated by the
system for many end-user, output is the main reason for developing the system and the basis on
which they evaluate the usefulness of the application.

The objective of a system finds its shape in terms of the output. The analysis of the
objective of a system leads to determination of output. Output of a system can face various
forms. The most common are report, screen display, printed forms, graphical drawing etc., the
output also vary in terms of their contents frequency, timing & format. The users of the output
from a system are the justification for its existence. If the outputs are inadequate in any way, the
system is itself is adequate. The basic requirement of output are that it should be accurate, timely
and appropriate, in terms of content, medium and layout for its intended purpose.

When designing output, system analysis most accomplish thing like, to determine what
information to be present, to decide whether to display or print the information and select and
output medium and to decide how to distribute the output to intended recipients.

External outputs are those destinations will be outside the organization and which require
special attention as they project the image of the organization.

Internal outputs are those whose destination is with in the organization. It is to be


carefully designed, as they are the user main interface with the system.

18
3.4 DATA FLOW DIAGRAMS

Data flow diagram is the most commonly used object during the analysis stage. A
complete se of DFDs provide a compact top down representation of a system. DFDs are very
helpful in understanding a system and can be effectively used in portioning during analysis. A
data flow diagram (DFD) is a significant modeling technique for analyzing and constructing
information processes. DFD literally means an illustration that explains the course or movement
of information in a process. DFD illustrates this flow of information in a process based on the
inputs and outputs. A DFD can be referred to as a process model.

DFD is a diagrammatic representation of all sorts of the processes. The symbols used in
the FD are:

The rectangle is used to describe the input and output

The circle is used to describe the process

The arrow line is used to describe the logical flow.

The DFD for this system is shown below

19
CONTEXT LEVEL DFD

Option Select Enter internal forms

Logged in as Admin Reservation/ Cancellation/ Status


Logged in as Operator

Edit structure of database

RESERVATION DFD
Iss
ue
PN
R

User Input Process Request Data Store

Check

If appropriate

Add to data store

20

Reservation Done
CANCELLATION DFD

User Input Process Request Check

Delete if appropriate else send ERROR message Cancellation Done

21
STATUS DFD

Data Store

User Input Check

Display Status

22
3.5 MODULES SPECIFICATION

Ticket reservation

This is the module one and this comprises of following subtasks:-

i. Checking for availability


ii. Accepting details
iii. Journey planner
Checking for availability

This is the process of checking the trains database to check whether seats are vacant
or not. That is the whether the ticket that will be reserved is Available or RAC or a
Waiting list.

Accepting Details

This includes following steps :-

a) Gathering passenger details


b) Processing the ticket request
c) Calculation of fare
d) Issuing the PNR
e) Issuing ticket details

Journey planner

This is an innovative idea we are proposing. Softwares first and foremost requirement is
that it should lessen or eliminate manual exertion. That is, it should be as user friendly as
possible.

Now what we propose to achieve by this is, by just entering the starting and ending
station, we will get the list of following details

1. Direct trains to the destination


2. Connection trains which are feasible

23
Status monitoring:

This process lets the passenger / operator know the status of the ticket. There are three
possible states for a ticket to be in

a) Confirmed
b) RAC
c) Waiting list

This process is used to issue the current state of the ticket.

Ticket canceling:

This is the task of canceling a railway ticket. Cancellation leads to the rearrangement of the
database containing the allotted passengers details. There are three cases:-

a) Cancellation of a confirmed ticket involves transforming the RAC-1 to the cancelled


ticket and moving all the RAC and Waiting list entries up by one.
b) Cancellation of a RAC involves moving the succeeding RAC and waiting list entries up
by one.
c) Cancellation of a Waiting list just involves the moving up by one all the succeeding
Waiting list entries.

24
IV SYSTEM TESTING AND IMPLEMENTATION

SYSTEM TESTING

Testing is a process of executing a program with the intent of finding an error. So system
testing is a critical element of software quality assurance and represents the ultimate reviews of
specification, design and coding. This process involves testing in every phase of the system
development. During the requirements phase, the emphasis is upon validation to determine that
the defined requirements meet the needs of the company. Hence all the requirements specified by
the garments management are satisfied by system. It provides all the necessary information
needed for the department.

Levels of Testing
Unit Testing

In unit testing the user tests the programs making up a system. This test focuses on the
modules, independently of one another to locate errors. This enables the tester to deduct errors in
coding and logic that are contained within that module alone. Those resulting from the
interaction between modules are initially avoided.

In this system, demand of each query, customer entry and registration, employee details,
room details are separate modules. They are checked with valid codes and their response is
studied. For invalid inputs they are terminated with messages that are easy to identify.

Integration Testing
All the modules in the system are combined a single system. It also tests to find
discrepancies between the system and its original objective, current specifications, system
documentation. The primary concern is the compatibility of individual modules.

25
Output Testing

After performing the integration testing, the next step is output testing of the proposed
system. Since no system would be useful if it does not produce the required output in a specified
format. The output generated are displayed by the system under consideration are tested by
asking the users about the format required to them. Hence, the output format is considered into
two ways. One is on screen and another is printed format. The output format on screen is found
to be correct as the format was designed in the system design phase according to the user needs.
For the hard copy also, the output comes out as the specified requirements by the user. Hence,
output testing does not result any correction in the system.

Acceptance Testing

The users find no major problems with its accuracy the system passes through a final
acceptance test. This last test confirms that the system meets the original goals, objectives and
requirements established during design.

User acceptance of a system is the key factor for the success of any system. The system
under consideration is tested for user acceptance by constantly keeping in touch with the
prospective system users at the time of developing and making changes where ever required.

The new system developed was tested by the acceptance testing method. Acceptance test
incorporates both unit testing and integration testing. The user provided test area. Thus the
system was successfully tested and it satisfies the user requirements. Afterwards it was
implemented successfully.

Software Testing

The system undergoes integrated testing before the users could use it. It provides a means
for assembling the software. All the related system has been corrected and each unit of data has
been given as inputs to the system and tested. By making slight changes in the units, the over all
system has been obtained with integration.

26
SYSTEM IMPLEMENTATION

Implementation is the stage in the project where the theoretical design is turned into a
working system. The implementation phase constructs, installs and operates the new

system. The most crucial stage in achieving a new successful system is that it will work

efficiently and effectively.

There are several activities involved while implementing a new project. They are

End user training


End user Education
Training on the application software
System Design
Parallel Run And To New System
Post implementation Review
End user Training:

The successful implementation of the new system will purely upon the involvement of
the officers working in that department. The officers will be imparted the necessary training on
the new technology

End User Education:

The education of the end user start after the implementation and testing is over.

When the system is found to be more difficult to under stand and complex, more effort is put to
educate the end used to make them aware of the system, giving them lectures about the new
system and providing them necessary documents and materials about how the system can do this.

27
Training of application software:

After providing the necessary basic training on the computer awareness, the users will
have to be trained upon the new system such as the screen flows and screen design type of help
on the screen, type of errors while entering the data, the corresponding validation check at each
entry and the way to correct the data entered. It should then cover information needed by the
specific user or group to use the system.

Post Implementation View:

The department is planning a method to know the states of t he past implementation


process. For that regular meeting will be arranged by the concerned officers about the
implementation problem and success

28
V.CONCLUSION AND SUGGESTION

Handling large volumes of data manually demands lot of strains. The time consumption
will also be greater because of the processing of large volumes data. Subsequently, the manual
handling of large volume data will lead to great charges of error.

The system is computerized in such a fashion that the get back caused by the existing
system is overcome. The intermediate reports can be used for verification, if necessary in future.
Reports make a good fact of this system. The system has been tested with sample data, with
original data and the system is found to run well.

29
VI BIBLIOGRAPHY

Books Referred :

1. Chris Goode, John Kauffman , Microsoft Visual Basic.NET Programmers Cookbook,

, Tata McGraw-Hill Edition 2002

2. Grey Buczek, Prentice,.NET developers guide 2002, -Hall India.

3. Benolt Marchal,VB.NET by example 2003 , TataMcGraw- Hill.

4. Elias M.Awad, system Analysis And Design, Galgotia Publications (P) Ltd,
1999 Second Edition.

5. Gary Cornell, visual Basic .Net The Ground Up, Tata McGraw Hill
Publications, 1999, Fourth Edition.
6. Ivan Bayross, Understanding MS-Access, BPB Publications, 1997, First Edition.

Websites Referred :

1. www.southernrailway.org
2. www.wikipedia.org
3. www.indianrailways.gov.in
4. www.irctc.co.in
5. www.trainenquiry.com

30
APPENDIX

A1.FORMS

MAIN FORM

31
FILE MENU OPTION

32
WINDOW MENU OPTION

33
REPORT MENU OPTION

34
SEARCH TRAIN OPTION

35
TICKET CANCELLATION WINDOW

36
SELECT THE TRAIN

37
FARE DETAILS

38
A2.REPORTS

RESERVATION LIST

39
TRAIN LIST REPORT

40
FARES LIST

41
SEAT TABLE

42
NORTHERN RAILWAY MAP

43
ABOUT THE APPLICATION

44
A3.CODINGS

Main Form

Private Sub MDIForm_Load()


FormTitleCaptions
Me.Caption = ProjectName
FT.Caption = Me.Caption
FT.Left = 0
FT.Top = 240
FT.Width = 15360
FT.BackStyle = vbTransparent
FT.Alignment = vbCenter
FT.FontSize = 15
FT.FontBold = True
FT.ForeColor = &H4080&
Image1.Top = 0
Image1.Left = 0
Image1.Width = 15360
Image1.Height = Me.Height
Image1.Picture = LoadPicture(ImageNames(0))
Image1.Stretch = True
Set db = OpenDatabase(App.Path & "\DataBase.mdb")
End Sub
Private Sub mnu1_Click()
Load Form1
Form1.Show
End Sub

Private Sub mnu16_Click()


Dim tmpDR6 As DR6
Set tmpDR6 = New DR6
tmpDR6.Caption = mnu16.Caption

45
If DE.rsCommand6.State = 1 Then
DE.rsCommand6.Close
End If
DE.rsCommand6.Requery
tmpDR6.Refresh
tmpDR6.Show
DE.rsCommand6.Close
End Sub
Private Sub mnu18_Click()
Dim tmpDR9 As DR9
Set tmpDR9 = New DR9
tmpDR9.Caption = mnu18.Caption
If DE.rsCommand10.State = 1 Then
DE.rsCommand10.Close
End If
DE.rsCommand10.Requery
tmpDR9.Refresh
tmpDR9.Show
DE.rsCommand10.Close
End Sub
Private Sub mnu20_Click()
Dim tmpDR5 As DR5
Set tmpDR5 = New DR5
tmpDR5.Caption = mnu20.Caption
If DE.rsCommand5.State = 1 Then
DE.rsCommand5.Close
End If
DE.rsCommand5.Requery
tmpDR5.Refresh
tmpDR5.Show
DE.rsCommand5.Close
End Sub

Private Sub mnu21_Click()


Dim tmpDR4 As DR4
46
Set tmpDR4 = New DR4
tmpDR4.Caption = mnu21.Caption
If DE.rsCommand4.State = 1 Then
DE.rsCommand4.Close
End If
DE.rsCommand4.Requery
tmpDR4.Refresh
tmpDR4.Show
DE.rsCommand4.Close
Private Sub mnu22_Click()
Dim tmpDR1 As DR1
Set tmpDR1 = New DR1
tmpDR1.Caption = mnu22.Caption
If DE.rsCommand1.State = 1 Then
DE.rsCommand1.Close
End If
DE.rsCommand1.Open "select * from suppliermaster", DE.Connection1, adOpenDynamic,
adLockOptimistic
DE.rsCommand1.Requery
tmpDR1.Refresh
tmpDR1.Show
DE.rsCommand1.Close
End Sub

Private Sub mnu23_Click()


Dim tmpDR2 As DR2
Set tmpDR2 = New DR2
tmpDR2.Caption = mnu23.Caption
If DE.rsCommand2.State = 1 Then
DE.rsCommand2.Close
End If
DE.rsCommand2.Open "select * from customermaster", DE.Connection1, adOpenDynamic,
adLockOptimistic
DE.rsCommand2.Requery
tmpDR2.Refresh

47
tmpDR2.Show
DE.rsCommand2.Close
End Sub

Private Sub mnu24_Click()


Dim tmpDR3 As DR3
Set tmpDR3 = New DR3
Private Sub Command1_Click()
Dim Chk As Boolean

Chk = Validation(Me)
If Chk = False Then
Exit Sub
Else
MSF.Rows = MSF.Rows + 1
MSF.TextMatrix(MSF.Rows - 1, 0) = Text1.Text
MSF.TextMatrix(MSF.Rows - 1, 1) = Text2.Text
MSF.TextMatrix(MSF.Rows - 1, 2) = Text3.Text
MSF.TextMatrix(MSF.Rows - 1, 3) = Combo1.Text
MSF.TextMatrix(MSF.Rows - 1, 4) = Combo2.Text
MSF.TextMatrix(MSF.Rows - 1, 5) = Text4.Text
MSF.TextMatrix(MSF.Rows - 1, 6) = Text5.Text
MSF.TextMatrix(MSF.Rows - 1, 7) = Text6.Text
Combo1.Text = ""
Combo2.Text = ""
Text4.Text = ""
Text5.Text = ""
Text6.Text = ""
Combo1.SetFocus
End If
End Sub

Private Sub Command2_Click()


AllClear Me
Text6.Text = IDGenerates("ino", "invoice")
48
Text1.SetFocus
Text5.Text = Date
Text4.Text = Time
MSF.Clear
End Sub

Private Sub Command3_Click()


Dim Chk As Boolean
Chk = Validation(Me)
If Chk = False Then
Exit Sub
Else
Dim rsCust As Recordset
Set rsCust = db1.OpenRecordset("select * from invoice where ino=" & Text6.Text)
If Not rsCust.EOF Then
MsgBox "Invoice No Already Exists!", vbCritical, ProjectName
Exit Sub
Else
Dim fn As Integer
rsCust.AddNew
rsCust(0) = Text6.Text
rsCust(1) = Text5.Text
rsCust(2) = Text4.Text
rsCust(3) = Text1.Text
rsCust(4) = Text7.Text
rsCust(5) = Text8.Text
rsCust(6) = Text9.Text
rsCust.Update
MsgBox "Record Stored Successfully!", vbInformation, ProjectName
Command2_Click
End If
End If
End Sub

Private Sub Command4_Click()


49
Me.Hide
End Sub

Text1.Text = MSF.TextMatrix(MSF.MouseRow, 0)
Combo1.Text = MSF.TextMatrix(MSF.MouseRow, 1)
Combo2.Text = MSF.TextMatrix(MSF.MouseRow, 2)
Combo3.Text = MSF.TextMatrix(MSF.MouseRow, 3)
Combo4.Text = MSF.TextMatrix(MSF.MouseRow, 4)
Combo5.Text = MSF.TextMatrix(MSF.MouseRow, 5)
End Sub

Private Sub Text1_KeyDown(KeyCode As Integer, Shift As Integer)


If KeyCode = 13 Then
If Text1.Text <> "" Then
Dim rsInvo As Recordset
Set rsInvo = db1.OpenRecordset("select * from ordermas where ono=" & Text1.Text)
If rsInvo.EOF = False Then
Text2.Text = rsInvo(1)
Text3.Text = rsInvo(2)
Text8.Text = rsInvo(6)
End If
Dim i As Integer
Set rsInvo = db1.OpenRecordset("select * from orderitem where ono=" & Text1.Text)
If rsInvo.EOF = False Then
MSF.Clear
MSF.Cols = 6
MSF.Rows = 1
MSF.TextMatrix(0, 0) = "Order No."
MSF.TextMatrix(0, 1) = "Party Name"
MSF.TextMatrix(0, 2) = "Card Plan"
MSF.TextMatrix(0, 3) = "Quantity"
MSF.TextMatrix(0, 4) = "Unit Price"
MSF.TextMatrix(0, 5) = "Amount"
While rsInvo.EOF = False
MSF.Rows = MSF.Rows + 1
50
For i = 0 To 5
Dim RStr() As String
Private Sub Combo1_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then
If Command6.Tag = "Edit" Then
Command7.SetFocus
Else
Command1.SetFocus
End If
End If
End Sub

Private Sub Command1_Click()


Dim Chk As Boolean
Chk = Validation(Me)
If Chk = False Then
Exit Sub
Else
Dim rsCust As Recordset
Set rsCust = db.OpenRecordset("select * from CustomerMaster where CustID=" & txt(0).Text
& ";")
If Not rsCust.EOF Then
MsgBox "Customer Name is Already Exists!", vbCritical, ProjectName
Exit Sub
Else
Dim fn As Integer
rsCust.AddNew
rsCust(0) = txt(0).Text
rsCust(1) = txt(1).Text
rsCust(2) = txt(2).Text
rsCust(3) = txt(3).Text
rsCust(4) = txt(4).Text
rsCust(5) = Combo1.Text
rsCust.Update
MsgBox "Record Stored Successfully!", vbInformation, ProjectName

51
Command2_Click
Command3_Click
End If
End If
End Sub

Private Sub Command2_Click()


AllClear Me
txt(0).Text = IDGenerates("CustId", "CustomerMaster")
txt(1).SetFocus
AddCombo
Command6.Tag = ""
End Sub

Private Sub Command3_Click()


Dim CHeads(5) As String
CHeads(0) = "Customer Id"
CHeads(1) = "Customer Name"
CHeads(2) = "Address"
CHeads(3) = "E-mail"
CHeads(4) = "Contact No."
CHeads(5) = "Nature of Customer"
Dim qry As String
qry = "SELECT * from CustomerMaster"
LoadMSF CHeads, MSF, qry
End Sub

Private Sub Command4_Click()


MSF.Clear
MSF.Visible = False
End Sub

Private Sub DOP_KeyDown(KeyCode As Integer, Shift As Integer)


If KeyCode = 13 Then
Text2.SetFocus
52
End If
End Sub

Private Sub Form_Initialize()


DOP.SetFocus
End Sub

Private Sub Form_Load()


Me.Caption = FormNames(5)
UCon FT, Me.Caption, Me, 5
Text1.Text = IDGenerates("BillNo", "Sales")
DOP.Value = Now
End Sub

Private Sub Form_Resize()


UCon FT, Me.Caption, Me, 5
End Sub

Private Sub Command1_Click()


Dim Chk As Boolean
Chk = Validation(Me)
If Chk = True Then
Dim rsPur As Recordset
Set rsPur = db.OpenRecordset("select * from sales where billno=" & Text1.Text)
If rsPur.EOF = False Then
MsgBox "Sales done for this bill no.", vbCritical, ProjectName
Exit Sub
Else
rsPur.AddNew
rsPur(0) = Text1.Text
Private Sub Command2_Click()
AllClear Me
Text1.Text = IDGenerates("BillNo", "Sales")
DOP.SetFocus
DOP.Value = Now
53
MSF.Clear
MSF.Cols = 5
MSF.Rows = 1
MSF.TextMatrix(0, 0) = "Order No."
MSF.TextMatrix(0, 1) = "Product Name"
MSF.TextMatrix(0, 2) = "Quantity"
MSF.TextMatrix(0, 3) = "Unit Price"
MSF.TextMatrix(0, 4) = "Amount"
End Sub

Private Sub Command3_Click()


Me.Hide
End Sub

Private Sub Text2_KeyDown(KeyCode As Integer, Shift As Integer)


Dim rsPO As Recordset
Dim rsInvo As Recordset
If KeyCode = 13 Then
If Trim(Text2.Text) <> "" And IsNumeric(Text2.Text) = True Then
Set rsPO = db.OpenRecordset("select * from salesorder where ordno=" & Text2.Text & "
and clear= Yes")
If rsPO.EOF = False Then
MsgBox "Sales Already Done", vbCritical, ProjectName
Command2_Click
Exit Sub
End If
If rsPO.EOF = False Then
Text3.Text = rsPO(0)
Text4.Text = rsPO(1)
Text5.Text = rsPO(2)
Text6.Text = rsPO(3)
Text7.Text = rsPO(4)

Private Sub Combo1_KeyDown(KeyCode As Integer, Shift As Integer)


If KeyCode = 13 Then

54
DPO.SetFocus
End If
End Sub

Private Sub Combo2_KeyDown(KeyCode As Integer, Shift As Integer)


If KeyCode = 13 Then
txt(3).SetFocus
End If
End Sub

Private Sub DPO_KeyDown(KeyCode As Integer, Shift As Integer)


If KeyCode = 13 Then
txt(1).SetFocus
End If
End Sub

Private Sub Form_Resize()


UCon FT, Me.Caption, Me, 9
End Sub
Private Sub Command1_Click()
Dim Chk As Boolean
Chk = Validation(Me)
If Chk = False Then
Exit Sub
Else
MSF.Rows = MSF.Rows + 1
MSF.TextMatrix(MSF.Rows - 1, 0) = txt(0).Text
MSF.TextMatrix(MSF.Rows - 1, 1) = Combo2.Text
MSF.TextMatrix(MSF.Rows - 1, 2) = txt(3).Text
MSF.TextMatrix(MSF.Rows - 1, 3) = txt(4).Text
MSF.TextMatrix(MSF.Rows - 1, 4) = txt(5).Text
Combo2.Text = ""
txt(3).Text = ""
txt(4).Text = ""
txt(5).Text = ""
55
Combo2.SetFocus
End If
End Sub

Private Sub Command2_Click()


AllClear Me
txt(0).Text = IDGenerates("OrdNo", "PurchaseOrder")
AddCombo
Combo1.SetFocus
MSF.Clear
MSF.Cols = 5
MSF.Rows = 1
MSF.TextMatrix(0, 0) = "Order No."
MSF.TextMatrix(0, 1) = "Material Name"
MSF.TextMatrix(0, 2) = "Quantity"
MSF.TextMatrix(0, 3) = "Unit Price"
MSF.TextMatrix(0, 4) = "Amount"
HiO
End Sub

Private Sub Command3_Click()


Dim Chk As Boolean
Chk = Validation(Me)
If Chk = False Then
Exit Sub

Private Sub MSF_DblClick()


txt(0).Text = MSF.TextMatrix(MSF.MouseRow, 0)
Combo2.Text = MSF.TextMatrix(MSF.MouseRow, 1)
txt(3).Text = MSF.TextMatrix(MSF.MouseRow, 2)
txt(4).Text = MSF.TextMatrix(MSF.MouseRow, 3)
txt(5).Text = MSF.TextMatrix(MSF.MouseRow, 4)
End Sub

Private Sub Hi()


56
L1.Visible = False
L2.Visible = False
L3.Visible = False
L4.Visible = False
Combo2.Visible = False
txt(3).Visible = False
txt(4).Visible = False
txt(5).Visible = False
End Sub

Private Sub HiO()


L1.Visible = True
L2.Visible = True
L3.Visible = True
L4.Visible = True
Combo2.Visible = True
txt(3).Visible = True
txt(4).Visible = True
txt(5).Visible = True
End Sub

Private Sub txt_KeyDown(Index As Integer, KeyCode As Integer, Shift As Integer)


If KeyCode = 13 Then
If Index = 0 Then
Combo1.SetFocus
ElseIf Index = 2 Then
Combo2.SetFocus
ElseIf Index < txt.UBound Then
txt(Index + 1).SetFocus
Else
If MsgBox("Are you want to Select another Material", vbInformation + vbYesNo,
ProjectName) = vbYes Then
Command1_Click
Combo2.SetFocus

57
Else
Command1_Click
Command5_Click
Command3.SetFocus
End If
End If
End If
End Sub

58

Вам также может понравиться