Subtracting from units In Stock

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • nicekul
    New Member
    • Jan 2008
    • 1

    Subtracting from units In Stock

    I am having problems subtracting from unitsInStock for all records on my table, for instance; I have Quantity sold, Unit Price,UnitsInSt ock,Total sales, Stock Balance.

    I declared
    Dim num1
    Dim num2
    Dim num3
    As General Declaration, then on form load

    I wrote
    num1 = quantity Sold
    num2 = unitsInStock
    num3 = Stock balance
    num3 = num2 - num1

    it worked just once and do not work anytime I update, again it dont work for all my records. Can anyone help please?
  • jamesd0142
    Contributor
    • Sep 2007
    • 471

    #2
    Originally posted by nicekul
    I am having problems subtracting from unitsInStock for all records on my table, for instance; I have Quantity sold, Unit Price,UnitsInSt ock,Total sales, Stock Balance.

    I declared
    Dim num1
    Dim num2
    Dim num3
    As General Declaration, then on form load

    I wrote
    num1 = quantity Sold
    num2 = unitsInStock
    num3 = Stock balance
    num3 = num2 - num1

    it worked just once and do not work anytime I update, again it dont work for all my records. Can anyone help please?
    Ok so you have a table which stores your data, and you want to update the values in the table through vb? if no can you explain what you want?

    Comment

    • Killer42
      Recognized Expert Expert
      • Oct 2006
      • 8429

      #3
      Yes, keep in mind that the Form_Load event only occurs when the form is loaded (strange, huh). From the sound of it, you want to do this in an event that is triggered when you change between records or something.

      I think we'd need more detail on your situation to provide much more help.

      Comment

      • lotus18
        Contributor
        • Nov 2007
        • 865

        #4
        Originally posted by Killer42
        Yes, keep in mind that the Form_Load event only occurs when the form is loaded (strange, huh). From the sound of it, you want to do this in an event that is triggered when you change between records or something.

        I think we'd need more detail on your situation to provide much more help.
        Yes, I agree with you Killer42.

        Hey nicekul, why don't you use command buttons for that?

        Rey Sean

        Comment

        Working...