PROJECT REPORT
2006-09
COURIER MANAGEMENT SYSTEM
Submitted in the partial fulfillment of the requirement for the award of the
degree
OF
BACHELOR OF COMPUTER APPLICATIONS
SUBMITTED BY:
Navneet kumar (9350094)
UNDER THE GUIDANCE OF INTERNAL GUIDE:
MR. UMESH CHAND
INSTITUTE OF MANAGEMENT STUDIES
NH-24, ADHYATMIK NAGAR,
DECLARATION
I Nishant Jain declare that the BCA project entitled
“Courier Management System” is a original piece of work
done by me and has not been submitted to any other
institute/college/university in any manner possible.
ACKNOWLEDGEMENT
No task however small can be completed in a hostile & uninspiring
environment. Thus I wish to thanks every person who directly or indirectly
helped to create a congenital atmosphere for me to work in & successfully
complete our project.
I express my highly indebted heartful gratitude to Mr.Manoj Kumar,
Chairperson (B.C.A.), I.M.S., Ghaziabad for giving me the opportunity to do
the project in I.M.S. & for providing me with his great learning experience.
I express my deep sense of gratitude,whole hearted thanks to Mr.Umesh
Chand,Faculty member,I.M.S. for her invaluable all around guidance &
encouragement,which has played the major role in the completion of this
project. Her encouragement from time to time helped me to travel along with
the project & eventually to the completion of this project.
Special thanks to Mr. Yudhister Yadav for helping us satisfy
our queries regarding project on time.
Nishant Jain
CONTENTS
1.
CATEGORY OF PROJECT 5-7
2.
AREA OF PROJECT.
8-9
3.
INTRODUCTION OF THE PROJECT
10-15
1. Introduction 2. Existing System
a . How Existing System Works. b. Limitation
3. Proposed System and Advantages
4.
REQUIREMENT
16-17
1. Hardware Requirement. 2. Software Requirement.
5.
DIAGRAMS
18-21
1. Context Flow Diagram 2. Data Flow Diagram
6.
SOFTWARE DEVELOPMENT LIFE CYCLE
22-28
1. Diagram
2. Requirement analysis and specification 3. Designing
4. Coding 5. Testing
6. Implementation 7. Maintenance.
7.
CONCLUSION
29-30
8.
SOURCE CODE
31-228
9.
OUTPUT
229-243
10.
BIBLIOGRAPHY
244-245
1
CATEGORY
OF
PROJECT
CATEGORY OF PROJECT
CLIENT –SERVER
Client-server describes the relationship between two computer programs in
which one program, the client program, makes a service request to another,
the server program. Standard networked functions such as email exchange,
web access and database access, are based on the client-server model. For
example, a
web browser
is a client program at the user computer that may
access information at any web server in the world. To check your bank
account from your computer, a web browser client program in your
computer forwards your request to a web server program at the bank. That
program may in turn forward the request to its own database client program
that sends a request to a database server at another bank computer to retrieve
your account balance. The balance is returned to the bank database client,
which in turn serves it back to the web browser client in your personal
computer, which displays the information for you.
2
AREA
OF
PROJECT
AREA OF PROJECT
3
INTRODUCTION
1-INTRODUCTION
Today’s world is very fast and competitive. To achieve the success in this competitive world, one should be aware of the computer and the information related to the concerned business because computer and the information plays an important weeks manually. Right information available at the right place makes the decision process efficient. Hence the identification of the current and future requirement becomes a basic need of any flexible information system
Courier management system is software which is used manage the work regarding the services of the courier in an effective & efficient manner. Basically it stores the information regarding the customer and his material, which has to be couriered.
2- EXISTING SYSTEM
The courier system involves a lot of the employees at the office.
The data for a particular courier maintained in a proper file. A person summarizes all the data of the courier in a register, this work require a high-level of attention since it has to be taken care that no wring entry goes into the register. This repetitive work may lead to errors in the entry thus resulting in the wrong entry of courier packed data.
Since the data is maintained in the registers, the modification of data cannot done easily. The previous information has to be erased and overwritten or a new page has to be allocated so that both the old and new information can be written on the same page.
The summarizing of the data i.e. preparation of an up to data report is very complex, it require a lot of hard work and searching through the different register so as to condense the data for presentation.
LIMITATION
From the client site, the entire work was achieved manually and they manage all their billing and services manually. Because of the manual system there are so many problems occurred in the existing system:
- It involves managing a huge number of data each having separate data items.
All the work is done at a very large volume, so we have a possibility of loosing the data.
To look for a particular problem the entire system is searched, so the process becomes more time consuming.
a-
HOW EXISTING SYSTEM WORKS:
-The present courier system involves a lot of the employees at the office.
The data of a particular courier maintained in a proper file. A person summarizes all the data of the courier in a register, this work of making a summary of the courier in the register require a high-level of attention since it has to be taken care that no wring entry goes into the register. This repetitive work may lead to errors in the entry thus resulting in the wrong entry of courier packed data.
Since the data is maintained in the registers, the modification of data cannot do easily. The previous information has to be erased and overwritten or a new page has to be allocated so that both the old and new information can be written on the same page.
The summarizing of the data i.e. preparation of an up to data report is very complex, it require a lot of hard work and searching through the different register so as to condense the data for presentation.
b-LIMITATIONS OF EXISTING SYSTEM:
From the client site, the entire work was achieved manually and they manage all their billing and services manually. Because of the manual system there are so many problems occurred in the existing system:
- It involves managing a huge amount of data each having separate data items.
All the work is done at a very large volume, so we have a possibility of loosing the data.
To look for a particular problem the entire system is searched, so the process becomes more time consuming.
In Today’s fast and competitive WORLD to achieve the success in this, one should be aware of the computer and the information related to the concerned business because computer and the information play an important work. Right information available at the right place makes the decision process efficient. Hence the identification of the current and future requirement becomes a basic need of any flexible information system. So there is a need of a courier management system that can overcome the limitations of the existing courier system.
Courier management system
is software which is used manage the work regarding the services of the courier in an effective & efficient manner. Basically it stores the information regarding the customer and his material, which has to be couriered.3- PROPOSED SYSTEM
After a detailed study of the existing system, it is evident that is does not fulfill the objective of the organization. To make the objective possible for the organisaton, it is required to have a computerized information system with the help of which all tasks can be processed more accurately and quickly. To achieve this, it is necessary to design and develop a new system. Proposed system is being designed in such a way that many users can have a view with the system simultaneously. it makes effective and perfect utilization of man power and resources.
ADVANTAGES
Easy in maintaining information: As new information is being added to and released from their respective courses every year, it will be highly user friendly to track and maintain the presentation of all students.
User satisfaction: The system is such that is stands up to the user expectations like easy and faster retrieval of information.
Safety: The system will be accessible by only the authorized users. As information being the most crucial for the organization, then the safety of information is importation.
Highly accurate: resources being used by the system will be compatible with the latest technologies available in the market, as proposed system uses highly technically compatible resources, there will be very very lass wear and tear.
.
Less time consuming: work carried out by the staff at various stages will be less time consuming4
REQUIRMENT
1-HARDWARE REQUIREMENT
Processor Pentium IV
Main memory 64MB RAM Hard disk drive 40 MB
2-SOFTWARE REQUIREMENT
Operating system WINDOWS 95 /XP/ 2000/ NT
Front end Visual basic 6.0
5
DIAGRAMS
1-CONTEXT FLOW DIAGRAM
Response Material Information MaterialSearch data Bill
Payment Information Custom Employe
Courier
Service
CustomerCONTEXT FLOW DIAGRAM
Response Packet Information Bill Payment CustCourier
Managemen
t system
stomer2-SYSTEM DATA FLOW DIAGRAM
Information saved
Input packet and Saved information
Search data Record
Display r er
Courier
Service
Information
Of6
SOFTWARE
DEVELOPMENT
LIFE CYCLE
SYSTEM DEVELOPMENT LIFE
CYCLE
The software also said to have a life cycle that is composed of several
phases. Each of these phases is the development of either a part of the
system or something associated with system such as a test plan & user
manual.
Each phase has well define starting and ending point, with clearly
identifiable input to the next phase. Or we can say that output of every phase
will be the input to the next phase. A software development life cycle
consists of following phase:
-Requirement, analysis and specification.
Designing
Coding
Testing.
Implementation.
Maintenance.
1-DIAGRAM OF SOFTWARE
DEVELOPMENT LIFE CYCLE
Requirement, analysis and specification Designing Coding Testing Maintenance Implementatio
n
2-Requirement analysis & specification
Requirement is concerned with identification the basic function of
the software component in hardware / software / people system.
It is related to getting the requirements and the various
specifications, which are, require for developing particular software. The
basic idea behind of requirement analysis is to know about what the
customer wants all the details and information concerning to the software to
be developed are taken from the client either by going to his place or getting
the information pertaining to employees etc. this phase of system
development life cycle if of almost important because it carries with a huge
amount of relevant data which will be used in developing a software. If this
phase is not carried out properly then there are changes that there will be
shortcomings or bugs in the software, which is going to be developed by the
programmers.
3-Designing
Design consists of architectural design and detail design.
Architectural design involves identifying the s/w component, developing
and decomposing them in processing modules and conceptual data structure,
and specifying interconnection between the component. Detail design is
concerned with the details of “how to” package the processing modules and
how to implement the processing algorithm, data structure and
interconnection among the modules and data structures.
4-Coding
The coding phase of s/w development involves translation of design
specification into source code and debugging, documentation unit testing of
the source code. In this phase the programmer develops the software by
using various methologies which are available for developing software. The
programmer writes the code in a certain language and development team
consists of various programmers who are efficient in their respective do
5-Testing
This phase related to the testing of the software after it has been
developed. In this phase the testing engineers carriers out various testing
strategies and tools to check whether the software developed by the
programmer is following the predefined standard and the quality of the
software is upto the level to which it is require. The various techniques used
for testing by a testing engineers are white box testing, black box testing,
unit testing etc. there are technique are useful in getting rid of the
shortcoming or feature which are there on the part of programmer. If certain
features are encountered they are informed to the programmers and he has to
eliminate those failures from software. This is how the software is developed
which is all together free from the bugs and is ready for implementation on
the client side
.
6-Implementation
This phase related to installing the software on the client side. The
various procedure are involved for implementing a software which include
giving documentation of the software to the client which consist of basic as
well as technical part. It also includes giving proper training sessions and
presentations to the client
regarding the working of the software. It also includes checking of various
hardware resources available with the client and making sure the software is
running properly on this machine.
7-Maintenance
In this phase the programmer or some other technical employers of the
company, which is developing the software in order to manage the hanging
requirements of the client from time to time, do review. If there is any
failure in the software or the client is nit able to access the database then the
same is intimated to the developer who has to take care of it within the
certain amount of time.
7
CONCLUSION
CONCLUSION
1. The courier services are automated as hand written documentation is
minimized to a bare minimum the software is fully implemented.
2. The data can be easily backed up onto a reliable media so that no or
minimal data lass is there in case of system crash.
3.
Unauthorized access to the data is nearly eliminated
by providing password authentication system.This project has made us require a professional outlook towards problem statement and solving it to the best and maximum.
8
SOURCE CODE
CODING
Dim Flag As Boolean
Private Sub cmdClear_Click() ClearAll
End Sub
Private Sub cmdExit_Click() Unload Me
End Sub
Private Sub cmdPrint_Click() Dim Rs As New ADODB.Recordset If Rs.State = adStateOpen Then Rs.Close
End If
Rs.Open "select bank,address,state,city,phone,mobile from bankprofile order by bank", Con, adOpenKeyset If Rs.RecordCount > 0 Then Set dsrClient.DataSource = Rs dsrClient.Show dsrClient.Refresh End If End Sub
Private Sub cmdSubmit_Click() Dim Rs As New ADODB.Recordset
If Trim(txtBN) <> "" And Flag = False Then For i = 0 To lstBN.ListCount - 1
If Trim(UCase(txtBN)) = Trim(UCase(lstBN.List(i))) Then MsgBox "Bank Already Exist", vbOKOnly + vbInformation txtBN.SetFocus
Exit Sub End If Next
Con.Execute "insert into Bankprofile (Bank,address,city,state,phone,mobile) values ('" & Trim(txtBN) & "','" & Trim(txtAddress) & "','" & Trim(txtCP) & "','" & Trim(txtSD) & "','" & Trim(txtPhone) & "','" & Trim(txtMobile) & "')"
If Rs.State = adStateOpen Then Rs.Close
End If
Rs.Open "select max(id) as max_id from Bankprofile", Con, adOpenKeyset If Rs.RecordCount > 0 Then lstBN.AddItem Trim(txtBN) lstBN.ItemData(lstBN.ListCount - 1) = Rs!max_id ClearAll End If
ElseIf Trim(txtBN) <> "" And Flag = True Then
Con.Execute "update Bankprofile set Bank='" & Trim(txtBN) & "',address='" & Trim(txtAddress) & "',state='" & Trim(txtSD) & "',city='" & Trim(txtCP) & "',phone='" & Trim(txtPhone) & "',mobile='" & Trim(txtMobile) & "' where id=" & Val(txtBN.Tag) ClearAll
End If End Sub
Private Sub Form_Load()
If Rs.State = adStateOpen Then Rs.Close
End If
Rs.Open "select id,Bank from Bankprofile order by Bank", Con, adOpenKeyset If Rs.RecordCount > 0 Then
For i = 0 To Rs.RecordCount - 1 lstBN.AddItem Rs!Bank & "" lstBN.ItemData(i) = Rs!id Rs.MoveNext
Next End If End Sub
Private Sub lstbn_DblClick()
Dim Rs As New ADODB.Recordset If Rs.State = adStateOpen Then Rs.Close
End If
If lstBN.ListIndex > -1 Then
Rs.Open "select * from Bankprofile where id=" & lstBN.ItemData(lstBN.ListIndex), Con, adOpenKeyset
If Rs.RecordCount > 0 Then txtBN = Rs!Bank & "" txtBN.Tag = Rs!id & "" txtAddress = Rs!address & "" txtSD = Rs!State & ""
txtCP = Rs!city & "" txtPhone = Rs!phone & "" txtMobile = Rs!mobile & "" Flag = True
End If End Sub
Private Sub lstbn_KeyPress(KeyAscii As Integer) If KeyAscii = 13 Then
txtBN.SetFocus End If
End Sub
Private Sub txtAddress_KeyPress(KeyAscii As Integer) If KeyAscii = 13 Then
txtSD.SetFocus
ElseIf KeyAscii = 27 Then txtBN.SetFocus
End If End Sub
Private Sub txtbn_KeyPress(KeyAscii As Integer) If KeyAscii = 13 Then
txtAddress.SetFocus ElseIf KeyAscii = 27 Then lstBN.SetFocus If lstBN.ListCount > 0 Then lstBN.ListIndex = 0 End If End If End Sub
Private Sub txtCP_KeyPress(KeyAscii As Integer) If KeyAscii = 13 Then
ElseIf KeyAscii = 27 Then txtSD.SetFocus
End If End Sub
Private Sub txtMobile_KeyPress(KeyAscii As Integer) If KeyAscii = 13 Then
cmdSubmit.SetFocus ElseIf KeyAscii = 27 Then txtPhone.SetFocus End If
End Sub
Private Sub txtPhone_KeyPress(KeyAscii As Integer) If KeyAscii = 13 Then
txtMobile.SetFocus ElseIf KeyAscii = 27 Then txtCP.SetFocus
End If End Sub
Private Sub txtSD_KeyPress(KeyAscii As Integer) If KeyAscii = 13 Then
txtCP.SetFocus
ElseIf KeyAscii = 27 Then txtAddress.SetFocus End If
End Sub Sub ClearAll() txtBN = ""
txtBN.Tag = "" txtAddress = "" txtSD = "" txtCP = "" txtPhone = "" txtMobile = "" txtBN.SetFocus End Sub
Private Sub cmbBank_Click() Dim Rs As New ADODB.Recordset If Rs.State = adStateOpen Then Rs.Close
End If
If cmbBank.ListCount > 0 Then
Rs.Open "select * from bankprofile where id=" &
cmbBank.ItemData(cmbBank.ListIndex), Con, adOpenKeyset If Rs.RecordCount > 0 Then
txtBPhone = Rs!phone & "" txtBMobile = Rs!mobile & "" txtBAddress = Rs!address & "" txtBState = Rs!State & "" txtBCity = Rs!city & ""
grdDetails.Rows = 1 End If
End If End Sub
Private Sub cmbBank_KeyPress(KeyAscii As Integer) If KeyAscii = 13 Then
dtpFrom.SetFocus End If
End Sub
Private Sub cmdClear_Click() ClearAll
End Sub
Unload Me End Sub
Private Sub dtpPFM_KeyDown(KeyCode As Integer, Shift As Integer) Dim Rs As New ADODB.Recordset
If KeyCode = 13 Then
If Rs.State = adStateOpen Then Rs.Close
End If
Rs.Open "select * from pfm where datepfm=#" & dtpPFM.Value & "# and bid=" & Val(cmbBank.ItemData(cmbBank.ListIndex)), Con, adOpenKeyset
If Rs.RecordCount > 0 Then grdDetails.Rows = 1 For i = 0 To Rs.RecordCount - 1 grdDetails.Rows = grdDetails.Rows + 1 grdDetails.TextMatrix(grdDetails.Rows - 1, 0) = grdDetails.Rows - 1 grdDetails.TextMatrix(grdDetails.Rows - 1, 1) = Format(Rs!currentdate, "dd mmm yyyy") grdDetails.TextMatrix(grdDetails.Rows - 1, 2) = Trim(Rs!sno) grdDetails.TextMatrix(grdDetails.Rows - 1, 3) = Trim(Rs!Weight) grdDetails.TextMatrix(grdDetails.Rows - 1, 4) = Trim(Rs!tostation) grdDetails.TextMatrix(grdDetails.Rows - 1, 5) = Trim(Rs!amount) grdDetails.RowData(i + 1) = Rs!id Rs.MoveNext Next
Label10 = Rs.RecordCount & " Records Found" Else
grdDetails.Rows = 1
Label10 = "No Data Found" End If
cmbBank.SetFocus End If
End Sub
Private Sub cmdSearch_Click() Dim Rs As New ADODB.Recordset If Rs.State = adStateOpen Then Rs.Close
End If
Rs.Open "select * from pfm where datepfm between #" & dtpFrom.Value & "# and #" & dtpTo.Value & "# and bid=" & Val(cmbBank.ItemData(cmbBank.ListIndex)), Con, adOpenKeyset If Rs.RecordCount > 0 Then grdDetails.Rows = 1 For i = 0 To Rs.RecordCount - 1 grdDetails.Rows = grdDetails.Rows + 1 grdDetails.TextMatrix(grdDetails.Rows - 1, 0) = grdDetails.Rows - 1 grdDetails.TextMatrix(grdDetails.Rows - 1, 1) = Format(Rs!currentdate, "dd mmm yyyy") grdDetails.TextMatrix(grdDetails.Rows - 1, 2) = Trim(Rs!sno) grdDetails.TextMatrix(grdDetails.Rows - 1, 3) = Trim(Rs!Weight) grdDetails.TextMatrix(grdDetails.Rows - 1, 4) = Trim(Rs!tostation) grdDetails.TextMatrix(grdDetails.Rows - 1, 5) = Trim(Rs!amount) grdDetails.RowData(i + 1) = Rs!id Rs.MoveNext Next
Label10 = Rs.RecordCount & " Records Found" Else
grdDetails.Rows = 1
End If End Sub
Private Sub Command1_Click() Dim Rs As New ADODB.Recordset If grdDetails.Rows > 1 Then
If Rs.State = adStateOpen Then Rs.Close
End If
Rs.Open "select * from pfm where datepfm between #" & dtpFrom.Value & "# and #" & dtpTo.Value & "# and bid=" & Val(cmbBank.ItemData(cmbBank.ListIndex)), Con, adOpenKeyset
If Rs.RecordCount > 0 Then
dsrBill.Sections("section4").Controls("label10").Caption = cmbBank.Text
dsrBill.Sections("section4").Controls("label11").Caption = Format(dtpFrom.Value, "dd MMM yyyy") & " To " & Format(dtpTo.Value, "dd MMM yyyy")
Set dsrBill.DataSource = Rs dsrBill.Show dsrBill.Refresh End If End If End Sub
Private Sub dtpFrom_KeyDown(KeyCode As Integer, Shift As Integer) If KeyCode = 13 Then
dtpTo.SetFocus
ElseIf KeyCode = 27 Then cmbBank.SetFocus End If
Private Sub dtpTo_KeyDown(KeyCode As Integer, Shift As Integer) If KeyCode = 13 Then
cmdSearch.SetFocus ElseIf KeyCode = 27 Then dtpFrom.SetFocus End If
End Sub
Private Sub Form_Load()
Dim Rs As New ADODB.Recordset grdDetails.ColWidth(0) = 550 grdDetails.TextMatrix(0, 0) = "S.no" grdDetails.ColWidth(1) = 1350 grdDetails.TextMatrix(0, 1) = "Date" grdDetails.ColWidth(2) = 850 grdDetails.TextMatrix(0, 2) = "C.No." grdDetails.ColWidth(3) = 865 grdDetails.TextMatrix(0, 3) = "Weight" grdDetails.ColWidth(4) = 2035
grdDetails.TextMatrix(0, 4) = "To Station" grdDetails.ColWidth(5) = 1075
grdDetails.TextMatrix(0, 5) = "Amount" grdDetails.Rows = 1
If Rs.State = adStateOpen Then Rs.Close
End If
Rs.Open "select id,bank from bankprofile order by bank", Con, adOpenKeyset If Rs.RecordCount > 0 Then
For i = 0 To Rs.RecordCount - 1 cmbBank.AddItem Rs!Bank & "" cmbBank.ItemData(i) = Rs!id Rs.MoveNext Next cmbBank.ListIndex = 0 End If End Sub Sub ClearAll() grdDetails.Rows = 1 cmbCompany.SetFocus End Sub
Dim Flag As Boolean
Private Sub cmdClear_Click() ClearAll
End Sub
Private Sub cmdExit_Click() Unload Me
End Sub
Private Sub cmdPrint_Click() Dim Rs As New ADODB.Recordset If Rs.State = adStateOpen Then Rs.Close
End If
Rs.Open "select company,address,state,city,phone,mobile from companyprofile order by company", Con, adOpenKeyset
If Rs.RecordCount > 0 Then Set dsrCompany.DataSource = Rs dsrCompany.Show dsrCompany.Refresh End If End Sub
Private Sub cmdSubmit_Click() Dim Rs As New ADODB.Recordset
If Trim(txtCN) <> "" And Flag = False Then For i = 0 To lstCN.ListCount - 1
If Trim(UCase(txtCN)) = Trim(UCase(lstCN.List(i))) Then
MsgBox "Company Already Exist", vbOKOnly + vbInformation txtCN.SetFocus
Exit Sub End If Next
Con.Execute "insert into companyprofile (company,address,city,state,phone,mobile) values ('" & Trim(txtCN) & "','" & Trim(txtAddress) & "','" & Trim(txtCP) & "','" & Trim(txtSD) & "','" & Trim(txtPhone) & "','" & Trim(txtMobile) & "')"
If Rs.State = adStateOpen Then Rs.Close
End If
Rs.Open "select max(id) as max_id from companyProfile", Con, adOpenKeyset If Rs.RecordCount > 0 Then
lstCN.ItemData(lstCN.ListCount) = Rs!max_id lstCN.AddItem Trim(txtCN)
ClearAll End If
ElseIf Trim(txtCN) <> "" And Flag = True Then
Con.Execute "update companyprofile set company='" & Trim(txtCN) & "',address='" & Trim(txtAddress) & "',state='" & Trim(txtSD) & "',city='" & Trim(txtCN) &
"',phone='" & Trim(txtPhone) & "',mobile='" & Trim(txtMobile) & "' where id=" & Val(txtCN.Tag)
ClearAll End If End Sub
Private Sub Form_Load()
Dim Rs As New ADODB.Recordset If Rs.State = adStateOpen Then Rs.Close
End If
Rs.Open "select id,company from companyProfile order by company", Con, adOpenKeyset
If Rs.RecordCount > 0 Then For i = 0 To Rs.RecordCount - 1 lstCN.AddItem Rs!company & "" lstCN.ItemData(i) = Rs!id
Rs.MoveNext Next
End If End Sub
Private Sub lstCN_DblClick() Dim Rs As New ADODB.Recordset If Rs.State = adStateOpen Then Rs.Close
End If
If lstCN.ListIndex > -1 Then
Rs.Open "select * from companyProfile where id=" & lstCN.ItemData(lstCN.ListIndex), Con, adOpenKeyset If Rs.RecordCount > 0 Then
txtCN = Rs!company & "" txtCN.Tag = Rs!id & "" txtAddress = Rs!address & "" txtSD = Rs!State & ""
txtCP = Rs!city & "" txtPhone = Rs!phone & "" txtMobile = Rs!mobile & "" Flag = True
End If End If
End Sub
Private Sub lstCN_KeyPress(KeyAscii As Integer) If KeyAscii = 13 Then
txtCN.SetFocus End If
End Sub
Private Sub txtAddress_KeyPress(KeyAscii As Integer) If KeyAscii = 13 Then
txtSD.SetFocus
ElseIf KeyAscii = 27 Then txtCN.SetFocus
End If End Sub
Private Sub txtCN_KeyPress(KeyAscii As Integer) If KeyAscii = 13 Then
txtAddress.SetFocus ElseIf KeyAscii = 27 Then lstCN.SetFocus If lstCN.ListCount > 0 Then lstCN.ListIndex = 0 End If End If End Sub
Private Sub txtCP_KeyPress(KeyAscii As Integer) If KeyAscii = 13 Then
txtPhone.SetFocus ElseIf KeyAscii = 27 Then
txtSD.SetFocus End If
End Sub
Private Sub txtMobile_KeyPress(KeyAscii As Integer) If KeyAscii = 13 Then
cmdSubmit.SetFocus ElseIf KeyAscii = 27 Then txtPhone.SetFocus End If
End Sub
Private Sub txtPhone_KeyPress(KeyAscii As Integer) If KeyAscii = 13 Then
txtMobile.SetFocus ElseIf KeyAscii = 27 Then txtCP.SetFocus
End If End Sub
Private Sub txtSD_KeyPress(KeyAscii As Integer) If KeyAscii = 13 Then
txtCP.SetFocus
ElseIf KeyAscii = 27 Then txtAddress.SetFocus End If End Sub Sub ClearAll() txtCN = "" txtCN.Tag = ""
txtAddress = "" txtSD = "" txtCP = "" txtPhone = "" txtMobile = "" txtCN.SetFocus End Sub
Private Sub cmbBoy_KeyPress(KeyAscii As Integer) If KeyAscii = 13 Then
txtCNo.SetFocus
ElseIf KeyAscii = 27 Then dtpDelivery.SetFocus End If
End Sub
Private Sub cmbBoy_LostFocus() Dim Rs As New ADODB.Recordset If Rs.State = adStateOpen Then Rs.Close
End If
'Rs.Open "select distinct cno from Delivery where D_Date=#" & dtpDelivery.Value & "# and cid=" & cmbCompany.ItemData(cmbCompany.ListIndex) & " and boyid=" & cmbBoy.ItemData(cmbBoy.ListIndex), Con, adOpenKeyset
Rs.Open "select distinct cno from Delivery where D_Date=#" & dtpDelivery.Value & "# and boyid=" & cmbBoy.ItemData(cmbBoy.ListIndex), Con, adOpenKeyset
If Rs.RecordCount > 0 Then lstCNo.Clear
For i = 0 To Rs.RecordCount - 1 lstCNo.AddItem Rs!cno & "" Rs.MoveNext Next Else lstCNo.Clear End If End Sub
Dim Rs As New ADODB.Recordset If Rs.State = adStateOpen Then Rs.Close
End If
If cmbCompany.ListCount > 0 Then
Rs.Open "select * from companyprofile where id=" &
cmbCompany.ItemData(cmbCompany.ListIndex), Con, adOpenKeyset If Rs.RecordCount > 0 Then
txtPhone = Rs!phone & "" txtMobile = Rs!mobile & "" txtAddress = Rs!address & "" txtState = Rs!State & "" txtcity = Rs!city & "" ' lstCNo.Clear
' grdDetails.Rows = 1 End If
End If End Sub
Private Sub cmbCompany_KeyPress(KeyAscii As Integer) If KeyAscii = 13 Then
dtpDelivery.SetFocus End If
End Sub
Private Sub cmbType_KeyPress(KeyAscii As Integer) Dim Rs As New ADODB.Recordset
If Trim(txtDocument) = "" Then Exit Sub
If KeyAscii = 13 And Val(txtSNo) = 0 Then If Trim(txtCNo) = "" Then
MsgBox "C.No. Must Be There", vbOKOnly + vbInformation txtCNo.SetFocus Exit Sub End If grdDetails.Rows = grdDetails.Rows + 1 grdDetails.TextMatrix(grdDetails.Rows - 1, 0) = grdDetails.Rows - 1 grdDetails.TextMatrix(grdDetails.Rows - 1, 1) = Trim(txtDocument) grdDetails.TextMatrix(grdDetails.Rows - 1, 2) = Trim(txtFW) grdDetails.TextMatrix(grdDetails.Rows - 1, 3) = Trim(txtParty) grdDetails.TextMatrix(grdDetails.Rows - 1, 4) = Trim(txtAmount) grdDetails.TextMatrix(grdDetails.Rows - 1, 5) = Trim(cmbType.Text)
Con.Execute "insert into Delivery (cid,D_date,boyid,cno,dno,fw,party,amount,type) values (" & Val(cmbCompany.ItemData(cmbCompany.ListIndex)) & ",#" &
dtpDelivery.Value & "#," & Val(cmbBoy.ItemData(cmbBoy.ListIndex)) & ",'" & Trim(txtCNo) & "','" & Trim(txtDocument) & "','" & Trim(txtFW) & "','" & Trim(txtParty) & "'," & Val(txtAmount) & ",'" & Trim(cmbType.Text) & "')"
If Rs.State = adStateOpen Then Rs.Close
End If
Rs.Open "select max(id) as max_ID from delivery", Con, adOpenKeyset If Rs.RecordCount > 0 Then grdDetails.RowData(grdDetails.Rows - 1) = Rs!max_id End If txtSNo = "" txtDocument = "" txtFW = ""
txtParty = "" txtAmount = ""
cmbType.ListIndex = 0 txtDocument.SetFocus
ElseIf KeyAscii = 13 And Val(txtSNo) > 0 Then
grdDetails.TextMatrix(Val(txtSNo), 1) = Trim(txtDocument) grdDetails.TextMatrix(Val(txtSNo), 2) = Trim(txtFW) grdDetails.TextMatrix(Val(txtSNo), 3) = Trim(txtParty) grdDetails.TextMatrix(Val(txtSNo), 4) = Trim(txtAmount) grdDetails.TextMatrix(Val(txtSNo), 5) = Trim(cmbType.Text)
Con.Execute "update Delivery set dno='" & Trim(txtDocument) & "',fw='" & Trim(txtFW) & "',party='" & Trim(txtParty) & "',amount=" & Val(txtAmount) & ",type='" & Trim(cmbType) & "' where id=" & grdDetails.RowData(Val(txtSNo)) txtSNo = "" txtDocument = "" txtFW = "" txtParty = "" txtAmount = "" cmbType.ListIndex = 0 txtDocument.SetFocus ElseIf KeyAscii = 27 Then txtAmount.SetFocus End If
End Sub
Private Sub cmdClear_Click() ClearAll
End Sub
Unload Me End Sub
Private Sub cmdPrint_Click() Dim Rs As New ADODB.Recordset If grdDetails.Rows > 1 Then
Con.Execute "delete from dump" For i = 1 To grdDetails.Rows - 1
Con.Execute "insert into dump values ('" & Trim(grdDetails.TextMatrix(i, 0)) & "','" & Trim(grdDetails.TextMatrix(i, 1)) & "','" & Trim(grdDetails.TextMatrix(i, 2)) & "','" & Trim(grdDetails.TextMatrix(i, 3)) & "')"
Next
If Rs.State = adStateOpen Then Rs.Close
End If
Rs.Open "select * from dump", Con, adOpenKeyset If Rs.RecordCount > 0 Then Set dsrDelivery.DataSource = Rs dsrDelivery.Show dsrDelivery.Refresh End If End If End Sub
Private Sub dtpDelivery_KeyDown(KeyCode As Integer, Shift As Integer) If KeyCode = 13 Then
cmbBoy.SetFocus ElseIf KeyCode = 27 Then cmbCompany.SetFocus End If
Private Sub dtpDelivery_LostFocus() Dim Rs As New ADODB.Recordset If Rs.State = adStateOpen Then Rs.Close
End If
'Rs.Open "select distinct cno from Delivery where D_Date=#" & dtpDelivery.Value & "# and cid=" & cmbCompany.ItemData(cmbCompany.ListIndex), Con, adOpenKeyset Rs.Open "select distinct cno from Delivery where D_Date=#" & dtpDelivery.Value & "#", Con, adOpenKeyset
If Rs.RecordCount > 0 Then lstCNo.Clear
For i = 0 To Rs.RecordCount - 1 lstCNo.AddItem Rs!cno & "" Rs.MoveNext
Next End If End Sub
Private Sub Form_Load()
Dim Rs As New ADODB.Recordset grdDetails.ColWidth(0) = 525
grdDetails.TextMatrix(0, 0) = "S.No." grdDetails.ColWidth(1) = 1075
grdDetails.TextMatrix(0, 1) = "Doc. No." grdDetails.ColWidth(2) = 1945
grdDetails.ColWidth(3) = 1945
grdDetails.TextMatrix(0, 3) = "Party Name" grdDetails.ColWidth(4) = 1075
grdDetails.TextMatrix(0, 4) = "Amount" grdDetails.ColWidth(5) = 1185
grdDetails.TextMatrix(0, 5) = "Type" grdDetails.Rows = 1
If Rs.State = adStateOpen Then Rs.Close
End If
Rs.Open "select id,empname from staff order by empname", Con, adOpenKeyset If Rs.RecordCount > 0 Then
For i = 0 To Rs.RecordCount - 1 cmbBoy.AddItem Rs!empname & "" cmbBoy.ItemData(i) = Rs!id Rs.MoveNext Next cmbBoy.ListIndex = 0 End If
If Rs.State = adStateOpen Then Rs.Close
End If
Rs.Open "select id,company from companyprofile order by company", Con, adOpenKeyset
If Rs.RecordCount > 0 Then For i = 0 To Rs.RecordCount - 1
cmbCompany.ItemData(i) = Rs!id Rs.MoveNext Next cmbCompany.ListIndex = 0 cmbType.ListIndex = 0 End If dtpDelivery.Value = Date End Sub
Private Sub lstCno_DblClick() Dim Rs As New ADODB.Recordset If Rs.State = adStateOpen Then Rs.Close
End If
'Rs.Open "select * from Delivery where D_date=#" & dtpDelivery.Value & "# and cid=" & cmbCompany.ItemData(cmbCompany.ListIndex) & " and cno=" & Val(lstCNo.Text), Con, adOpenKeyset
Rs.Open "select * from Delivery where D_date=#" & dtpDelivery.Value & "# and cno=" & Val(lstCNo.Text), Con, adOpenKeyset
If Rs.RecordCount > 0 Then grdDetails.Rows = 1 For i = 0 To Rs.RecordCount - 1 grdDetails.Rows = grdDetails.Rows + 1 grdDetails.TextMatrix(grdDetails.Rows - 1, 0) = grdDetails.Rows - 1 grdDetails.TextMatrix(grdDetails.Rows - 1, 1) = Trim(Rs!dno) grdDetails.TextMatrix(grdDetails.Rows - 1, 2) = Trim(Rs!FW) grdDetails.TextMatrix(grdDetails.Rows - 1, 3) = Trim(Rs!Party) grdDetails.TextMatrix(grdDetails.Rows - 1, 4) = Trim(Rs!amount) grdDetails.TextMatrix(grdDetails.Rows - 1, 5) = Trim(Rs!Type) grdDetails.RowData(i + 1) = Rs!id Rs.MoveNext
Next End If End Sub
Private Sub txtAmount_KeyPress(KeyAscii As Integer) If KeyAscii = 13 Then
cmbType.SetFocus ElseIf KeyAscii = 27 Then txtParty.SetFocus End If
End Sub
Private Sub txtCNo_Change() Dim Rs As New ADODB.Recordset If Rs.State = adStateOpen Then Rs.Close
End If
'Rs.Open "select * from Delivery where D_date=#" & dtpDelivery.Value & "# and cid=" & cmbCompany.ItemData(cmbCompany.ListIndex) & " and boyid=" &
cmbBoy.ItemData(cmbBoy.ListIndex) & " and cno=" & Val(txtCNo), Con, adOpenKeyset
Rs.Open "select * from Delivery where D_date=#" & dtpDelivery.Value & "# and boyid=" & cmbBoy.ItemData(cmbBoy.ListIndex) & " and cno=" & Val(txtCNo), Con, adOpenKeyset If Rs.RecordCount > 0 Then grdDetails.Rows = 1 For i = 0 To Rs.RecordCount - 1 grdDetails.Rows = grdDetails.Rows + 1 grdDetails.TextMatrix(grdDetails.Rows - 1, 0) = grdDetails.Rows - 1 grdDetails.TextMatrix(grdDetails.Rows - 1, 1) = Trim(Rs!dno) grdDetails.TextMatrix(grdDetails.Rows - 1, 2) = Trim(Rs!FW)
grdDetails.TextMatrix(grdDetails.Rows - 1, 3) = Trim(Rs!Party) grdDetails.TextMatrix(grdDetails.Rows - 1, 4) = Trim(Rs!amount) grdDetails.TextMatrix(grdDetails.Rows - 1, 5) = Trim(Rs!Type) grdDetails.RowData(i + 1) = Rs!id Rs.MoveNext Next Else grdDetails.Rows = 1 End If End Sub
Private Sub txtcno_KeyPress(KeyAscii As Integer) If KeyAscii = 13 Then
txtSNo.SetFocus
ElseIf KeyAscii = 27 Then cmbBoy.SetFocus End If
End Sub
Private Sub txtDocument_KeyPress(KeyAscii As Integer) If KeyAscii = 13 Then
txtFW.SetFocus
ElseIf KeyAscii = 27 Then txtSNo.SetFocus
End If End Sub
Private Sub txtParty_KeyPress(KeyAscii As Integer) If KeyAscii = 13 Then
txtAmount.SetFocus ElseIf KeyAscii = 27 Then
txtFW.SetFocus End If
End Sub
Private Sub txtSno_Change() If grdDetails.Rows > 1 Then For i = 1 To grdDetails.Rows - 1
If Val(grdDetails.TextMatrix(i, 0)) = Val(txtSNo) Then txtDocument = grdDetails.TextMatrix(i, 1)
txtFW = grdDetails.TextMatrix(i, 2) txtParty = grdDetails.TextMatrix(i, 3) txtAmount = grdDetails.TextMatrix(i, 4) If grdDetails.TextMatrix(i, 5) = "Parsal" Then cmbType.ListIndex = 1 Else cmbType.ListIndex = 0 End If Exit Sub Else txtDocument = "" txtFW = "" txtParty = "" txtAmount = "" cmbType.ListIndex = 0 End If Next Else txtSNo = "" End If End Sub
Private Sub txtSno_KeyPress(KeyAscii As Integer) If KeyAscii = 13 Then
txtDocument.SetFocus ElseIf KeyAscii = 27 Then txtCNo.SetFocus
End If End Sub
Private Sub txtFW_KeyPress(KeyAscii As Integer) If KeyAscii = 13 Then
txtParty.SetFocus ElseIf KeyAscii = 27 Then txtDocument.SetFocus End If End Sub Sub ClearAll() txtCNo = "" txtSNo = "" txtDocument = "" txtFW = "" txtParty = "" txtAmount = "" cmbType.ListIndex = 0 grdDetails.Rows = 1 lstCNo.Clear cmbCompany.SetFocus End Sub
Dim Flag As Boolean
Private Sub cmbCompany_Click() Dim Rs As New ADODB.Recordset If Rs.State = adStateOpen Then Rs.Close
End If
If cmbCompany.ListCount > 0 Then
Rs.Open "select * from companyprofile where id=" &
cmbCompany.ItemData(cmbCompany.ListIndex), Con, adOpenKeyset If Rs.RecordCount > 0 Then
txtPhone = Rs!phone & "" txtMobile = Rs!mobile & "" txtAddress = Rs!address & "" txtState = Rs!State & "" txtcity = Rs!city & "" lstlaot.Clear
grdDetails.Rows = 1 End If
End If End Sub
Private Sub cmbCompany_KeyPress(KeyAscii As Integer) If KeyAscii = 13 Then
dtpGCD.SetFocus End If
End Sub
Private Sub cmbCrDr_KeyPress(KeyAscii As Integer) Dim Rs As New ADODB.Recordset
If KeyAscii = 13 And Val(txtSNo) = 0 Then
If Trim(txtDocument) = "" Then
MsgBox "Document No. must Be There", vbOKOnly + vbInformation txtDocument.SetFocus
Exit Sub End If
If Trim(txtLaot) = "" Then
MsgBox "laot No. must Be There", vbOKOnly + vbInformation txtLaot.SetFocus Exit Sub End If grdDetails.Rows = grdDetails.Rows + 1 grdDetails.TextMatrix(grdDetails.Rows - 1, 0) = grdDetails.Rows - 1 grdDetails.TextMatrix(grdDetails.Rows - 1, 1) = Trim(txtDocument) grdDetails.TextMatrix(grdDetails.Rows - 1, 2) = Trim(cmbType.Text) grdDetails.TextMatrix(grdDetails.Rows - 1, 3) = Trim(txtWeight) grdDetails.TextMatrix(grdDetails.Rows - 1, 4) = Trim(cmbUrgent.Text) grdDetails.TextMatrix(grdDetails.Rows - 1, 5) = Trim(txtCharges) grdDetails.TextMatrix(grdDetails.Rows - 1, 6) = Trim(cmbCrDr.Text) If Trim(txtCharges) = "" Then txtCharges = 0 End If
Con.Execute "insert into incominglaot
(cid,gcd,laotno,dno,type,weight,urgent,charges,drcr) values (" &
Val(cmbCompany.ItemData(cmbCompany.ListIndex)) & ",#" & dtpGCD.Value & "#,'" & Trim(txtLaot) & "','" & Trim(txtDocument) & "','" & Trim(cmbType.Text) & "'," &
Val(txtWeight) & ",'" & Trim(cmbUrgent.Text) & "'," & Trim(txtCharges) & ",'" & Trim(cmbCrDr.Text) & "')"
If Rs.State = adStateOpen Then Rs.Close
End If
Rs.Open "select max(id) as max_ID from incominglaot", Con, adOpenKeyset If Rs.RecordCount > 0 Then grdDetails.RowData(grdDetails.Rows - 1) = Rs!max_id End If txtSNo = "" txtDocument = "" cmbType.ListIndex = 0 txtWeight = "" cmbUrgent.ListIndex = 0 txtCharges = "" cmbCrDr.ListIndex = 0 txtDocument.SetFocus
ElseIf KeyAscii = 13 And Val(txtSNo) > 0 Then
grdDetails.TextMatrix(Val(txtSNo), 1) = Trim(txtDocument) grdDetails.TextMatrix(Val(txtSNo), 2) = Trim(cmbType.Text) grdDetails.TextMatrix(Val(txtSNo), 3) = Trim(txtWeight) grdDetails.TextMatrix(Val(txtSNo), 4) = Trim(cmbUrgent.Text) grdDetails.TextMatrix(Val(txtSNo), 5) = Trim(txtCharges) grdDetails.TextMatrix(Val(txtSNo), 6) = Trim(cmbCrDr.Text)
Con.Execute "update incominglaot set dno='" & Trim(txtDocument) & "',type='" & Trim(cmbType.Text) & "',weight=" & Val(txtWeight) & ",urgent='" &
Trim(cmbUrgent.Text) & "',charges=" & Val(txtCharges) & ",drcr='" & Trim(cmbCrDr.Text) & "' where id=" & grdDetails.RowData(Val(txtSNo))
txtSNo = "" txtDocument = "" cmbType.ListIndex = 0 txtWeight = "" cmbUrgent.ListIndex = 0 txtCharges = "" cmbCrDr.ListIndex = 0 txtDocument.SetFocus ElseIf KeyAscii = 27 Then txtCharges.SetFocus End If
End Sub
Private Sub cmbType_KeyPress(KeyAscii As Integer) If KeyAscii = 13 Then
txtWeight.SetFocus ElseIf KeyAscii = 27 Then txtDocument.SetFocus End If
End Sub
Private Sub cmbUrgent_KeyPress(KeyAscii As Integer) If KeyAscii = 13 Then
txtCharges.SetFocus ElseIf KeyAscii = 27 Then txtWeight.SetFocus End If
End Sub
ClearAll End Sub
Private Sub cmdExit_Click() Unload Me
End Sub
Private Sub dtpGCD_KeyDown(KeyCode As Integer, Shift As Integer) If KeyCode = 13 Then
txtLaot.SetFocus
ElseIf KeyCode = 27 Then cmbCompany.SetFocus End If
End Sub
Private Sub dtpGCD_LostFocus() Dim Rs As New ADODB.Recordset If Rs.State = adStateOpen Then Rs.Close
End If
Rs.Open "select distinct laotno from incominglaot where gcd=#" & dtpGCD.Value & "# and cid=" & cmbCompany.ItemData(cmbCompany.ListIndex), Con, adOpenKeyset If Rs.RecordCount > 0 Then
lstlaot.Clear
For i = 0 To Rs.RecordCount - 1 lstlaot.AddItem Rs!laotno & "" Rs.MoveNext
Next
Label18 = "Total " & Rs.RecordCount & " Laot No. Found" End If
Private Sub Form_Load()
Dim Rs As New ADODB.Recordset grdDetails.ColWidth(0) = 525
grdDetails.TextMatrix(0, 0) = "S.No." grdDetails.ColWidth(1) = 1400
grdDetails.TextMatrix(0, 1) = "Doc. No." grdDetails.ColWidth(2) = 1215 grdDetails.TextMatrix(0, 2) = "Type" grdDetails.ColWidth(3) = 1075 grdDetails.TextMatrix(0, 3) = "Weight" grdDetails.ColWidth(4) = 1045 grdDetails.TextMatrix(0, 4) = "Urgent" grdDetails.ColWidth(5) = 1075 grdDetails.TextMatrix(0, 5) = "Charges" grdDetails.ColWidth(6) = 1035 grdDetails.TextMatrix(0, 6) = "Dr/Cr" grdDetails.Rows = 1
If Rs.State = adStateOpen Then Rs.Close
End If
Rs.Open "select id,company from companyprofile order by company", Con, adOpenKeyset
If Rs.RecordCount > 0 Then For i = 0 To Rs.RecordCount - 1
cmbCompany.AddItem Rs!company & "" cmbCompany.ItemData(i) = Rs!id Rs.MoveNext Next cmbCompany.ListIndex = 0 cmbType.ListIndex = 0 cmbUrgent.ListIndex = 0 cmbCrDr.ListIndex = 0 End If dtpGCD.Value = Date End Sub
Private Sub lstlaot_DblClick() Dim Rs As New ADODB.Recordset If Rs.State = adStateOpen Then Rs.Close
End If
Rs.Open "select * from incominglaot where gcd=#" & dtpGCD.Value & "# and cid=" & cmbCompany.ItemData(cmbCompany.ListIndex) & " and laotno='" & lstlaot.Text & "'", Con, adOpenKeyset If Rs.RecordCount > 0 Then grdDetails.Rows = 1 For i = 0 To Rs.RecordCount - 1 grdDetails.Rows = grdDetails.Rows + 1 grdDetails.TextMatrix(grdDetails.Rows - 1, 0) = grdDetails.Rows - 1 grdDetails.TextMatrix(grdDetails.Rows - 1, 1) = Rs!dno & ""
grdDetails.TextMatrix(grdDetails.Rows - 1, 2) = Rs!Type & "" grdDetails.TextMatrix(grdDetails.Rows - 1, 3) = Rs!Weight & "" grdDetails.TextMatrix(grdDetails.Rows - 1, 4) = Rs!urgent & ""
grdDetails.TextMatrix(grdDetails.Rows - 1, 5) = Rs!charges & "" grdDetails.TextMatrix(grdDetails.Rows - 1, 6) = Rs!drcr & "" grdDetails.RowData(i + 1) = Rs!id Rs.MoveNext Next Flag = True End If End Sub
Private Sub txtCharges_KeyPress(KeyAscii As Integer) If KeyAscii = 13 Then
cmbCrDr.SetFocus ElseIf KeyAscii = 27 Then cmbUrgent.SetFocus End If
End Sub
Private Sub txtDocument_KeyPress(KeyAscii As Integer) If KeyAscii = 13 Then
cmbType.SetFocus ElseIf KeyAscii = 27 Then txtSNo.SetFocus
End If End Sub
Private Sub txtLaot_Change() Dim Rs As New ADODB.Recordset If Rs.State = adStateOpen Then Rs.Close
Rs.Open "select * from incominglaot where gcd=#" & dtpGCD.Value & "# and cid=" & cmbCompany.ItemData(cmbCompany.ListIndex) & " and laotno='" & Trim(txtLaot) & "'", Con, adOpenKeyset If Rs.RecordCount > 0 Then grdDetails.Rows = 1 For i = 0 To Rs.RecordCount - 1 grdDetails.Rows = grdDetails.Rows + 1 grdDetails.TextMatrix(grdDetails.Rows - 1, 0) = grdDetails.Rows - 1 grdDetails.TextMatrix(grdDetails.Rows - 1, 1) = Rs!dno & ""
grdDetails.TextMatrix(grdDetails.Rows - 1, 2) = Rs!Type & "" grdDetails.TextMatrix(grdDetails.Rows - 1, 3) = Rs!Weight & "" grdDetails.TextMatrix(grdDetails.Rows - 1, 4) = Rs!urgent & "" grdDetails.TextMatrix(grdDetails.Rows - 1, 5) = Rs!charges & "" grdDetails.TextMatrix(grdDetails.Rows - 1, 6) = Rs!drcr & "" grdDetails.RowData(i + 1) = Rs!id Rs.MoveNext Next Flag = True Else grdDetails.Rows = 1 End If End Sub
Private Sub txtLaot_KeyPress(KeyAscii As Integer) If KeyAscii = 13 Then
txtSNo.SetFocus
ElseIf KeyAscii = 27 Then dtpGCD.SetFocus End If
Private Sub txtSno_Change() If grdDetails.Rows > 1 Then For i = 1 To grdDetails.Rows - 1
If Val(grdDetails.TextMatrix(i, 0)) = Val(txtSNo) Then txtDocument = grdDetails.TextMatrix(i, 1)
If grdDetails.TextMatrix(i, 2) = "Parsal" Then cmbType.ListIndex = 1 Else cmbType.ListIndex = 0 End If txtWeight = grdDetails.TextMatrix(i, 3)
If grdDetails.TextMatrix(i, 4) = "No" Then cmbUrgent.ListIndex = 0 Else cmbUrgent.ListIndex = 1 End If txtCharges = grdDetails.TextMatrix(i, 5) If grdDetails.TextMatrix(i, 6) = "Dr" Then cmbCrDr.ListIndex = 0 Else cmbCrDr.ListIndex = 1 End If Exit Sub Else txtDocument = "" cmbType.ListIndex = 0 txtWeight = "" cmbUrgent.ListIndex = 0 txtCharges = ""
cmbCrDr.ListIndex = 0 End If Next Else txtSNo = "" End If End Sub
Private Sub txtSno_KeyPress(KeyAscii As Integer) If KeyAscii = 13 Then
txtDocument.SetFocus ElseIf KeyAscii = 27 Then txtLaot.SetFocus
End If End Sub
Private Sub txtWeight_KeyPress(KeyAscii As Integer) If KeyAscii = 13 Then
cmbUrgent.SetFocus ElseIf KeyAscii = 27 Then cmbType.SetFocus End If End Sub Sub ClearAll() txtLaot = "" txtSNo = "" txtDocument = "" cmbType.ListIndex = 0 txtWeight = "" cmbUrgent.ListIndex = 0
txtCharges = "" cmbCrDr.ListIndex = 0 grdDetails.Rows = 1 lstlaot.Clear cmbCompany.SetFocus End Sub
Private Sub cmbBoy_KeyPress(KeyAscii As Integer) If KeyAscii = 13 Then
cmdSearch.SetFocus ElseIf KeyAscii = 27 Then optSelected.SetFocus End If
End Sub
Private Sub cmbCompany_Click() Dim Rs As New ADODB.Recordset If Rs.State = adStateOpen Then Rs.Close
End If
If cmbCompany.ListCount > 0 Then
Rs.Open "select * from companyprofile where id=" &
cmbCompany.ItemData(cmbCompany.ListIndex), Con, adOpenKeyset If Rs.RecordCount > 0 Then
txtPhone = Rs!phone & "" txtMobile = Rs!mobile & "" txtAddress = Rs!address & "" txtState = Rs!State & "" txtcity = Rs!city & "" grdDetails.Rows = 1 Else txtPhone = "" txtMobile = "" txtAddress = "" txtState = "" txtcity = "" grdDetails.Rows = 1
End If End If End Sub
Private Sub cmbCompany_KeyPress(KeyAscii As Integer) If KeyAscii = 13 Then
optAll.SetFocus End If
End Sub
Private Sub cmdClear_Click() ClearAll
End Sub
Private Sub cmdExit_Click() Unload Me
End Sub
Private Sub cmdSearch_Click() Dim Rs As New ADODB.Recordset If Rs.State = adStateOpen Then Rs.Close
End If
grdDetails.Rows = 1
If optAll.Value = True Then
If cmbCompany.Text = "All" And cmbBoy.Text = "All" Then
Rs.Open "select companyprofile.company,staff.empname,delivery.* from companyprofile,Delivery,staff where sig='RTO' and staff.id=delivery.boyid and companyprofile.id=delivery.cid", Con, adOpenKeyset
Rs.Open "select companyprofile.company,staff.empname,delivery.* from companyprofile,Delivery,staff where sig='RTO' and staff.id=" &
cmbBoy.ItemData(cmbBoy.ListIndex) & " and delivery.boyid=" &
cmbBoy.ItemData(cmbBoy.ListIndex) & " and companyprofile.id=delivery.cid", Con, adOpenKeyset
ElseIf cmbCompany.Text <> "All" And cmbBoy.Text = "All" Then
Rs.Open "select companyprofile.company,staff.empname,delivery.* from companyprofile,Delivery,staff where sig='RTO' and staff.id=delivery.boyid and companyprofile.id=" & cmbCompany.ItemData(cmbCompany.ListIndex) & " and delivery.cid=" & cmbCompany.ItemData(cmbCompany.ListIndex), Con, adOpenKeyset
ElseIf cmbCompany.Text <> "All" And cmbBoy.Text <> "All" Then
Rs.Open "select companyprofile.company,staff.empname,delivery.* from companyprofile,Delivery,staff where sig='RTO' and staff.id=" &
cmbBoy.ItemData(cmbBoy.ListIndex) & " and delivery.boyid=" & cmbBoy.ItemData(cmbBoy.ListIndex) & " and companyprofile.id=" & cmbCompany.ItemData(cmbCompany.ListIndex) & " and delivery.cid=" & cmbCompany.ItemData(cmbCompany.ListIndex), Con, adOpenKeyset End If
ElseIf optSelected.Value = True Then
If cmbCompany.Text = "All" And cmbBoy.Text = "All" Then
Rs.Open "select companyprofile.company,staff.empname,delivery.* from companyprofile,Delivery,staff where sig='RTO' and staff.id=delivery.boyid and
companyprofile.id=delivery.cid and delivery.d_date between #" & dtpFrom.Value & "# and #" & dtpTo.Value & "#", Con, adOpenKeyset
ElseIf cmbCompany.Text = "All" And cmbBoy.Text <> "All" Then
Rs.Open "select companyprofile.company,staff.empname,delivery.* from companyprofile,Delivery,staff where sig='RTO' and staff.id=" &
cmbBoy.ItemData(cmbBoy.ListIndex) & " and companyprofile.id=delivery.cid and delivery.d_date between #" & dtpFrom.Value & "# and #" & dtpTo.Value & "#", Con, adOpenKeyset
ElseIf cmbCompany.Text <> "All" And cmbBoy.Text = "All" Then
Rs.Open "select companyprofile.company,staff.empname,delivery.* from companyprofile,Delivery,staff where sig='RTO' and staff.id=delivery.boyid and companyprofile.id=" & cmbCompany.ItemData(cmbCompany.ListIndex) & " and delivery.cid=" & cmbCompany.ItemData(cmbCompany.ListIndex) & " and
delivery.d_date between #" & dtpFrom.Value & "# and #" & dtpTo.Value & "#", Con, adOpenKeyset
ElseIf cmbCompany.Text <> "All" And cmbBoy.Text <> "All" Then
Rs.Open "select companyprofile.company,staff.empname,delivery.* from companyprofile,Delivery,staff where sig='RTO' and staff.id=" &
cmbBoy.ItemData(cmbBoy.ListIndex) & " and delivery.boyid=" & cmbBoy.ItemData(cmbBoy.ListIndex) & " and companyprofile.id=" & cmbCompany.ItemData(cmbCompany.ListIndex) & " and delivery.cid=" &
cmbCompany.ItemData(cmbCompany.ListIndex) & " and delivery.d_date between #" & dtpFrom.Value & "# and #" & dtpTo.Value & "#", Con, adOpenKeyset
End If End If If Rs.RecordCount > 0 Then For i = 0 To Rs.RecordCount - 1 grdDetails.Rows = grdDetails.Rows + 1 grdDetails.TextMatrix(grdDetails.Rows - 1, 0) = grdDetails.Rows - 1 grdDetails.TextMatrix(grdDetails.Rows - 1, 1) = Rs!company & "" grdDetails.TextMatrix(grdDetails.Rows - 1, 2) = Rs!d_date & "" grdDetails.TextMatrix(grdDetails.Rows - 1, 3) = Rs!empname & "" grdDetails.TextMatrix(grdDetails.Rows - 1, 4) = Rs!cno & "" grdDetails.TextMatrix(grdDetails.Rows - 1, 5) = Rs!dno & ""
grdDetails.TextMatrix(grdDetails.Rows - 1, 6) = Rs!FW & "" grdDetails.TextMatrix(grdDetails.Rows - 1, 7) = Rs!Party & "" grdDetails.TextMatrix(grdDetails.Rows - 1, 8) = Rs!amount & "" grdDetails.TextMatrix(grdDetails.Rows - 1, 9) = Rs!Type & "" Rs.MoveNext
Next End If End Sub
Private Sub dtpFrom_KeyDown(KeyCode As Integer, Shift As Integer) If KeyCode = 13 Then
dtpTo.SetFocus
ElseIf KeyCode = 27 Then optSelected.SetFocus End If
End Sub
Private Sub dtpTo_KeyDown(KeyCode As Integer, Shift As Integer) If KeyCode = 13 Then
cmbBoy.SetFocus ElseIf KeyCode = 27 Then dtpFrom.SetFocus End If
End Sub
Private Sub Form_Load()
Dim Rs As New ADODB.Recordset grdDetails.ColWidth(0) = 525
grdDetails.ColWidth(1) = 1400
grdDetails.TextMatrix(0, 1) = "company" grdDetails.ColWidth(2) = 1000
grdDetails.TextMatrix(0, 2) = "Date" grdDetails.ColWidth(3) = 1400
grdDetails.TextMatrix(0, 3) = "Boy Name" grdDetails.ColWidth(4) = 600
grdDetails.TextMatrix(0, 4) = "C.No." grdDetails.ColWidth(5) = 1000
grdDetails.TextMatrix(0, 5) = "Doc. No." grdDetails.ColWidth(6) = 1400
grdDetails.TextMatrix(0, 6) = "From Where" grdDetails.ColWidth(7) = 1400 grdDetails.TextMatrix(0, 7) = "Party" grdDetails.ColWidth(8) = 800 grdDetails.TextMatrix(0, 8) = "Amount" grdDetails.ColWidth(9) = 800 grdDetails.TextMatrix(0, 9) = "Type" grdDetails.Rows = 1 grdDetails.ColWidth(6) = 1095
grdDetails.TextMatrix(0, 6) = "Sig" If Rs.State = adStateOpen Then Rs.Close
End If
Rs.Open "select id,empname from staff order by empname", Con, adOpenKeyset If Rs.RecordCount > 0 Then
cmbBoy.AddItem "All"
For i = 0 To Rs.RecordCount - 1 cmbBoy.AddItem Rs!empname & "" cmbBoy.ItemData(i + 1) = Rs!id Rs.MoveNext Next cmbBoy.ListIndex = 0 End If
If Rs.State = adStateOpen Then Rs.Close
End If
Rs.Open "select id,company from companyprofile order by company", Con, adOpenKeyset
If Rs.RecordCount > 0 Then cmbCompany.AddItem "All" For i = 0 To Rs.RecordCount - 1
cmbCompany.AddItem Rs!company & "" cmbCompany.ItemData(i + 1) = Rs!id Rs.MoveNext Next cmbCompany.ListIndex = 0 End If dtpFrom.Value = Date
dtpTo.Value = Date End Sub Sub ClearAll() grdDetails.Rows = 1 cmbCompany.SetFocus End Sub
Private Sub optAll_Click() dtpFrom.Enabled = False dtpTo.Enabled = False End Sub
Private Sub optAll_KeyDown(KeyCode As Integer, Shift As Integer) If KeyCode = 13 Then
optSelected.SetFocus ElseIf KeyCode = 27 Then cmbCompany.SetFocus End If
End Sub
Private Sub optSelected_Click() dtpFrom.Enabled = True
dtpTo.Enabled = True End Sub
Private Sub optSelected_KeyDown(KeyCode As Integer, Shift As Integer) If KeyCode = 13 And dtpFrom.Enabled = False Then
cmbBoy.SetFocus
ElseIf KeyCode = 13 And dtpFrom.Enabled = True Then dtpFrom.SetFocus
ElseIf KeyCode = 27 Then optAll.SetFocus
End If End Sub
Private Sub cmbBank_Click() Dim Rs As New ADODB.Recordset If Rs.State = adStateOpen Then Rs.Close
End If
If cmbBank.ListCount > 0 Then
Rs.Open "select * from bankprofile where id=" &
cmbBank.ItemData(cmbBank.ListIndex), Con, adOpenKeyset If Rs.RecordCount > 0 Then
txtBPhone = Rs!phone & "" txtBMobile = Rs!mobile & "" txtBAddress = Rs!address & "" txtBState = Rs!State & "" txtBCity = Rs!city & ""
' grdDetails.Rows = 1 End If
End If End Sub
Private Sub cmbBank_KeyPress(KeyAscii As Integer) If KeyAscii = 13 Then
dtpPFM.SetFocus ElseIf KeyAscii = 27 Then cmbCompany.SetFocus End If
End Sub
Private Sub cmbCompany_Click() Dim Rs As New ADODB.Recordset If Rs.State = adStateOpen Then
Rs.Close End If
If cmbCompany.ListCount > 0 Then
Rs.Open "select * from companyprofile where id=" &
cmbCompany.ItemData(cmbCompany.ListIndex), Con, adOpenKeyset If Rs.RecordCount > 0 Then
txtPhone = Rs!phone & "" txtMobile = Rs!mobile & "" txtAddress = Rs!address & "" txtState = Rs!State & "" txtcity = Rs!city & ""
grdDetails.Rows = 1 End If
End If End Sub
Private Sub cmbCompany_KeyPress(KeyAscii As Integer) If KeyAscii = 13 Then
cmbBank.SetFocus End If
End Sub
Private Sub cmbPN_KeyPress(KeyAscii As Integer) Dim Rs As New ADODB.Recordset
If KeyAscii = 13 And Val(txtSno) = 0 Then If Trim(txtCNo) = "" Then
Exit Sub End If
grdDetails.TextMatrix(grdDetails.Rows - 1, 0) = grdDetails.Rows - 1 grdDetails.TextMatrix(grdDetails.Rows - 1, 1) = Format(dtpDate.Value, "dd MMM yyyy") grdDetails.TextMatrix(grdDetails.Rows - 1, 2) = Trim(txtCNo) grdDetails.TextMatrix(grdDetails.Rows - 1, 3) = Trim(txtWeight) grdDetails.TextMatrix(grdDetails.Rows - 1, 4) = Trim(txtStation) grdDetails.TextMatrix(grdDetails.Rows - 1, 5) = Trim(txtAmount) grdDetails.TextMatrix(grdDetails.Rows - 1, 6) = Trim(txtToStation) grdDetails.TextMatrix(grdDetails.Rows - 1, 7) = Trim(txtPOD) grdDetails.TextMatrix(grdDetails.Rows - 1, 8) = Trim(cmbUrgent.Text) grdDetails.TextMatrix(grdDetails.Rows - 1, 9) = Trim(cmbPN.Text)
Con.Execute "insert into pfm
(cid,bid,datepfm,currentdate,sno,weight,station,amount,tostation,pod,urgent,PN) values (" & Val(cmbCompany.ItemData(cmbCompany.ListIndex)) & "," &
Val(cmbBank.ItemData(cmbBank.ListIndex)) & ",#" & dtpPFM.Value & "#,#" &
dtpDate.Value & "#,'" & Trim(txtCNo) & "'," & Val(txtWeight) & ",'" & Trim(txtStation) & "'," & Val(txtAmount) & ",'" & Trim(txtToStation) & "','" & Trim(txtPOD) & "','" & Trim(cmbUrgent.Text) & "','" & Trim(cmbPN.Text) & "')"
If Rs.State = adStateOpen Then Rs.Close
End If
Rs.Open "select max(id) as max_ID from pfm", Con, adOpenKeyset If Rs.RecordCount > 0 Then grdDetails.RowData(grdDetails.Rows - 1) = Rs!max_id End If txtSno = "" txtCNo = "" txtWeight = "" txtStation = ""