Results 1 to 3 of 3
  1. #1
    pervezjan is offline Novice
    Windows XP Access 2003
    Join Date
    Sep 2012
    Posts
    12

    Want to update previous records of a customer with current Record

    Greeting


    I need your help

    I have problem to update previous entries of a Customer with Current Record of same Customer. my Table is as under
    CustId. PrevBill. Afterduedate. date

    If a customer pay his last bill then all the previous Entries of the Same customer must be changed = 0
    I am using MDB
    PrevBill = DMax("[AfterdueDate]", "[bill]", "[custNO]='" & [CustNo] & "'")
    It is working but when a bill is paid. Then second time its bring the old value of any Record of the Customer as prevbill

    If a customer pay his last bill then all the previous entries of the same must be = 0
    any Idea.

    Thanks

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    I don't understand data structure.

    Ideally, there would be a table of customers, a table of billings, a table of receipts. Calculate the customer net balance from the difference of the sums of billings and receipts.
    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
    ohmydatabase's Avatar
    ohmydatabase is offline Advanced Beginner
    Windows 7 64bit Access 2016
    Join Date
    Feb 2017
    Posts
    79
    I agree with @June7, I can't understand the problem you're running into.

    Are you making a new record every time the customer submits a payment? If so, are you setting the PrevBill for that record as the maximum of the "AfterdueDate"? It seems more viable to have one record per customer with a current balance. You could then have a separate table to track all the transactions. You could write some code to automatically update a customer's next DueDate upon payment.

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

Similar Threads

  1. Replies: 17
    Last Post: 10-17-2016, 09:21 AM
  2. Replies: 7
    Last Post: 08-06-2016, 07:05 PM
  3. Replies: 2
    Last Post: 12-01-2014, 02:53 AM
  4. Replies: 14
    Last Post: 08-12-2014, 06:33 AM
  5. Replies: 2
    Last Post: 03-05-2014, 05:37 PM

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