Results 1 to 4 of 4
  1. #1
    TenOc is offline Advanced Beginner
    Windows 7 64bit Access 2013
    Join Date
    Feb 2015
    Posts
    94

    Question 15 reoccurring events each month semiautomatically posting to a table -- how to?????

    I have 15 events that recur each month. Somewhat like 15 tenants paying rent. While all the events are not due on the same day of the month I usually wait until around the 20th of each month to post these 15 events to my actual rent paid table. The tenants are very good about paying the rent on time so I do not need to make any adjustments. I do have a table that list the date and amount of each rent called rent due.



    I am looking for some hints on how to semi-automatically post these 15 events without having to post each manually. Any hints or templates would be greatly appreciated.

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,963
    VBA procedure that runs INSERT SELECT action SQL to batch create records.

    The real trick is figuring out what event to put code into. Could be button click, form open, or AutoExec macro.
    Code:
    If Day(Date()) = 20 Then
    CurrentDb.Execute "INSERT INTO RentPaid(TenantID, Rent, DatePaid) SELECT TenantID, Rent, Date() AS DatePaid FROM RentDue"
    End If
    Set TenantID and DatePaid fields as compound index to prevent duplicate entries.
    Last edited by June7; 09-25-2021 at 12:57 PM.
    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
    Gicu's Avatar
    Gicu is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jul 2015
    Location
    Kelowna, BC, Canada
    Posts
    4,122
    You could add code to a autoexec macro or to the Load event of the opening form and check for the day of the month:
    Code:
    If Day(Date) =20 then
    'prompt if to add the 15 rent records
        If msgbox ("Do you want to add this month's rent records?",............) = vbYes then
            CurrentDb.Execute "INSERT INTO RentPaid(TenantID, Rent, DueDate) SELECT TenantID, Rent, #" & Me.tbxDate & "# AS DatePaid FROM RentDue"
        End If
    End if
    Vlad Cucinschi
    MS Access Developer
    http://forestbyte.com/

  4. #4
    TenOc is offline Advanced Beginner
    Windows 7 64bit Access 2013
    Join Date
    Feb 2015
    Posts
    94
    Thanks All

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

Similar Threads

  1. Replies: 9
    Last Post: 04-06-2018, 02:29 PM
  2. Replies: 3
    Last Post: 12-29-2014, 10:14 AM
  3. Replies: 3
    Last Post: 05-23-2013, 05:30 PM
  4. Events on another table
    By k_rasuri in forum Access
    Replies: 9
    Last Post: 09-11-2012, 04:24 PM
  5. combo box posting to table
    By 237 in forum Access
    Replies: 5
    Last Post: 12-04-2011, 11:36 AM

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