You are on page 1of 53

PRO1ECT REPORT ON

SALES ORDER PROCESSING


Submitted to the UNIVERSITY OF MADRAS
In partial fulfillment of the requirements and for the degree of
MASTER OF COMPUTER APPLICATIONS
By
K.VENKATA RAO
(Reg.No.MC91693)
DEPARTMENT OF COMPUTER SCIENCE
MOHAMED SATHAK COLLEGE OF ARTS & SCIENCE
CHENNAI-6000119
NOVEMBER 2001.
CERTIFICATE
Department of Computer Science
Mohamed Sathak College Of Arts and Science
This is to certify that the Project Work entitled
SALES ORDER PROCESSING
Submitted by
K.VENKATA RAO.
(Reg.No.MC91693)
in partial fulfillment for the award of Master degree of Computer applications
from the University of Madras, for the academic year 2001-02 was done under
my guidance and that this Project represents the Original work.
Signature of the Candidate Internal examinar
External Examiner Head of the department
1. ........
2. .........
2
ACKNOWLEDGEMENTS
I express my deep sense of gratitude and thanks to principal
Dr.Major 1ailani M.Sc., M.Phil.M.A. DH Ed., PhD., for providing all
the necessary facilities in the college for the successful completion of this
project.
I express my sincere thanks to the Head of the department of Mr.
N.R. Alamelu B.E (Hons). M.E, who gave extra support and guidance
in all matters to complete this project.
With pleasure I express my esteemed gratitude to the staff members of
compute applications that put up with me during the whole period and
provided me valuable guidance in times of need.
(VENKATA RAO.K.)
(REG NO: MC91693)
3

CONTENTS

Particulars Page No
1. ABSTRACT 5
2. INTRODUCTION 6
3. PRO1ECT DESCRIPTION 8
4. SYSTEM REQUIREMENTS 9
5. LANGUAGE DESCRIPTION 10
6. DATAFLOW DIAGRAMS 13
7. DATABASE STRUCTURE 17
8. FORMS 19
9. REPORTS 27
10. CONCLUSION 32
11. BIBLIOGRAPHY 33
4

ABSTRACT
The project entitled ~SALES ORDER PROCESSING has been
designed and developed for any Electrical and Electronics Enterprises or any
other.
The main aim of this project is to computerization of daily activities in
the enterprise. It is a database system for creating a selective related information,
for subsequent analysis manipulation and application.
This project contains several modules to record the details about the
Product, Customer details, Order details and Bill details about the goods which
the Customer has purchased from the enterprise. And it maintains the reports
about the Products, Customers,Orders and Bills. This project is very useful to sale
the goods in any enterprise.
5

INTRODUCTION
The project entitled ~SALES ORDER PROCESSING has been
designed and developed for any Electrical and Electronics Enterprises or any
other.
The main aim of this project is to computerization of daily activities in
the enterprise. It is a database system for creating a selective related information,
for subsequent analysis manipulation and application.
The system has different modules for various activities. The various
modules of the system are recording of new
products(addition,modification,deletion), maintaining the Customer details,
maintaining the Order details from the Customer and recording the Bill details of
goods which was purchased by the Customer.
Each module is designed for each activity that should be recorded every
time. Using this system the management can record easily and stored in the
database. Retrieving the old records also made easy in this system. So that the
management can retrieve the records and make use of them.
The database system is developed perfectly which does not allow the user
to enter the wrong data hence it facilitate the management. This database
management is developed for retrieving records with correct records so that it is
reliable. Implimentation of this system requires the use of computers with most
versatile system. Hence, this software is developed on MS-Windows platform using
Visual Basic 6.0
This package is easy to use for recording the events of enterprise. It is
very simple in its creation and all the user-friendly facilities are provided. Messages
are given whenever there is a need. Special care has been made for data integrity
and security, in addition the authorization is also given. This system of
computerization is to ameliorate and make more advantages than the existing
system by being..
Recoding the details about the Products
Maintaining the Customer details
Recording the Order details
6
Maintaining the Bill details

Need for computerization :-
To keep all the details of each Product
To avoid mistakes when the record entry was done
To take personal care of each Customer
To analysis for the future development of enterprise
For time saving purpose
To study of each product quality
To maintain the reports
The unique micro computer server is used to maintain the database in MS-
ACCESS with VISUAL BASIC as front-end tool. The reason for choosing this
package, Visual Basic is because of utilization of graphical interface facility and
also of event-driven property.
7
PRO1ECT DESCRIPTION

The SALES ORDER PROCESSING is developed for the daily sales
that are going in the particular firm or an Enterprize.

This was developed by using VISUAL BASIC 6.0 as the front-end and
MS-ACCESS as the back-end.
The major kind of transactions that are being carried in SALES
ORDER PROCCESSING are..
PRODUCT DETAILS
CUSTOMER DETAILS
ORDERS DETAILS
BILLS DETAILS
REPORTS
PRODUCT DETAILS :-
Pcode,desc,companme,capacity,cost,items_available
CUSTOMER DETAILS :-
Ccode,cname,addr,phone,pin
ORDER DETAILS :-
Ordno,order_date,customer_code,pcode,company_name.quantity_ordered,
amount
BILLS DETAILS :-
Receipt_no,order_no,receipt_date,type(cash or cheque),amount_paid,
discount,total_amount,cheque_no,cheque_date,bank_name
REPORTS
8

SYSTEM REQUIREMENTS
HARDWARE REQUIREMENTS :-
Processor : Pentium III
Hard Disk : 1.2 GB
RAM : 64 MB
Monitor : Color
SOFTWARE REQUIREMENTS:-
Operating System : Windows 95/98/NT
Front End : Visual Basic 6.0
Back End : Microsoft Access
9
LANGUAGE DESCRIPTION
Visual Basic is a much-enhanced version of the BASIC Programming
Language and the BASIC Integrated developed Environment (IDE). The
bottom line of the enhancement is the VB can create Windows Programs
where BASIC could only create DOS programs. The modifications are very
major, but the idea holds true that Visual Basic is BASIC for Windows. One
of the many significant improvements is that VB provides massive support for
easily creating the user interface to your applications.

This is accomplished within the VB Integrated Development
Environment (IDE), in which you use a Mouse to ~draw out application and
use the keyboard to type in the code that is to be executed.When writing a VB
program, almost always create the user interface ~shell before writing any
code at all. This approach, made so simple by the VB IDE, allows the
developer to evaluate how the user will interact with the program. It is
possible to create the initial version of the shell in just hours. It`s a much
better way to program than to create pieces of the interface (and the
corresponding code) as you go. It especially is beneficial the developer can
demonstrate to the user just exactly what they will see, and you can do it early
enough in the development cycle to prevent costly iterations late in the cycle.
The single largest effect on coding that VB introduced was the
concept of an event-driven programming model. In the old BASIC you had to
writer code to watch for the occurrence of user events (pressing a key, using
the mouse,). VB performs that function for you, and in fact, the only time
code will execute in VB in response to such an event! And finally, the major
concept that VB has incorporated is the concept of objects. Object provides a
way to link together both code and data into a package in such a way as to
make handling and saving the code data more intuitively. VB forms are
objects, menus are objects, and so are the intrinsic VB controls. VB has
also provided a wide variety of built-in-code that programmer once had to
handle himself or herself. Of most significance is the built-in database
handling features of VB. It is generally accepted that over half of all VB
applications are written to handle databases you will find the built in database
features of VB to be very powerful, and that you can tape into at whatever
level of programming skill you possess.

A second area in which VB has begun to provide built in support is
that of Internet access. The VB features are still maturing, but will the tool
available the develop can create very useful applications. Critical Visual
10
Basic elements although visual basic has grown into a fairly complex
programming tool, it is
still the case that a programmer can pretty much ignore all of the
capabilities he doesn`t need (or understand) and still create very useful
applications. But, no matter how much a beginner, or how advanced you are,
still some fundamental areas in which you must be proficient to become a VB
programmer.
While starting VB, you will see a group of windows that are
known as the VB IDE (integrated development environment). As a
programmer you will get used to the IDE and spend a fair amount of time
exploring the menu Options that the IDE provides. Pay close attention to the
Keyboard shortcuts that are available. While in the IDE, You`ll find the
keyboard shortcuts invaluable in writing your program quickly.
The second aspect of VB, which programmers of skill levels will
have in common, is the VB language itself. Every visual basic application will
consist of controls, usually a lot of them, the availability of controls (built-in,
or controls you can purchase) is the single biggest reason why VB has reached
the level of popularity that it currently enjoy. Because controls represents
hundreds (if not thousands) of hours of manpower to come up with full
featured, debugged code which the programmer can reuse in your program,
controls are the easily the most cost effective, and the most time effective way
that a VB programmer has to add features to his program. Bottom line is
that any good programmer must be an export at handling controls, once the
programmer has mastered the intrinsic controls, learning new controls
becomes very straightforward.
Because VB has moved to the event-driven model of programming,
the last critical VB topic is events. Events are not very complicated but
concept is significantly different than the old styled linear programming of the
original BASIC. Simply put, when a VB program is started it sits and waits
for an event to occur. The event can be key pressed by the user or the
movement of a mouse. Either way, the VB programming model is that your
program will execute the code associated with that event. So the job as a
programmer is to basically create the code, which you program executes in
response to those events.
11
MS ACCESS FEATURES :-

Introduction
Microsoft Access appeared out of nowhere at the end of 1992 to
rapidly become the database of choice for Windows based database development.
Access is a relational database designed for the modern Windows environment, it
does not carry the baggage and pre-Windows design history of earlier database
system (such as FoxPro, Microsoft`s other database system). Access is now in its
fifth major incarnation (versions 1.0, 2.0, 95, 97 and now 2000) and just keeps on
going better.

