Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- '1.1 Set Database and Recordset - where the data is coming from
- Dim thisDB As DAO.Database
- Dim rs As DAO.Recordset
- Set thisDB = CurrentDb()
- Set rs = thisDB.OpenRecordset("tblInvestments")
- '2.1 Start Loop to check records in the recordset [tblInvestments]
- Do While Not rs.EOF
- AccountID = rs!AccountID
- InvestmentID = rs!InvestmentID
- iType = rs!Type
- Interest = rs!Interest
- Principal = rs!Principal
- iRate = rs!Rate
- CommenceDate = rs!Commence
- MatureDate = rs!Mature
- ParentUpdate = rs!LastUpdateDate
- '5.5 Build SQL Query and append to table
- StrSQL = "INSERT INTO tblInterestRevenue ( InvestmentID, InterestDate, PrincipalDebit, PrincipalCredit, PeriodInterest, AccumulatedInterest, PeriodPaidInterest) "
- StrSQL = StrSQL & "VALUES (" & InvestmentID & ",#" & InterestDate & "#," & PrincipalDebit & "," & PrincipalCredit & "," & PeriodInterest & "," & AccumInterest & "," & PeriodInterestPaid & ")"
- DoCmd.SetWarnings False
- DoCmd.RunSQL StrSQL
- DoCmd.SetWarnings True
Add Comment
Please, Sign In to add comment