cleteh
07-22-2016, 01:14 PM
The line in the code below "DoCmd.RunSQL "INSERT INTO TotalInterest (FileNo, TotInt) SELECT FileNumber, NewTotalInterest FROM TotalInterestQuery" is not producing an error but its not writing the records to the table total interest table... Does anybody have any idea why? I am losing my mind trying to get this procedure to work... everything but this one line seems to be working.
Private Sub Form_Open(Cancel As Integer)
Dim maxDate As Date
Dim x As Currency
Dim y As Currency
Dim z As Currency
maxDate = DMax("SystemDate", "SystemDate")
If maxDate = Date Then
Else
DoCmd.SetWarnings False
DoCmd.RunSQL "INSERT INTO SystemDate (SystemDate) VALUES (Date());"
DoCmd.OpenQuery ("Daily Interest")
DoCmd.OpenQuery ("TotalInterestQuery")
DoCmd.RunSQL "DELETE * FROM TotalInterest"
DoCmd.RunSQL "INSERT INTO TotalInterest (FileNo, TotInt) SELECT FileNumber, NewTotalInterest FROM TotalInterestQuery"
DoCmd.Close acQuery, "Daily Interest"
DoCmd.Close acQuery, "TotalInterestQuery"
DoCmd.SetWarnings True
End If
End Sub
Private Sub Form_Open(Cancel As Integer)
Dim maxDate As Date
Dim x As Currency
Dim y As Currency
Dim z As Currency
maxDate = DMax("SystemDate", "SystemDate")
If maxDate = Date Then
Else
DoCmd.SetWarnings False
DoCmd.RunSQL "INSERT INTO SystemDate (SystemDate) VALUES (Date());"
DoCmd.OpenQuery ("Daily Interest")
DoCmd.OpenQuery ("TotalInterestQuery")
DoCmd.RunSQL "DELETE * FROM TotalInterest"
DoCmd.RunSQL "INSERT INTO TotalInterest (FileNo, TotInt) SELECT FileNumber, NewTotalInterest FROM TotalInterestQuery"
DoCmd.Close acQuery, "Daily Interest"
DoCmd.Close acQuery, "TotalInterestQuery"
DoCmd.SetWarnings True
End If
End Sub