What`s new about working with data and database design?
Microsoft Access 2000 provides many new features that make working with
data and designing a database even easier.
Use record-level locking :- A Microsoft Access database now
supports record-level locking, in addition to page-level locking (which locks all
records on a 4k page). You enable the locking level with the new database option,
Open database using record leel locking (!ools menu, Option command, "danced
Tab), The actual level that is used depends on how the Access database is
programmed.
Find and replace :- You can now move freely between the Find
and Replace dialog boxes and the data in the view or window
View related data in a sub datasheet :- Use a sub datasheet to
view and edit related or joined data in a table, query, or form datasheets , or in a
suborn all from the same view. For example, in the North wind sample database
the Customers table has a one-to-many relationship with the Products table; so
for each row of the Customer table in Datasheet view, you can view and edit the
related rows of the Products table in a sub datasheet.
Automatically fix errors caused by renaming fields :-
Name Auto Correct automatically corrects common side effects that occur when
you rename forms, reports, tables, queries, fields, text boxes or other controls.
12
Take advantage of Unicode support :- Use the characters of
any language that Unicode supports in your data. Use Unicode compression to
offset the effect of Unicode`s increased storage space requirements.


DATAFLOW DIAGRAMS
Dataflow diagram is a representation in which overall description of a
system can be shown in the form of a diagram. The description of the system will start from
the source of the content and with its destination. The diagram can be devided many
different stages and each stage must give information about the system.
The dataflow diagram can be devided into two levels. The first stage
gives the brief pictorial overall description of the system. This will be containing user
input, process and the destination. The source and the destination must be in the sqare
box and the process will be in the circle. This level shown in bellow diagrams.
13
END-USER
PROCES
S
STORAGE
OF
DATA
14
END-USER
PRODUCT
DETAILS

CUSTOMER
DETAILS
ORDER
DETAILS
BILLS
DETAIL
S
PRODUC
T
CUSTOMER ORDE
R
BILLS
REPORTS
PRODUCT

PROCESSING
DATA
REPORTS
15
CUSTOMER

PROCESSING
DATA
REPORTS
ORDERS

PROCESSING
DATA
REPORTS
16
BILLS

PROCESSING
DATA
REPORTS
DATABASE STRUCTURE
PRODUCT TABLE :-
Field Name Data Type Description
Pcode IntegerI Product Number
Desc Text Description
Compname Text Company Name
Capacity Double Capacity of the product
Cost Currency Cost of the product
Items_available Integer Items available in shop
CUSTOMER TABLE :-
Field Name Data Type Description
Ccode Integer Customer code
Cname Text Customer Name
Phone Double Customer phone number
Addr Text Customer address
Pin Double Customer pincode
CORDER TABLE :-
Field Name Data Type Description
Ordno Double Order Number
Order_date Date Order Date
Cust_code Integer Customer Code
Product_code Double Product Code
Company_name Text Company name of product
Capacity_type Text Capacity of the product
Quantity_ordered Double Quantity ordered
Cost Currency Cost of the product
Paid Text Cash paid or not
Flag Integer Flag number
17
RECEIPT TABLE :-
Field Name Data Type Description
Rno Double Receipt Number
Ordno Integer Order number
Receipt_date Date Receipt date
Type Text Type of the payment
AMOUNT TABLE :-
Field Name Data Type Description
Receipt_no Double Receipt Number
Amount_paid Currency Amount paid
Discount Currency Discount given
Total_amount Currency Total amount paid
Cheque_no Double Cheque Number
Cheque_date Date Cheque date
Bank_name Text Bank Name
18
FORMS
19
20
21
22
23
24
25
26
27
REPORTS
28
29
30
31


CONCLUSION

From this projrct we can understand it is more efficient and easy to use and
advantageous of a computerization of the Enterprise. In this ,people who are using this
project are no need to maintain different record books to record the daily sales activities.
This project facilitates the user to maintain the records with out fear of misreport of
Events. This enhances speed of updating, adding,deleting,retrieval and more accurate
results.

32
BIBLIOGRAPHY
1. GARY CORNELL., VISUAL BASIC 6 FORM THE GROUND UP
TATA Mc GRAW-HILL EDITION.

2. VISUAL BASIC FOR DUMMIES, published by PUSHTAK MAHAL
3. VISUAL BASIC FOR APPLICATIONS, published byPRENTICE HALL OF INDIA
4. TEACH YOURSELF VISUAL BASIC, published by BPB PUBLICATIONS
5. PROGRAMMING IN VISUAL BASIC, published by BPB PUBLICATIONS
6. 1AMES A.SENN., SYSTEM ANALYSIS AND DESIGN
TATA Mc GRAW-HILL EDITION

