• HOW TO UPDATE INVENTORY

    Author
    Topic
    #356776

    HOW TO UPDATE INVENTORY

    I have a order form that has twenty fields. A combo box is the first field that displays a list of unique serial numbers from an inventory table that are not yet sold.

    I want the user to select a serial number item to be sold from the combo box into the order form and immediately update the inventory table that drives the combo box on the order form.

    I have an Update Query in the combo After Update Event that updates the serialized inventory table with a sold date and customer ID, I get the following message:

    Can’t update all the records in the Update Query.
    Application didn’t update 1 record(s) due to lock violations

    It is important that the inventory item is updated immediately with the sold date so another concurrent operator doesn’t select the same serialized item.

    How can I avoid this message?

    Is there another technique I should used to accomplish the task?

    Is there some sample code available that accomplishes this task?

    Thank you, John Graves

    NBS7335

    Viewing 0 reply threads
    Author
    Replies
    • #529184

      From your description, it appears that you are trying to update the inventory record before you have written your order record. I’d try making sure that was done before the update.

      Another approach is to avoid the update of the inventory record. Instead, use a query which detects which inventory records to not have a matching order record (which indicates it was sold). The UnMatched Query wizard will help you create such a query. The additional benefit is that this will mean your database is more normalized, and reduce risk of update problems.

    Viewing 0 reply threads
    Reply To: HOW TO UPDATE INVENTORY

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

    Your information: