Results 1 to 2 of 2
  1. #1
    Silver Lounger
    Join Date
    Jun 2001
    Location
    Niagara Falls, New York, USA
    Posts
    1,878
    Thanks
    0
    Thanked 0 Times in 0 Posts

    HOW TO UPDATE INVENTORY

    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

  2. #2
    Gold Lounger
    Join Date
    Jun 2001
    Location
    Crystal Beach, FL, Florida, USA
    Posts
    3,436
    Thanks
    1
    Thanked 34 Times in 34 Posts

    Re: HOW TO UPDATE INVENTORY

    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.
    Mark Liquorman
    See my website for Tips & Downloads and for my Liquorman Utilities.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •