Log inUsernamePassword
Log me on automatically each visit    
Register
Register
Log in to check your private messages
Log in to check your private messages
Visual Basic Forum for Visual Basic Programmers VB Forum Index » Database & Reporting

Post new topic   Reply to topic
Inventory System...Pls help
View previous topic :: View next topic  
Author Message
Wil
Newbie


Joined: 25 Aug 2005
Posts: 9

PostPosted: Sep 14th, 2005 01:28 AM    Post subject: Inventory System...Pls help Reply with quote

Pls help...
I need to create a inventory system with contains a sales form and order form in my system.The following is show that about the order form that i have created.After i insert the data and it will insert into a table name the Orders.But i have the problem is after i insert the data into the order form and it will appear in an order pending list,after the product have been received from supplier and it will has a button called mark as delivery.After i click with that button and a msg box will come out and ask to enter the quantity product have been accept.But the problem is...let say i have order about 100 product x and 100 product y from supplier z.Then the form will in order pending area.When the supplier send the product coming and it oso send about 50 product x and 50 product y!After i insert the quantity in that msg box and normally it is no complete with that order (still less 50 product x and product y) but after i insert quantity in that msg box and all information in that order will not record in that order pending again.Could anyone know this problem???Pls kindly to help...
The following is show about the order vb form:
Code:

Public prod_total As Integer

Private Sub cmddel_Click()
If rs.RecordCount = 0 Then Exit Sub
If MsgBox("Do you really want to delete order #" & ORDERlist1.SelectedItem.Text & "?", vbYesNo, "") = vbYes Then
cnn.Execute "delete from orders where orders.orderno = " & ORDERlist1.SelectedItem.Text

rs.Requery
fill
End If

End Sub

Private Sub cmdDeliver_Click()
Dim tempQTY As String
Dim tutal, Gtotal As Currency
If ORDERlist1.ListItems.Count = 0 Then Exit Sub
check_RS
rs.Open "select * from orders where orders.orderno = " & _
ORDERlist1.SelectedItem.Text

rs.MoveFirst
While Not rs.EOF
tempQTY = ""
While tempQTY = "" Or Not IsNumeric(tempQTY)
tempQTY = InputBox("Please enter the quantity of delivered item : " & rs(1))

If tempQTY = "" Or Not IsNumeric(tempQTY) Then
MsgBox "Invalid input! Please enter a numeric value."
End If
Wend
tutal = tempQTY * Val(rs(2))
Gtotal = Gtotal + tutal
cnn.Execute "insert into delivered values (" & rs(0) & ", '" & rs(1) & "', " & _
rs(2) & ", " & tempQTY & ", " & tutal & ",'" & Date & "', " & rs(6) & ")"
rs.MoveNext
Wend

cnn.Execute "delete from orders where orders.orderno = " & ORDERlist1.SelectedItem.Text

check_RS1
rs1.Open "select * from delivered where delivered.orderno = " & ORDERlist1.SelectedItem.Text, cnn
While Not rs1.EOF
  check_RS
  rs.Open "Select * from products where prod_desc = '" & rs1(1) & "'", cnn
  prod_total = Val(rs(2)) + Val(rs1(3))
  cnn.Execute "update products set products.quantity = " & prod_total & " where prod_desc = '" & rs(1) & "'"
  rs1.MoveNext
Wend
cnn.Execute "update  order_total set order_total.total = " & Gtotal & " where order_no = " & ORDERlist1.SelectedItem.Text


Orderdel.txtsearch.Text = ORDERlist1.SelectedItem.Text
Unload Me
Load Orderdel
Orderdel.Show 1




End Sub

Private Sub cmdexit_Click()
Unload Me
End Sub

Private Sub cmdShow_Click()
txtsearch = ""
End Sub

Private Sub Command1_Click()

End Sub

Private Sub Form_Load()
check_RS
rs.Open "select * from orders order by orderno asc", cnn
fill
End Sub

Private Sub txtsearch_Change()
If txtsearch = "" Or txtsearch = " " Or textsearch = "  " Or txtsearch = "   " Or txtsearch = "    " Then
check_RS
rs.Open "select * from orders", cnn
fill
Exit Sub
End If
check_RS
rs.Open "Select * from orders where orders.orderno = " & txtsearch, cnn
fill

End Sub

Public Sub fill()
Dim x As Integer
'On Error GoTo e
ORDERlist1.ListItems.Clear
If txtsearch = "" Then
cmdShow.Visible = False
Else
cmdShow.Visible = True
End If

While Not rs.EOF
 
 
   Set lst = ORDERlist1.ListItems.Add(, , rs(0), , 2)
       
   For x = 1 To 5
     lst.SubItems(x) = rs(x)
   Next x
     check_RStemp
     rstemp.Open "select sup_name from supplier where sup_id = " & rs(6), cnn
     lst.SubItems(6) = rstemp(0)


rs.MoveNext
Wend
If txtsearch <> "" Then
check_RStemp
rstemp.Open "select * from order_total where order_no =" & txtsearch

If rstemp.RecordCount <> 0 And rs.RecordCount <> 0 Then
Set lst = ORDERlist1.ListItems.Add(, , "")
           lst.SubItems(3) = "Total Amount: "
           lst.SubItems(4) = rstemp(1)
End If
End If
Exit Sub
e:
MsgBox Err.Description
End Sub
Back to top
View user's profile Send private message MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    Visual Basic Forum for Visual Basic Programmers VB Forum Index » Database & Reporting All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Visual Basic Forum runs phpBB | Forum Template © iOptional
VB Resources | SSL | Visual Basic