33
Main menu:-
Dim s As String
Private Sub Command1_Click()
frmProd.Show
End Sub
Private Sub Command2_Click()
frmCust.Show
End Sub
Private Sub Command3_Click()
ordform.Show
End Sub
Private Sub Command4_Click()
frmReceipt.Show
End Sub
Private Sub Command5_Click()
End
End Sub
Private Sub Command6_Click()
Form2.Show
End Sub
Product_details_form:-
Public db As Database
Public rs As Recordset
Public rs1 As Recordset
Public comp As Recordset
Public rlist As Recordset
Public p1 As Recordset
Public p2 As Recordset
Public p3 As Recordset
Private Sub mv()
Text1.Text rs(0)
Text2.Text rs(1)
Text3.Text rs(2)
Text4.Text rs(3)
Text5.Text rs(4)
Text6.Text rs(5)
'Text7.Text rs(6)
'Text8.Text rs(7)
End Sub
Private Sub Command1_Click()
Unload Me
Form1.WindowState 2
Form1.Show
End Sub
Private Sub Command10_Click()
List2.clear
List2.Visible True
rs.MoveFirst
While Not rs.EOF
List2.AddItem (rs(0))
34
rs.MoveNext
Wend
Command2.Enabled False
End Sub
Private Sub Command11_Click()
Text1.Text ""
Text2.Text ""
Text3.Text ""
Text4.Text ""
Text5.Text ""
Text6.Text ""
End Sub
Private Sub Command12_Click()
Set rlist db.OpenRecordset("select ` from product where int(pcode)'" & Val(List2.Text) & "'", dbOpenDynaset)
rlist.Edit
rlist("capacity") Text4.Text
rlist("items_available") Text5.Text
rlist("cost") Text6.Text
rlist.Update
MsgBox "RECORDS HAS BEEN MODIFIED", vbExclamation
rlist.Close
Command12.Enabled False
End Sub
Private Sub Command2_Click()
Set rs1 db.OpenRecordset("select max(pcode)+1 from product", dbOpenDynaset)
Text1.Text rs1(0)
rs.AddNew
End Sub
Private Sub Command3_Click()
If Text1.Text "" Then
MsgBox "please enter the product code"
Command2.SetFocus
ElseIf Text2.Text "" Then
MsgBox "please enter product description "
Text2.SetFocus
ElseIf Text3.Text "" Then
MsgBox "please enter product company anme "
Text3.SetFocus
ElseIf Text4.Text "" Then
MsgBox "please enter product capacity "
Text4.SetFocus
ElseIf Text5.Text "" Then
MsgBox "please enter the cost "
Text5.SetFocus
ElseIf Text6.Text "" Then
MsgBox "please enter the items available"
Text6.SetFocus
Else
rs("pcode") Text1.Text
rs("desc") Text2.Text
rs("compname") Text3.Text
rs("capacity") Text4.Text
rs("cost") Text5.Text
rs("items_available") Text6.Text
rs.Update
MsgBox "Record is saved"
Command2.Enabled True
Command3.Enabled True
End If
End Sub
Private Sub Command4_Click()
35
Dim rlist As Recordset
Set rlist db.OpenRecordset("select ` from product where int(pcode)'" & Val(List2.Text) & "'", dbOpenDynaset)
Text1.Text rlist("pcode")
Text2.Text rlist("desc")
Text3.Text rlist("compname")
Text4.Text rlist("capacity")
Text5.Text rlist("items_available")
Text6.Text rlist("cost")
rlist.Delete
rlist.Close
'rs.Edit
'rs.Update
MsgBox "record was deleted"
End Sub
Private Sub Command5_Click()
Command2.Enabled False
Command3.Enabled False
Command4.Enabled False
List1.clear
List1.Visible True
rs.MoveFirst
While Not rs.EOF
List1.AddItem (rs(0))
rs.MoveNext
Wend
End Sub
Private Sub Command6_Click()
rs.MoveFirst
Call mv1
End Sub
Private Sub Command7_Click()
rs.MoveNext
If rs.EOF True Then
rs.MovePrevious
MsgBox "Last Record", vbExclamation
End If
Call mv1
End Sub
Private Sub Command8_Click()
rs.MovePrevious
If rs.BOF True Then
rs.MoveFirst
MsgBox "First Record", vbExclamation
End If
Call mv1
End Sub
Private Sub Command9_Click()
rs.MoveLast
Call mv1
End Sub
Private Sub Form_Load()
Set db OpenDatabase("A:\sales.mdb")
Set rs db.OpenRecordset("select ` from product", dbOpenDynaset)
List1.Visible False
List2.Visible False
Command2.Enabled True
Command3.Enabled False
Command4.Enabled False
Command5.Enabled False
Command12.Enabled False
36
End Sub
Private Sub mv1()
Text1.Text rs(0)
Text2.Text rs(1)
Text3.Text rs(2)
Text4.Text rs(3)
Text5.Text rs(5)
Text6.Text rs(4) End Sub
Private Sub List1_Click()
Set rlist db.OpenRecordset("select ` from product where int(pcode)'" & Val(List1.Text) & "'", dbOpenDynaset)
Text1.Text rlist("pcode")
Text2.Text rlist("desc")
Text3.Text rlist("compname")
Text4.Text rlist("capacity")
Text6.Text rlist("cost")
Text5.Text rlist("items_available")
rlist.Close
End Sub
Private Sub List2_Click()
Set rlist db.OpenRecordset("select ` from product where int(pcode)'" & Val(List2.Text) & "'", dbOpenDynaset)
Text1.Text rlist("pcode")
Text2.Text rlist("desc")
Text3.Text rlist("compname")
Text4.Text rlist("capacity")
Text6.Text rlist("cost")
Text5.Text rlist("items_available")
rlist.Close
Command11.Enabled True
Command3.Enabled False
Command4.Enabled False
Command5.Enabled False
Command2.Enabled False
List1.Visible False
Text1.Enabled False
Text2.Enabled False
Text3.Enabled False
Text4.SetFocus
Command4.Enabled False
List2.Visible False
RESPONSE InputBox("DO U WANT TO MODIFY (OR) DELETE (ENTER 1/2)", vbOKOnly)
If RESPONSE "1" Then
Command3.Enabled False
MsgBox "RE-ENTER THE FIELDS WHAT EVER U WANT TO MODIFY"
Command5.Enabled False
Command4.Enabled False
Command12.Enabled True
MsgBox "AFTER ENTERING THE VALUES PRESS THE UPDATE BUTTON"
ElseIf RESPONSE "2" Then
MsgBox "IF U WANT TO DELETE THEN PRESS THE DELETE BUTTON", vbOKCancel
If vbOK Then
Command12.Enabled False
Command5.Enabled False
Command4.Enabled True
Else
Command4.Enabled False
End If
End If
End Sub
Customer_details_form:-
Dim db As Database
Dim rs As Recordset
37
Dim rs1 As Recordset
Dim rlist As Recordset
Public Sub mov()
txtcustcode.Text rs("ccode")
txtcname.Text rs("cname")
txtPhone.Text rs("phone")
txtaddr.Text rs("addr")
txtpin.Text rs("pin")
End Sub
Private Sub BACK_Click()
Unload Me
db.Close
Form1.WindowState 2
Form1.Show
End Sub
Private Sub cmdAdd_Click()
cmdAdd.Enabled False
Command1.Enabled False
Set rs1 db.OpenRecordset("select max(ccode)+1 from customer", dbOpenDynaset)
txtcustcode.Text rs1(0)
rs.AddNew
txtcname.Text ""
txtaddr.Text ""
txtpin.Text ""
txtPhone.Text ""
txtcustcode.Enabled True
txtcname.Enabled True
txtaddr.Enabled True
txtpin.Enabled True
txtPhone.Enabled True
txtcname.SetFocus
rs1.Close
cmdSave.Enabled True
End Sub
Private Sub cmdEdit_Click()
Set rlist db.OpenRecordset("customer", dbOpenDynaset)
rlist.Edit
rlist("ccode") txtcustcode.Text
rlist("cname") txtcname.Text
rlist("phone") txtPhone.Text
rlist("addr") txtaddr.Text
rlist("pin") txtpin.Text
rlist.Update
MsgBox "Record has been modified", vbExclamation
rlist.Close
cmdEdit.Enabled False
End Sub
Private Sub cmdSave_Click()
If txtcustcode "" Then
MsgBox "please add customer code"
Command1.SetFocus
ElseIf txtcname "" Then
MsgBox "please enter name "
txtcname.SetFocus
ElseIf txtaddr "" Then
MsgBox "please enter address "
txtaddr.SetFocus
ElseIf txtpin "" Then
MsgBox "please enter pin "
txtpin.SetFocus
ElseIf txtPhone "" Then
38
MsgBox "please enter phone no "
txtPhone.SetFocus
Else
rs("ccode") txtcustcode.Text
rs("cname") txtcname.Text
rs("phone") txtPhone.Text
rs("addr") txtaddr.Text
rs("pin") txtpin.Text
rs.Update
MsgBox "Record is saved"
cmdAdd.Enabled True
Command1.Enabled True
End If
End Sub
Private Sub Command1_Click()
cmdAdd.Enabled False
cmdSave.Enabled False
List1.clear
List1.Visible True
rs.MoveFirst
While Not rs.EOF
List1.AddItem CStr(rs(0)) & " " & rs(1)
rs.MoveNext
Wend
End Sub
Private Sub Command2_Click()
txtcustcode.Text ""
txtcname.Text ""
txtaddr.Text ""
txtpin.Text ""
txtPhone.Text ""
cmdAdd.Enabled True
cmdEdit.Enabled False
Command3.Enabled False
End Sub
Private Sub Command3_Click()
Dim s1 As Integer
s1 InputBox("ENTER THE CUSTOMER NUMBER", "DELETE")
Dim rs1 As Recordset
Set rs1 db.OpenRecordset("select ` from customer where int(ccode)'" & Int(s1) & "'", dbOpenDynaset)
txtcustcode.Text rs1("ccode")
txtcname.Text rs1("cname")
txtPhone.Text rs1("phone")
txtaddr.Text rs1("addr")
txtpin.Text rs1("pin")
'rs1.Close
RESPONSE MsgBox("ARE YOU SURE DO U WANT TO DELETE THE RECORD", vbOKCancel, "DELETE")
If RESPONSE vbOK Then
rs1.Delete
'rs1.Update
rs1.Close
'rs.Edit
'rs.Update
MsgBox "the entered record was deleted"
Command1.Enabled False
Else
Command1.Enabled False
End If
End Sub
Private Sub Form_Load()
Set db OpenDatabase("D:\sales\sales.mdb")
39
Set rs db.OpenRecordset("customer", dbOpenDynaset)
End Sub
Private Sub List1_Click()
txtcustcode.Enabled False
txtcname.Enabled False
txtaddr.SetFocus
Set rlist db.OpenRecordset("select ` from customer where int(ccode)'" & Val(List1.Text) & "'", dbOpenDynaset)
txtcustcode.Text rlist("ccode")
txtcname.Text rlist("cname")
txtPhone.Text rlist("phone")
txtaddr.Text rlist("addr")
txtpin.Text rlist("pin")
rlist.Close
List1.Visible False
cmdEdit.Enabled True
Command3.Enabled True
RESPONSE InputBox("DO U WANT TO MODIFY (OR) DELETE (ENTER 1/2)", vbOKOnly)
If RESPONSE "1" Then
Command3.Enabled False
MsgBox "RE-ENTER THE FIELDS WHAT EVER U WANT TO MODIFY"
MsgBox "AFTER ENTERING THE VALUES PRESS THE MODIFY BUTTON"
ElseIf RESPONSE "2" Then
MsgBox "IF U WANT TO DELETE THEN PRESS THE MODIFY BUTTON", vbOKCancel
If vbOK Then
Command3.Enabled True
cmdEdit.Enabled False
Else
Command3.Enabled False
End If
End If
End Sub
Private Sub txtaddr_KeyPress(KeyAscii As Integer)
If (KeyAscii > 65 And KeyAscii < 90) Or (KeyAscii > 97 And KeyAscii < 122) Or KeyAscii 8 Then
Exit Sub
Else
KeyAscii 0
End If
End Sub
Private Sub txtcname_KeyPress(KeyAscii As Integer)
If (KeyAscii > 65 And KeyAscii < 90) Or (KeyAscii > 97 And KeyAscii < 122) Or KeyAscii 8 Then
Exit Sub
Else
KeyAscii 0
End If
End Sub
Private Sub txtPhone_KeyPress(KeyAscii As Integer)
If (KeyAscii > 47 And KeyAscii < 59) Or KeyAscii 8 Then
Exit Sub
Else
KeyAscii 0
End If
End Sub
Private Sub txtpin_KeyPress(KeyAscii As Integer)
If (KeyAscii > 47 And KeyAscii < 59) Or KeyAscii 8 Then
Exit Sub
Else
KeyAscii 0
End If
End Sub
Order_details:-
Public db As Database
40
Public rs As Recordset
Public rs1 As Recordset
Public prod As Recordset
Public cust As Recordset
Public comp As Recordset
Public cp As Recordset
Public f As Recordset
Private Sub Command2_Click()
Dim fg As Integer
Set f db.OpenRecordset("select max(flag)+1 from corder", dbOpenDynaset)
fg f(0).Value
f.Close
Dim i As Integer
rs.AddNew
rs(0) Text1.Text
rs(1) Text2.Text
rs(2) Text3.Text
rs(3) Text4.Text
rs(4) Text5.Text
rs(5) Text6.Text
rs(6) Text7.Text
rs(7) Text8.Text
rs(8) "n"
rs(9) fg
rs.Update
Command2.Enabled False
i MsgBox("Record Saved, Do U Wish to order another item ?", vbYesNo)
If i vbNo Then
Command1.Enabled True
Text1.Enabled True
Text2.Enabled True
Text3.Enabled True
Else
Command1.Enabled False
Text1.Enabled True
Text2.Enabled False
Text3.Enabled False
Set rs1 db.OpenRecordset("select max(ordno)+1 from corder", dbOpenDynaset)
Text1.Text rs1(0).Value
Text4.SetFocus
rs1.Close
Text4.Text ""
Text5.Text ""
Text6.Text ""
Text7.Text ""
Text8.Text ""
End If
End Sub
Private Sub Command3_Click()
Unload Me
db.Close
Form1.WindowState 2
Form1.Show
End Sub
Private Sub Command1_Click()
Dim v As Recordset
Text1.Enabled True
Text2.Enabled True
Text3.Enabled True
Text1.Text ""
Text2.Text ""
41
Text3.Text ""
Text4.Text ""
Text5.Text ""
Text6.Text ""
Text7.Text ""
Text8.Text ""
Set rs1 db.OpenRecordset("select max(ordno)+1 from corder", dbOpenDynaset)
'Set rs1 db.OpenRecordset(v, dbOpenDynaset)
Text1.Text rs1(0).Value
Text2.SetFocus
rs1.Close
Command1.Enabled False
End Sub
Private Sub Command4_Click()
rs.MoveFirst
Call mv
End Sub
Private Sub Command5_Click()
rs.MovePrevious
If rs.BOF True Then
rs.MoveFirst
MsgBox "First Record", vbExclamation
End If
Call mv
End Sub
Private Sub Command6_Click()
rs.MoveNext
If rs.EOF True Then
rs.MovePrevious
MsgBox "Last Record", vbExclamation
End If
Call mv
End Sub
Private Sub Command7_Click()
rs.MoveLast
Call mv
End Sub
Private Sub Form_Load()
Set db OpenDatabase("D:\sales\sales.mdb")
Set rs db.OpenRecordset("corder", dbOpenDynaset)
End Sub
Private Sub List1_Click()
Text3.Text List1.Text
Text4.SetFocus
List1.Visible False
End Sub
Private Sub List2_Click()
Text4.Text Val(List2.Text)
Text5.SetFocus
List2.Visible False
End Sub
Private Sub List3_Click()
Text5.Text List3.Text
Text6.SetFocus
List3.Visible False
End Sub
Private Sub List4_Click()
Text6.Text List4.Text
List4.clear
Text7.SetFocus
List4.Visible False
42
End Sub
Private Sub Text2_gotfocus()
If Text1.Text "" Then
Command1.SetFocus
MsgBox " add receipt no"
Else
Text2.Text Format(Date, "dd/mm/yyyy")
Text3.SetFocus
End If
End Sub
Private Sub Text2_lostfocus()
List1.Visible True
Label10.Visible True
List1.clear
Set cust db.OpenRecordset("select ccode from customer", dbOpenDynaset)
cust.MoveFirst
While Not cust.EOF
List1.AddItem CStr(cust(0))
cust.MoveNext
Wend
cust.Close
End Sub
Private Sub Text3_lostfocus()
If Text1.Text "" Then
MsgBox "Add orderno"
End If
End Sub
Private Sub Text4_gotfocus()
List2.Visible True
List2.clear
Label10.Visible False
Label11.Visible True
Set prod db.OpenRecordset("select pcode,desc from product", dbOpenDynaset)
prod.MoveFirst
While Not prod.EOF
List2.AddItem CStr(prod(0)) & " " & prod(1)
prod.MoveNext
Wend
prod.Close
End Sub
Private Sub Text5_gotfocus()
List3.Visible True
List3.clear
Label11.Visible False
Label12.Visible True
Set comp db.OpenRecordset("select distinct(compname) from product where int(pcode)'" & Val(Text4.Text) & "'",
dbOpenDynaset)
comp.MoveFirst
While Not comp.EOF
List3.AddItem comp(0)
comp.MoveNext
Wend
comp.Close
End Sub
Private Sub Text6_gotfocus()
List4.Visible True
List4.clear
Label12.Visible False
Label13.Visible True
Set cp db.OpenRecordset("select capacity,cost from product where int(pcode)'" & Val(Text4.Text) & "' and compname '" &
Text5.Text & "'", dbOpenDynaset)
43
cp.MoveFirst
While Not cp.EOF
List4.AddItem cp(0)
cp.MoveNext
Wend
cp.Close
End Sub
Private Sub Text7_GotFocus()
Label13.Visible False
End Sub
Private Sub Text7_KeyPress(KeyAscii As Integer)
If (KeyAscii > 47 And KeyAscii < 59) Or KeyAscii 8 Then
Exit Sub
Else
KeyAscii 0
End If
End Sub
Private Sub Text7_LostFocus()
Dim cp1 As Recordset
Set cp1 db.OpenRecordset("select cost from product where int(pcode)'" & Val(Text4.Text) & "' and compname '" & Text5.Text
& "'", dbOpenDynaset)
Text8.Text Val(Text7.Text) ` cp1(0)
cp1.Close
Command2.Enabled True
Command2.SetFocus
End Sub
Private Sub mv()
Text1.Text rs(0)
Text2.Text rs(1)
Text3.Text rs(2)
Text4.Text rs(3)
Text5.Text rs(4)
Text6.Text rs(5)
Text7.Text rs(6)
Text8.Text rs(7)
End Sub
Private Sub Text8_KeyPress(KeyAscii As Integer)
If (KeyAscii > 47 And KeyAscii < 59) Or KeyAscii 8 Then
Exit Sub
Else
KeyAscii 0
End If
End Sub
Bills_details:-
Dim db As Database
Dim r As Recordset
Dim a As Recordset
Dim o As Recordset
Dim auto As Recordset
Dim lst As Recordset
Dim lst1 As Recordset
Dim lst2 As Recordset
Private Sub Combo2_click()
If Combo2.Text "Cash" Then
Label6.Visible True
Label7.Visible True
Label8.Visible True
Label9.Visible False
Label10.Visible False
Label11.Visible False
Text3.Visible True
44
Text4.Visible True
Text5.Visible True
Text6.Visible False
Text7.Visible False
Text8.Visible False
Text3.SetFocus
Else
Label6.Visible False
Label7.Visible False
Label8.Visible False
Label9.Visible True
Label10.Visible True
Label11.Visible True
Text3.Visible False
Text4.Visible False
Text5.Visible False
Text6.Visible True
Text7.Visible True
Text8.Visible True
Text6.SetFocus
End If
End Sub
Private Sub Command1_Click()
clear
Label6.Visible False
Label7.Visible False
Label8.Visible False
Label9.Visible False
Label10.Visible False
Label11.Visible False
Text3.Visible False
Text4.Visible False
Text5.Visible False
Text6.Visible False
Text7.Visible False
Text8.Visible False
Set auto db.OpenRecordset("select max(rno)+1 from receipt", dbOpenDynaset)
If auto.BOF False And auto.EOF False Then
Text1.Text auto(0).Value
Else
Text1.Text 1
End If
auto.Close
Command1.Enabled False
Command2.Enabled True
'Text9.SetFocus
End Sub
Private Sub Command2_Click()
If Text1.Text "" Then
MsgBox " please add receipt no"
Command1.SetFocus
ElseIf Text9.Text "" Then
MsgBox "please select order no"
Text9.SetFocus
ElseIf text2.Text "" Then
MsgBox "please select capacity"
text2.SetFocus
ElseIf Combo2.Text "" Then
MsgBox "please select type"
Combo2.SetFocus
Else
45
r.AddNew
a.AddNew
a(0) Text1.Text
r(0) Text1.Text
r(1) Text9.Text
r(2) Format(CDate(text2.Text), "dd/mm/yyyy")
r(3) Combo2.Text
If Combo2.Text "Cash" Then
If Text3.Text "" Then
MsgBox "please enter amount"
Text3.SetFocus
ElseIf Text4.Text "" Then
MsgBox "please enter discount"
Text4.SetFocus
Text5.Text ""
Else
a(1) Text3.Text
a(2) Text4.Text
a(3) Text5.Text
a(4) 0
a(5) 0
a(6) "nil"
Set lst1 db.OpenRecordset("select ` from corder where int(ordno) '" & Val(Text9.Text) & "'", dbOpenDynaset)
lst1.Edit
lst1("paid") "y"
lst1.Update
lst1.Close
r.Update
a.Update
MsgBox "Record Saved", vbExclamation
Command1.Enabled True
List1.Visible False
Label12.Visible False
Command2.Enabled False
End If
Else
If Text6.Text "" Then
MsgBox "please enter check no"
Text6.SetFocus
ElseIf Text7.Text "" Then
MsgBox " please enter check date properly"
Text7.SetFocus
ElseIf Text8.Text "" Then
MsgBox " please enter bank name"
Text8.SetFocus
Else
a(1) 0
a(2) 0
a(3) 0
a(4) Text6.Text
a(5) Text7.Text
a(6) Text8.Text
Set lst2 db.OpenRecordset("select paid from corder where int(ordno) '" & Val(Text9.Text) & "'", dbOpenDynaset)
lst2.Edit
lst2("paid") "y"
lst2.Update
lst2.Close
r.Update
a.Update
MsgBox "Record Saved", vbExclamation
Command1.Enabled True
46
List1.Visible False
Label12.Visible False
End If
End If
End If End Sub
Private Sub Command3_Click()
Unload Me
db.Close
Form1.WindowState 2
Form1.Show
End Sub
Private Sub Form_Load()
Set db OpenDatabase("D:\sales\sales.mdb")
Set r db.OpenRecordset("select ` from receipt", db, dbOpenDynamic)
Set a db.OpenRecordset("select ` from amount", db, dbOpenDynaset)
Combo2.AddItem "Cash"
Combo2.AddItem "Cheque"
End Sub
Private Sub List1_Click()
Text9.Text List1.Text
text2.Text Format(Date, "dd/mm/yyyy")
List1.Visible False
Combo2.SetFocus
End Sub
Private Sub Text3_gotfocus()
Set lst1 db.OpenRecordset("select ` from corder where int(ordno) '" & Val(Text9.Text) & "'", dbOpenDynaset)
Text3.Text lst1("cost")
Text4.SetFocus
lst1.Close
End Sub
Private Sub Text4_KeyPress(KeyAscii As Integer)
If (KeyAscii > 47 And KeyAscii < 59) Or KeyAscii 8 Then
Exit Sub
Else
KeyAscii 0
End If
End Sub
Private Sub Text6_KeyPress(KeyAscii As Integer)
If (KeyAscii > 47 And KeyAscii < 59) Or KeyAscii 8 Then
Exit Sub
Else
KeyAscii 0
End If
End Sub
Private Sub Text7_LostFocus()
If IsDate(Text7.Text) False Then
MsgBox " Enter in the date(dd/mm/yyyy)"
Text7.Text ""
Text7.SetFocus
Else
If Format(CDate(Text7.Text), "DD/MM/YYYY") > CDate(text2.Text) Then
MsgBox "Cheque date must not be greater than Receipt date", vbExclamation
Text7.Text ""
Text7.SetFocus
End If
End If
End Sub
Private Sub Text8_KeyPress(KeyAscii As Integer)
If (KeyAscii > 65 And KeyAscii < 90) Or (KeyAscii > 97 And KeyAscii < 122) Or (KeyAscii 8 And KeyAscii 32) Then
Exit Sub
Else
47
KeyAscii 0
End If
End Sub
Private Sub text9_gotfocus()
List1.Visible True
Label12.Visible True
List1.clear
Set o db.OpenRecordset("select ordno from corder where paid'n'", dbOpenDynaset)
If o.BOF False And o.EOF False Then
o.MoveFirst
While Not o.EOF
List1.AddItem CStr(o(0))
o.MoveNext
Wend
Else
Text1.Text ""
MsgBox "All the orders have been paid", vbExclamation
End If
o.Close
End Sub
Private Sub Text4_lostfocus()
Text5.Text Val(Text3.Text) - Val(Text4.Text)
'Command2.SetFocus
End Sub
Private Sub clear()
Combo2.Text ""
Text1.Text ""
text2.Text ""
Text3.Text ""
Text4.Text ""
Text5.Text ""
Text6.Text ""
Text7.Text ""
Text8.Text ""
Text9.Text ""
End Sub
Reports:-
Private Sub Command1_Click()
DataReport1.Refresh
DataReport1.Show
End Sub
Private Sub Command2_Click()
DataReport3.Refresh
DataReport3.Show
End Sub
Private Sub Command3_Click()
DataReport2.Refresh
DataReport2.Show
End Sub
Private Sub Command4_Click()
DataReport4.Refresh
DataReport4.Show
End Sub
Private Sub Command5_Click()
Unload Me
Form1.WindowState 2
Form1.Show
End Sub
Private Sub Label2_Click()
Unload Me
48
Form1.Show
End Sub
49
50
51
52
53

You might also like