Results 1 to 2 of 2
  1. #1
    zakmsipanic is offline Novice
    Windows 8 Access 2013 64bit
    Join Date
    Feb 2017
    Posts
    1

    Unhappy Trying to run code for specific fields in a Table monthly.

    Hi I need help. Im new to Access and:



    I have table called FS_Disbursements and its corresponding splitform

    In my table there are fields like startdate, duration, enddate, obligatedamount, amountpermonth, amountleft, totalamountdisbursed and other fields related to each record.

    Ideally, what i want to do is every month, each record should do the logic:

    Code:
                totalamountdisbursed = totalamountdisbursed + amountpermonth            amountleft = amountleft - amountpermonth
                duration = duration - 1
    **Note that not all records have the same start and enddate and the format is dd/mm/yyyy

    I have no idea how to make each record do the logic above every month. Please Help. Thanks!

  2. #2
    davegri's Avatar
    davegri is offline Excess Access
    Windows 10 Access 2016
    Join Date
    May 2012
    Location
    Denver
    Posts
    3,413
    I suspect you have a record for each account in the table.
    For each account I would add a new record each month with the new calculated amounts in that new record. That way you would have a monthly history or trail back to the beginning. Add a field to each record 'UpdateDate'.

    As for running once per month, each time the database is opened, compare the UpDateMonth with the current month. If the current month is greater, do the calculations, add the record with the new upDateDate. Going from December to January requires comparing the year also.

    Does this sound like a viable option?

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

Similar Threads

  1. Replies: 3
    Last Post: 12-21-2015, 08:03 AM
  2. Replies: 15
    Last Post: 09-01-2015, 12:20 PM
  3. Sorting Specific Fields in Table/Recordset in VBA
    By jamesdeuce in forum Programming
    Replies: 7
    Last Post: 04-02-2014, 12:44 AM
  4. Code to add monthly reocrds to table
    By SMcGrath in forum Programming
    Replies: 4
    Last Post: 12-12-2013, 04:54 PM
  5. Replies: 1
    Last Post: 07-06-2012, 05:32 PM

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