943,960 Members | Top Members by Rank

Ad:
Sep 13th, 2007
0

saving array of text5(i).text

Expand Post »
i have a search program that when searched i will make a receipt, a reciept form will be displayed, the
1st item searched will be displayed on text1(0).text and the quantity also will be displayed in text5(0).text
my problem is how to subtract the stock items minus the quantity text5(0).text(its an array of text5(i).text
in frmsearch i have this for a code:
Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
  1.  
  2. repeat = 1
  3.  
  4. If Adodc1.Recordset.RecordCount > 0 Then
  5. Ono1 = Adodc1.Recordset.Fields("Price")
  6. Ono2 = Adodc1.Recordset.Fields("Carmodel")
  7. Ono6 = Adodc1.Recordset.Fields("Category")
  8. Ono3 = Adodc1.Recordset.Fields("PartNo2")
  9. Ono4 = Adodc1.Recordset.Fields("CarApp")
  10. Ono5 = Adodc1.Recordset.Fields("Year")
  11. stock = Adodc1.Recordset.Fields("Stocks")
  12. For i = 0 To 4
  13. If repeat = 1 Then
  14. Do While frmReciept.Text4(i).Text = "" And frmReciept.Text6(i).Text = ""
  15.  
  16. frmReciept.Text4(i).Text = Ono2 & " " & Ono6 & " " & Ono3 & " " & Ono4 & " " & Ono5
  17. repeat = 0
  18. frmReciept.Text6(i).Text = Ono1
  19. frmReciept.Text5(i).Text = 1
  20. Loop
  21. End If
  22. Next i
  23. End If
  24.  
  25. frmReciept.Show
in frmReciept i have this for a code
Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
  1.  
  2. frmReciept.Adodc3.ConnectionString = "Provider=Microsoft.jet.oledb.4.0;data source=" & App.Path & "\MBMKDbase.mdb"
  3. frmReciept.Adodc3.RecordSource = "SELECT * FROM CustDbase"
  4. frmReciept.Adodc3.CommandType = adCmdText
  5. frmReciept.Adodc3.Refresh
  6.  
  7. If frmReciept.Text4(i).Text <> "" And frmReciept.Text6(i).Text <> "" Then
  8.  
  9. With frmReciept.Adodc3.Recordset
  10. .AddNew
  11. .Fields("CustName") = frmReciept.Combo6.Text
  12. .Fields("InvoiceNo") = frmReciept.Text8.Text
  13. .Fields("PONo") = frmReciept.Text10.Text
  14. .Fields("Date") = frmReciept.txtDate.Text
  15. .Fields("QtY") = frmReciept.Text5(i).Text
  16. .Fields("Product") = Label17.Caption & "," & Label18.Caption 'Text4(i).Text
  17. .Fields("Price") = frmReciept.Text6(i).Text
  18. .Fields("Total") = frmReciept.Text3.Text
  19. .Update
  20. End With
  21. End If
i want that everytime i add a product in the receipt, the stocks of that particular item will deducted with the quantity purchased
(frmReciept.Text5(i).Text) can anyone help
Similar Threads
Reputation Points: 16
Solved Threads: 0
Light Poster
vbcielle is offline Offline
26 posts
since Sep 2006

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Visual Basic 4 / 5 / 6 Forum Timeline: Copy data, but paste with space between rows
Next Thread in Visual Basic 4 / 5 / 6 Forum Timeline: VB and excel solver (runtime errors)





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC