Results 1 to 3 of 3
  1. #1
    Kaloyanides is offline Advanced Beginner
    Windows 7 64bit Access 2013
    Join Date
    Jan 2015
    Location
    Arlington, MA
    Posts
    51

    How to program update table...

    I have a sales order database.

    tblSalesInvoiceHeaders


    tblSalesInvoiceItems
    tblPayments

    When user enters a sales order, they have to click "Issue Invoice." When the invoice is issued, the invoice number is assigned and a record is added to the tblPayments table for collection purposes. This works fine. However, if the invoice is later modified, the user has to go to the Payments tab on the sales order entry screen and manually update or change the invoice amount to reflect the new total. It's not updating automatically. I had it updating but it was buggy. I'm wondering if a professional could shed light on the correct way to go about doing this?

    When invoice modified, automatically change the invoice total in the tblPayments table to reflect the new total.

    Thanks!

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,549
    you need an update query that joins tPayment.InvoiceID to tblSalesInvoiceHeaders.InvoiceID
    sum the new total from tblSalesInvoiceItems, like in a textbox on the edit form, txtSum.
    the update will change the
    tPayment.Total to the txtSum.

    (it has to be done using the form, because you cannot SUM AND UPDATE in a query)



  3. #3
    aytee111 is offline Competent At Times
    Windows 10 Access 2013 64bit
    Join Date
    Nov 2011
    Location
    Nomad
    Posts
    3,936
    The Payments table is a record of payments, not a place to store the invoice amount. These should be two totally separate entities - the amount that is due and the amount that is paid. Learn about table design, and especially normalization techniques - one thing being never to repeat data, which you are doing here. You can see the problems that is causes!

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

Similar Threads

  1. How to program a GRAPH out of data from TABLE
    By taimysho0 in forum Programming
    Replies: 7
    Last Post: 02-15-2012, 04:09 PM
  2. update access program
    By beha in forum Access
    Replies: 2
    Last Post: 09-24-2011, 06:43 AM
  3. Program a 30-day trial into my Access Program?
    By genghiscomm in forum Programming
    Replies: 1
    Last Post: 05-26-2011, 02:14 PM
  4. Need to update an ancient Access97 "program".
    By Hilton in forum Programming
    Replies: 1
    Last Post: 05-26-2010, 04:47 AM
  5. program find button to search whole table
    By sammer021486 in forum Programming
    Replies: 2
    Last Post: 10-01-2009, 06:36 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