Guest User

Untitled

a guest
Jul 19th, 2018
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.09 KB | None | 0 0
  1. '1.1 Set Database and Recordset - where the data is coming from
  2. Dim thisDB As DAO.Database
  3. Dim rs As DAO.Recordset
  4. Set thisDB = CurrentDb()
  5. Set rs = thisDB.OpenRecordset("tblInvestments")
  6.  
  7. '2.1 Start Loop to check records in the recordset [tblInvestments]
  8. Do While Not rs.EOF
  9. AccountID = rs!AccountID
  10. InvestmentID = rs!InvestmentID
  11. iType = rs!Type
  12. Interest = rs!Interest
  13. Principal = rs!Principal
  14. iRate = rs!Rate
  15. CommenceDate = rs!Commence
  16. MatureDate = rs!Mature
  17. ParentUpdate = rs!LastUpdateDate
  18.  
  19. '5.5 Build SQL Query and append to table
  20.  
  21. StrSQL = "INSERT INTO tblInterestRevenue ( InvestmentID, InterestDate, PrincipalDebit, PrincipalCredit, PeriodInterest, AccumulatedInterest, PeriodPaidInterest) "
  22. StrSQL = StrSQL & "VALUES (" & InvestmentID & ",#" & InterestDate & "#," & PrincipalDebit & "," & PrincipalCredit & "," & PeriodInterest & "," & AccumInterest & "," & PeriodInterestPaid & ")"
  23.  
  24. DoCmd.SetWarnings False
  25. DoCmd.RunSQL StrSQL
  26. DoCmd.SetWarnings True
Add Comment
Please, Sign In to add comment