Escolar Documentos
Profissional Documentos
Cultura Documentos
S.No.
I
II
III
IV
V
VI
1.
Table of Contents
Remarks
Cover Page
Certificate Of Approval
Preface
Acknowledgement
Declaration
Contents
Index
Introduction Existing System without Software
Problem Definition
Proposed System
2.
3.
4.
5.
6.
7.
Note : -
Page No.
(1)
i
ii
iii
iv
v
vi
INTRODUCTIO
(2)
(3)
Technology Details
(4)
(5)
clipboard and to the information in most other window application running at the
same line.
So Visual Basic is a collection of files. It is a very easy language and
flexible to use. This language also contains all the features of basic language. It is
an event driven programming. It is also called a friend of a user. One of the
advantages of visual basic is that it is a grammar free language. It provides both
compiler and interpreter.
Visual basic system knows all about event handling procedures. It knows
what a button is and how it works. It also knows how to handle images, menus,
dialog boxes, driven and directory lists, and much else. The programmers job is to
determine where, how and when an object appears on screen, what its caption
reads and what happens when an event occurs. The event might be the opening of a
form, the user clicking on a box. The programmer does not have to write code to
trap these events the system does that automatically. Because the program code
runs in response to event, as at any point whole range of event might be possible.
The flow of execution is not as fixed as in a traditional program.
Visual Basic is the most Popular Object Oriented event Driven Programming
language. It revolves around readymade objects, and it is event driven i.e. all
the activities in a program are triggered by one event or another .The main
advantage of visual Programming languages is that we can concentrate on
what we want our program to do, not how to get the programming language
to do it. Some Visual Basic features are: 1/ Compatibility: Visual Basic is capable of producing software as sophisticated
as any other data access techniques available.
2/ Flexibility: It not only provides database access but can also be used to link it
with other word processor, spreadsheets software etc.
3/ Familiarity: Because it can be said as an extended version of Basic, which is
very easy to learn and work with, its syntax seems to be more familiar.
4/ Features: Various Additional Features like ADO reports and other various
types of Active X controls are supported by this application, which helps
widely in development of the Project.
MICROSOFT ACCESS
The goal of the access is to help you get your work done in the least of time,
with a minimum of effort.
What type of application can you develop in Access?
Microsoft Access offers a variety of features for different databases needs. It
can be used to develop five general type of application:
1.
Personal application.
(7)
2.
3.
4.
5.
About Ms Access This is a Backend Tool widely used for Personal Computer as a Data Base.
The relational database is a well-defined theoretical model of working with and
managing a set of data that attends to three specific things:
Data Structure, Data integrity and Data manipulation .The MS Access has
a distinct component, which adheres to these requirements. The basic Data
Structure in Access is Table having fixed number of columns but variable rows.
The Data integrity rules of the relational models can be defined within Access
relationship using integrity constraints. When a table is created in Access the
integrity rule is defied at that very time.
MS Access has many important features that make it not only an exceptional
database Management System but also an excellent database for personal system
in windows environment,
-
(8)
(9)
Hardware: Microprocessor
Setup of
regular backup
setup
MS
Display
CGA/VGA or higher.
Key Board
Mouse
Printer
80/132 cols.
MS Windows 95 or Higher
RDBMS
MS Access
( 10 )
GUI Tool
SYSTEM ANALYSIS
System Analysis
A system is a set or arrangement of functionally dependent component or
working together to attain a predefined goal by processing information. It is the
process of examine of a business situation with the intent of improving it through
( 11 )
( 12 )
E-R DIAGARAM
( 13 )
DATABASE DESIGN
SNAP SHOTS
LOGIN FORM
BILLING REPORT
SOURCE CODE
LOGIN FORM
Private Sub cmdOK_Click()
Dim i As Integer
If txtPassword = "pass" And txtUserName.Text = "user" Then
LoginSucceeded = True
Unload Me
mdifrm.Show
Else
MsgBox "Invalid user name or Password, try again!", , "Login"
Me.txtUserName = ""
Me.txtPassword = ""
txtUserName.SetFocus
End If
End Sub
PURCHASE FORM
Private Sub cmdadd_Click()
Dim rs As New ADODB.Recordset
rs.Open "insert into purchase values ( '" & dtp.Value & "','" & txtpur.Text & "','" &
txtice.Text + "'," & txtquantity.Text & "," & Val(txtuprice.Text) & "," &
Val(lbltprice.Caption) & "," & txtsprice.Text & ")", dbcon, 2, 3
MsgBox "saved successfully", vbInformation, "saved"
Me.dtp.Value = Date
cmdclear_Click
End Sub
Private Sub cmdclear_Click()
Me.dtp.Value = Date
Me.txtquantity.Text = ""
Me.txtsprice.Text = ""
Me.txtice.Text = ""
Me.txtuprice.Text = ""
Me.lbltprice.Caption = ""
End Sub
Private Sub Form_Load()
Dim rs As New ADODB.Recordset
rs.Open "select * from purchase", dbcon, 2, 3
If rs.RecordCount = 0 Then
Me.txtpur.Text = "enter record here"
Else
rs.MoveFirst
For i = 1 To rs.RecordCount
Me.txtpur.AddItem rs.Fields(1)
rs.MoveNext
Next
End If
dtp.Value = Date
End Sub
Private Sub Image2_Click()
Unload Me
End Sub
Private Sub Timer1_Timer()
If Me.dtp.Value = "" Or Me.txtpur.Text = "" Or Me.txtsprice.Text = "" Or
Me.txtuprice.Text = "" Or Me.txtice.Text = "" Then
Me.cmdadd.Enabled = False
Else
Me.cmdadd.Enabled = True
End If
End Sub
Private Sub txtice_KeyPress(KeyAscii As Integer)
If KeyAscii >= 97 And KeyAscii <= 122 Then
KeyAscii = KeyAscii - 32
End If
End Sub
Private Sub txtpur_KeyPress(KeyAscii As Integer)
If KeyAscii >= 97 And KeyAscii <= 122 Then
KeyAscii = KeyAscii - 32
End If
End Sub
Private Sub txtquantity_Change()
If IsNumeric(Me.txtquantity.Text) = True Then
Me.lbltprice.Caption = Val(Me.txtquantity.Text) * Val(Me.txtuprice.Text)
Exit Sub
Else
Me.txtquantity.Text = ""
End If
End Sub
Private Sub txtuprice_Change()
If
IsNumeric(Me.txtuprice.Text) = True Then
Me.lbltprice.Caption = Val(Me.txtquantity.Text) * Val(Me.txtuprice.Text)
Else
Me.txtuprice.Text = ""
End If
End Sub
SALE FORM
Function SpellNumber(ByVal MyNumber)
Dim Rupees, Paise, Temp
Dim DecimalPlace, Count
ReDim Place(9) As String
Place(2) = " Thousand "
Place(3) = " Lakh "
Place(4) = " Crore "
MyNumber = Trim(Str(MyNumber))
DecimalPlace = InStr(MyNumber, ".")
If DecimalPlace > 0 Then
Paise = GetTens(Left(Mid(MyNumber, DecimalPlace + 1) & _
"00", 2))
MyNumber = Trim(Left(MyNumber, DecimalPlace - 1))
End If
Count = 1
Do While MyNumber <> ""
If Count <> 1 Then
Temp = GetHundreds(Right(MyNumber, 2))
If Temp <> "" Then Rupees = Temp & Place(Count) & Rupees
If Len(MyNumber) > 2 Then
MyNumber = Left(MyNumber, Len(MyNumber) - 2)
Else
MyNumber = ""
End If
Else
Temp = GetHundreds(Right(MyNumber, 3))
If Temp <> "" Then Rupees = Temp & Place(Count) & Rupees
If Len(MyNumber) > 3 Then
MyNumber = Left(MyNumber, Len(MyNumber) - 3)
Else
MyNumber = ""
End If
End If
Count = Count + 1
Loop
Select Case Rupees
Case ""
Rupees = " "
Case "One"
Rupees = "Re One "
Case Else
Rupees = "Rupees " & Rupees
End Select
Select Case Paise
Case ""
Paise = " Zero Paise "
Case "One"
Paise = " and Paise One"
Case Else
Paise = "Paise " & Paise
End Select
If Rupees <> " " Then Paise = " and " & Paise
SpellNumber = " [ " & Rupees & Paise & " Only ] "
End Function
Function GetHundreds(ByVal MyNumber)
Dim Result As String
If Val(MyNumber) = 0 Then Exit Function
MyNumber = Right("000" & MyNumber, 3)
If Mid(MyNumber, 1, 1) <> "0" Then
Result = GetDigit(Mid(MyNumber, 1, 1)) & " Hundred "
End If
End If
End Sub
Private Sub cmdshow_Click()
If Me.txtcust.Text = "" Then
MsgBox "Enter customer name", vbCritical, "requirment"
Me.txtcust.SetFocus
Else
Set rs = New ADODB.Recordset
rs.Open "select * from temp", dbcon, 2, 3
Dim i As Integer
Set itm = Me.ListView1.ListItems
For Each itm In ListView1.ListItems
rs.AddNew
rs.Fields("date").Value = Me.dtp.Value
rs.Fields("bil_no").Value = Me.lblbillno.Caption
rs.Fields("customer_name").Value = Me.txtcust.Text
rs.Fields("ice_name").Value = itm.Text
rs.Fields("quantity").Value = itm.SubItems(1)
rs.Fields("unit_price").Value = itm.SubItems(2)
rs.Fields("total_price").Value = itm.SubItems(3)
rs.Fields("in_words").Value = Me.lblinwords.Caption
rs.Update
Next
'MsgBox "saved !"
frmgif.Show 1
Me.Timer1.Enabled = False
Me.cmdremove.Enabled = False
Me.cmdshow.Visible = False
Me.cmdshow2.Visible = True
Me.cmdprint.Enabled = True
If DataEnvironment1.rsdadd.State = 1 Then DataEnvironment1.rsdadd.Close
report_bill.Refresh
report_bill.Show
End If
End Sub
Private Sub cmdshow2_Click()
report_bill.Show
End Sub
Private Sub Form_Load()
Me.Timer1.Enabled = True
Me.cmdprint.Enabled = False
Me.cmdshow.Visible = True
Me.cmdshow2.Visible = False
End Sub
Private Sub Timer2_Timer()
If Me.lblbal.Caption = "0" Then
Me.lblbal.Caption = "nil"
End If
If Me.txtpaid.Text = "" Then
Me.lblbal.Caption = "nil"
End If
End Sub
Private Sub txtcust_KeyPress(KeyAscii As Integer)
If KeyAscii >= 97 And KeyAscii <= 122 Then
KeyAscii = KeyAscii - 32
End If
End Sub
Private Sub txtpaid_Change()
If IsNumeric(Me.txtpaid.Text) = True Then
Me.lblbal.Caption = Val(Me.lblgrandtotal.Caption) - Val(Me.txtpaid.Text)
Else
Me.txtpaid.Text = ""
End If
If Val(Me.txtpaid.Text) > Val(Me.lblgrandtotal.Caption) Then
MsgBox "Entered amount should be less then grand total", vbInformation, "cant accept"
Me.txtpaid.Text = ""
End If
End Sub
Private Sub txtquan_Change()
If IsNumeric(Me.txtquan.Text) = True Then
Me.lbltprice.Caption = Val(Me.txtquan.Text) * Val(Me.lbluprice.Caption)
If Val(Me.txtquan.Text) > Val(Me.lblquan.Caption) Then
MsgBox "please enter quantity less then available quantity !", vbInformation, "info"
Me.txtquan.Text = ""
Else
Exit Sub
End If
Else
Me.txtquan.Text = ""
End If
End Sub
MAINTAINS FORM
Private Sub cmbbill_Click()
On Error Resume Next
Me.cmdupdate2.Enabled = True
Me.txttpaid.Enabled = True
Me.txttpaid.Text = ""
Me.lblubal.Caption = ""
Dim rs As New ADODB.Recordset
rs.Open "select * from sales where bill_no=" & Me.cmbbill.Text, dbcon, 2, 3
Me.cmbcustname.Text = rs!customer_name
Me.lbltotal.Caption = rs!grand_total
Me.lblpaid.Caption = rs!paid
Me.lblbal.Caption = rs!balance
End Sub
Private Sub cmbcustname_Click()
On Error Resume Next
Me.cmdupdate2.Enabled = True
Me.txttpaid.Enabled = True
Me.txttpaid.Text = ""
Me.lblubal.Caption = ""
Dim rs As New ADODB.Recordset
rs.Open "select * from sales where customer_name='" & Me.cmbcustname.Text & "'",
dbcon, 2, 3
Me.cmbbill.Text = rs!bill_no
Me.lbltotal.Caption = rs!grand_total
Me.lblpaid.Caption = rs!paid
Me.lblbal.Caption = rs!balance
End Sub
Private Sub cmbstone_Click()
Me.cmdupdate2.Enabled = True
Dim rs As New ADODB.Recordset
rs.Open "select * from purchase where ice_name ='" & Me.cmbstone.Text & "'", dbcon, 2, 3
If rs.RecordCount = 0 Then
Me.txtuprice.Text = "no record"
Else
'Me.txtuprice.Text = rs!selling_price
Me.txtpur.Text = rs!purchasing_from
Me.txtquantity.Text = rs!quantity
Me.txtsprice.Text = rs!price_to_sell
Me.txtuprice.Text = rs!unit_price
Me.dtp.Value = rs!Date
Me.lbltprice.Caption = rs!total_price
End If
End Sub
Private Sub cmdelete2_Click()
End Sub
Private Sub cmddelete2_Click()
n = MsgBox("sure to delete " + Me.cmbcustname.Text + "'s record", vbYesNo, "sure")
If n = vbNo Then
Me.cmddelete2.Cancel = True
Else
Dim rs As New ADODB.Recordset
rs.Open "delete * from credit where bill_no=" & Me.cmbbill.Text, dbcon, 2, 3
rs.Open "delete * from sales where bill_no=" & Me.cmbbill.Text, dbcon, 2, 3
Me.cmbbill.Text = ""
Me.cmbcustname.Text = ""
Me.lblbal.Caption = ""
Me.lblpaid.Caption = ""
Me.lbltotal.Caption = ""
Me.txttpaid.Text = ""
Me.lblubal.Caption = ""
MsgBox "record deleted", vbInformation, "info"
Me.cmbbill.Clear
Me.cmbcustname.Clear
Form_Load
Me.Frame2.Visible = True
Me.frame1.Visible = False
End If
End Sub
Private Sub cmdelete_Click()
n = MsgBox("sure to delete record " + Me.cmbstone.Text, vbYesNo, "sure")
If n = vbNo Then
Me.cmdelete.Cancel = True
Else
Dim rs As New ADODB.Recordset
rs.Open " delete * from purchase where ice_name='" & Me.cmbstone.Text & "'", dbcon, 2, 3
Me.txtpur.Text = ""
Me.txtquantity.Text = ""
Me.txtsprice.Text = ""
Me.txtuprice.Text = ""
Me.lbltprice.Caption = ""
MsgBox "record deleted", vbInformation, "info"
Me.cmbstone.Clear
Form_Load
Me.frame1.Visible = True
Me.Frame2.Visible = False
End If
End Sub
Private Sub cmddelete_Click()
End Sub
Private Sub cmdexit2_Click()
End Sub
Private Sub cmdupdate_Click()
Dim rs As New ADODB.Recordset
rs.Open "select * from purchase where ICE_name ='" & Me.cmbstone.Text & "'", dbcon, 2,
3
rs("date") = Me.dtp.Value
rs("purchasing_from") = Me.txtpur.Text
rs("ice_name") = Me.cmbstone.Text
rs("quantity") = Val(Me.txtquantity.Text)
rs("unit_price") = Val(Me.txtuprice.Text)
rs("total_price") = Val(Me.lbltprice.Caption)
rs("price_to_sell") = Val(Me.txtsprice.Text)
rs.Update
rs.Close
MsgBox "updated", vbInformation, "information"
Me.txtpur.Text = ""
Me.txtquantity.Text = ""
Me.txtsprice.Text = ""
Me.txtuprice.Text = ""
Me.lbltprice.Caption = ""
Me.cmbstone.SetFocus
End Sub
Private Sub cmdupdate2_Click()
Dim rs As New ADODB.Recordset
rs.Open "select * from sales where bill_no=" & Me.cmbbill.Text, dbcon, 2, 3
rs("balance") = Val(Me.lblubal.Caption)
rs("paid") = Val(Me.lblpaid.Caption) + Val(Me.txttpaid.Text)
rs.Update
rs.Close
Dim rs1 As New ADODB.Recordset
rs1.Open "insert into credit values(" & Me.cmbbill.Text & ",'" & Me.cmbcustname.Text &
"','" & Me.dtp2.Value & "'," & Me.txttpaid.Text & "," & Val(Me.lblubal.Caption) & ")",
dbcon, 2, 3
MsgBox "updated successfully", vbInformation, "info"
Me.cmbbill.Text = ""
Me.cmbcustname.Text = ""
Me.lblbal.Caption = ""
Me.lblpaid.Caption = ""
Me.lbltotal.Caption = ""
Me.txttpaid.Text = ""
Me.lblubal.Caption = ""
Me.cmbbill.SetFocus
End Sub
Private Sub Command2_Click()
n = MsgBox("sure to delete " + Me.cmbcustname.Text + "'s record", vbYesNo, "sure")
If n = vbNo Then
Me.cmddelete2.Cancel = True
Else
Me.cmbbill.AddItem rs.Fields(1)
rs.MoveNext
Next
rs.Close
End If
Me.dtp2.Value = Date
Me.dtp.Value = Date
End Sub
Private Sub Image2_Click()
Unload Me
End Sub
Private Sub Optbal_Click()
Me.Frame2.Visible = True
Me.frame1.Visible = False
End Sub
Private Sub Optstock_Click()
Me.frame1.Visible = True
Me.Frame2.Visible = False
End Sub
Private Sub Timer2_Timer()
If Me.lblpaid.Caption = "" Or Me.txttpaid.Text = "" Or Me.cmbbill.Text = "" Or
Me.cmbcustname.Text = "" Then
Me.cmdupdate2.Enabled = False
Else
Me.cmdupdate2.Enabled = True
End If
If Me.lblpaid.Caption = "" Or Me.cmbbill.Text = "" Or Me.cmbcustname.Text = "" Then
Me.cmddelete2.Enabled = False
Else
Me.cmddelete2.Enabled = True
End If
If Me.dtp.Value = "" Or Me.txtpur.Text = "" Or Me.txtquantity.Text = "" Or
Me.txtsprice.Text = "" Or Me.txtuprice.Text = "" Then
Me.cmdupdate.Enabled = False
Me.cmdelete.Enabled = False
Else
Me.cmdupdate.Enabled = True
Me.cmdelete.Enabled = True
End If
If Me.lblbal.Caption = "0" Then
Me.lblbal.Caption = "nill"
Me.cmdupdate2.Enabled = False
Me.txttpaid.Enabled = False
End If
If Me.txttpaid.Text = "" Then
Me.lblubal.Caption = ""
End If
End Sub
Private Sub txtpur_KeyPress(KeyAscii As Integer)
If KeyAscii >= 97 And KeyAscii <= 122 Then
KeyAscii = KeyAscii - 32
End If
End Sub
Private Sub txtquantity_Change()
If IsNumeric(Me.txtquantity.Text) = True Then
Me.lbltprice.Caption = Val(Me.txtquantity.Text) * Val(Me.txtuprice.Text)
Exit Sub
Else
Me.txtquantity.Text = ""
End If
End Sub
Private Sub txttpaid_Change()
If IsNumeric(Me.txttpaid.Text) = True Then
Me.lblubal.Caption = Val(Me.lblbal.Caption) - Val(Me.txttpaid.Text)
If Val(Me.txttpaid.Text) > Val(Me.lblbal.Caption) Then
MsgBox "please enter paid amount less then balance !", vbInformation, "info"
Me.txttpaid.Text = ""
Me.lblubal.Caption = ""
Else
Exit Sub
End If
Else
Me.txttpaid.Text = ""
End If
End Sub
CONCLUSION
Conclusion :Designed system provides an easy way to interact with user and
administrator. This GUI based system gives a system with less paper
work and less memory overhead. It is also a fast and interactive
system.
BIBLIOGRAPHY
BIBLIOGRAPHY:
1/ Mr. Steven Holzner, Visual Basic 6 Programming (Black Book), 2006
edition, Dreamtech Press, New Delhi, 2002.
2/ Mr. Soma dasgupta, Visual Basic project, 2002 edition, BPB Publication,
New Delhi.
3/ Mastering in Visual Basic
2/ Mr. Soma Dasgupta, Visual Basic project, 2002 edition, BPB Publication,
New Delhi
3/ Mr. Evangelos Petroutsos, Mastering in Visual Basic 6.0, BPB Publication,
New Delhi
The following are the minimum requirement for the smooth and successful
running of the module.