Results 1 to 5 of 5
  1. #1
    SeanA is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jan 2013
    Posts
    29

    Update a specific record in a table through a fom

    Ok, i'm sure this is simple, but I am stuck. I have a table with a column "QuantityAvailable" and a specific PartID for each row. I have a form with a text box "NewQuantity" and a combobox that selects the specific "PartID". I would like to have a button that replaces the old quantity. So, after the data is typed, the save button is hit and the value is replace. My box is unbound because the text box pulls values from other text boxes and subform. It is a calculated value which is why I am leaving it unbound.



    Thanks!

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,615
    From my soapbox - usually, saving aggregate data is a bad design. Calculate aggregate data when needed. Enter transactions of incoming and outgoing, calculate the difference for net.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    SeanA is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jan 2013
    Posts
    29
    This is not a cost. It is a shipment. So, what I am doing is when I make changes on the form, I save a new record with the new quantity and new location for that part. However, theere still may be left over quantity in the old location. I wanted to edit this quantity while retaining all of the old data.

    Another though I had was to create 2 new records. One being a copy of the old record with the new associated copy and then the new record with the new location. The problem I had with that was deleting the old record whenever this is done.

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,615
    I didn't think it was cost. Items come in (purchases) to increase stock and items go out (sales) to decrease stock. The difference is the net balance. This has been discussed numerous times in forum threads. What you want can be done but is tricky. Review https://www.accessforums.net/queries...rol-31854.html
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  5. #5
    SeanA is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jan 2013
    Posts
    29
    Well, I got it to work. It's not exactly what I wanted but it seems to work. What i did is use two insert statements to add the new records (unless a qty is zero) and deleted the old record. Not the most elegant way to do it but it is working. Thanks, June7!

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 6
    Last Post: 11-15-2012, 05:38 PM
  2. Update Pivot Table Record Source via VBA
    By GeekInOhio in forum Access
    Replies: 0
    Last Post: 09-06-2012, 02:26 PM
  3. Replies: 3
    Last Post: 05-23-2012, 07:48 AM
  4. Replies: 3
    Last Post: 03-23-2011, 11:37 AM
  5. Update single record via forum, not entire table?
    By 10 Gauge in forum Programming
    Replies: 2
    Last Post: 02-11-2011, 09:14 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums