• Auto update of quantity (2000 SR-1)

    Author
    Topic
    #361285

    I want to create a database in which I have a table with starting inventories of say 6 items. I want to be able to enter in a form what day, what item and how many of said items were taken to be shipped out. For the life of me I can’t figure out how to do this. An expression like QOH: [Inventory]-[itemqnty] is useless as it doesn’t update the inventory field to reflect some were taken out.

    Viewing 0 reply threads
    Author
    Replies
    • #545748

      If all you want to keep in the table is the current inventory amount, then bind the form to this table (specify this table as the form’s record source). Include in the form a control (locked for editing) that shows the current inventory of the selected item (i.e., this control should be bound to the table value). Include an unbound control in the form for the quantity removed from inventory. In this control’s AfterUpdate event, update the bound current inventory control. Something like:

      Private Sub txtQtyRemoved_AfterUpdate()

      Me!txtCurrentInventory = Me!txtCurrentInventory – Me!txtQtyRemoved

      End Sub

      Hope this helps.

    Viewing 0 reply threads
    Reply To: Auto update of quantity (2000 SR-1)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: