Download

Download

Featured Posts

Featured Articles
All Stories

stock management coding in vb


uploaded by Prof Ms Saranya Devi

Public Class Form1

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
If TextBox1.Text = "admin" And TextBox2.Text = "1234" Then
Timer1.Enabled = True

Else
MsgBox("INVALID USER")
End If

End Sub

Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Timer1.Tick
If ProgressBar1.Value < ProgressBar1.Maximum Then
ProgressBar1.Value = ProgressBar1.Value + 5
If ProgressBar1.Value = ProgressBar1.Maximum Then
Form2.Show()
Me.Hide()

End If
Else
Timer1.Enabled = False
ProgressBar1.Value = 0
End If

End Sub
End Class

Public Class Form2

Private Sub PurchaseToolStripMenuItem_Click(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles PurchaseToolStripMenuItem.Click
Form3.Show()

End Sub

Private Sub StockToolStripMenuItem_Click(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles StockToolStripMenuItem.Click
Form4.Show()

End Sub

Private Sub SalesToolStripMenuItem_Click(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles SalesToolStripMenuItem.Click
Form5.Show()

End Sub

Private Sub SalesToolStripMenuItem1_Click(ByVal sender As System.Object,

ByVal e As System.EventArgs) Handles SalesToolStripMenuItem1.Click
Form6.Show()

End Sub

Private Sub StockToolStripMenuItem1_Click(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles StockToolStripMenuItem1.Click
Form8.Show()

End Sub

Private Sub SalesToolStripMenuItem2_Click(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles SalesToolStripMenuItem2.Click
Form7.Show()

End Sub
End Class

Public Class Form3
Dim db As New ADODB.Connection
Dim rs As New ADODB.Recordset
Private Sub Form3_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
db.Open(" Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Documents
and Settings\pc\Desktop\project.mdb")

rs.Open("select * from purchase", db, 3, 2)
End Sub

Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Timer1.Tick
TextBox5.Text = Date.Today
End Sub

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
insertdata()
insertdata1()
TextBox1.Clear()

TextBox2.Clear()
TextBox3.Clear()
TextBox4.Clear()
TextBox6.Clear()

TextBox1.Focus()

End Sub
Private Sub insertdata()
If rs.State = 1 Then
rs.Close()
rs.Open("select * from purchase", db, 3, 2)
rs.AddNew()

rs.Fields(0).Value
rs.Fields(1).Value
rs.Fields(2).Value
rs.Fields(3).Value
rs.Fields(4).Value
rs.Fields(5).Value
rs.UpdateBatch()

=
=
=
=
=
=

Val(TextBox1.Text)
TextBox2.Text
Val(TextBox3.Text)
Val(TextBox4.Text)
Date.Today
Val(TextBox6.Text)

End If
End Sub
Private Sub insertdata1()
If rs.State = 1 Then
rs.Close()
rs.Open("select * from stock", db, 3, 2)
rs.AddNew()
rs.Fields(0).Value = Val(TextBox1.Text)
rs.Fields(1).Value = TextBox2.Text
rs.Fields(2).Value = Val(TextBox3.Text)
rs.Fields(3).Value = Val(TextBox4.Text)
rs.Fields(4).Value = Date.Today
rs.UpdateBatch()
End If
End Sub

Private Sub TextBox6_TextChanged(ByVal sender As System.Object, ByVal e
As System.EventArgs) Handles TextBox6.TextChanged
TextBox6.Text = Val(TextBox3.Text) * Val(TextBox4.Text)

End Sub

Private Sub TextBox3_TextChanged(ByVal sender As System.Object, ByVal e
As System.EventArgs) Handles TextBox3.TextChanged

End Sub
End Class

Public Class Form4
Dim db As New ADODB.Connection
Dim rs As New ADODB.Recordset
Private Sub Form4_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
db.Open("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Documents
and Settings\pc\Desktop\project.mdb")
rs.Open("select * from purchase", db, 3, 2)
Do
ComboBox1.Items.Add(rs.Fields(1).Value)
rs.MoveNext()
Loop While rs.EOF = False
End Sub

Private Sub ComboBox1_SelectedIndexChanged(ByVal sender As System.Object,

ByVal e As System.EventArgs) Handles ComboBox1.SelectedIndexChanged
If rs.State = 1 Then
rs.Close()

rs.Open("select * from stock where itmname='" & ComboBox1.Text &
"'", db, 3, 2)

If rs.RecordCount
TextBox1.Text
TextBox2.Text
TextBox3.Text
TextBox4.Text
End If

>
=
=
=
=

0 Then
rs.Fields(0).Value
rs.Fields(2).Value
rs.Fields(3).Value
rs.Fields(4).Value

End If
End Sub

Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Timer1.Tick
TextBox4.Text = Date.Today
End Sub
End Class

Public Class Form5
Dim db As New ADODB.Connection
Dim rs As New ADODB.Recordset
Private Sub Label1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Label1.Click

End Sub

Private Sub Label6_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Label6.Click

End Sub

Private Sub Form5_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
db.Open("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Documents
and Settings\pc\Desktop\project.mdb")
rs.Open("select * from stock", db, 3, 2)
Do
ComboBox1.Items.Add(rs.Fields(1).Value)
rs.MoveNext()
Loop While rs.EOF = False
End Sub
Private Sub insertdata()
If rs.State = 1 Then
rs.Close()
rs.Open("select * from sales", db, 3, 2)
rs.AddNew()

rs.Fields(0).Value
rs.Fields(1).Value
rs.Fields(2).Value
rs.Fields(3).Value
rs.Fields(4).Value
rs.Fields(5).Value

rs.UpdateBatch()

=
=
=
=
=
=

Val(TextBox1.Text)
ComboBox1.Text
Val(TextBox2.Text)
Val(TextBox3.Text)
Val(TextBox4.Text)
Date.Today

End If
End Sub
Private Sub updatefun(ByVal x As String)
Dim st As Integer
If rs.State = 1 Then
rs.Close()
rs.Open("select * from stock where itmname='" & ComboBox1.Text &
"'", db, 3, 2)

If rs.RecordCount > 0 Then
st = rs.Fields(2).Value
st = st - Val(x)
rs.Fields(2).Value = Val(st)
rs.Update()
MsgBox("data is updated")
End If

End If
End Sub

Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Timer1.Tick
TextBox5.Text = Date.Today
End Sub

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click

insertdata()

updatefun(TextBox2.Text)

TextBox1.Clear()

TextBox2.Clear()
TextBox3.Clear()
TextBox4.Clear()
TextBox1.Focus()
End Sub

Private Sub TextBox4_TextChanged(ByVal sender As System.Object, ByVal e
As System.EventArgs) Handles TextBox4.TextChanged
TextBox4.Text = Val(TextBox3.Text) * Val(TextBox2.Text)

End Sub

Private Sub ComboBox1_SelectedIndexChanged(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles ComboBox1.SelectedIndexChanged
If rs.State = 1 Then
rs.Close()

rs.Open("select * from stock where itmname='" & ComboBox1.Text &
"'", db, 3, 2)

If rs.RecordCount > 0 Then
TextBox1.Text = rs.Fields(0).Value

TextBox3.Text = rs.Fields(3).Value
TextBox4.Text = rs.Fields(4).Value
End If

End If
End Sub
End Class


spl thanks to Ms Saranya Devi Prof
3:15 PM - By Reetha 0

0 comments:

Labels

AI PROJECTS (8) ALL DEPT (42) BCA (22) BE (13) BSC (20) BTECH (17) C PROJECTS (4) C#.NET (19) C++ PROJECTS (2) CHEMISTRY (3) CIVIL (25) CSE (94) DIPLOMA (22) DOWNLOADS (60) ECE (37) EEE (39) FINAL YEAR PROJECTS (30) HOW TO (58) HTML PROJECTS (4) IEEE PROJECTS (108) IT (85) MATLAB PROJECTS (8) MBA (1) mca (73) ME (19) mech (4) MINI PROJECTS (97) MSC (17) MTECH (18) MYSQL PROJECTS (6) NETWORK PROJECTS (7) OTHER PROJECTS (67) OTHERS (28) PAPER PRESENTATION (4) PG (18) PHP PROJECTS (7) PROJECTS (5) SOURCE CODES (22) SYSTEM PROJECTS (15) UG (17) VB PROJECTS (15) WHITE PAPER (19)

Blog Archive

Total Pageviews

Discussion

Followers

Powered by Blogger.
back to top
Don't Forget To Join US Our Community
×