The line DoCmd.RunSQL "INSERT INTO TotalInterest (FileNo, TotInt) SELECT FileNumber, NewTotalInterest FROM TotalInterestQuery" The code runs without any errors but its not inserting the record from the query into the the table total interest query. Any help would be greatly appreciated this one procedure has been holding up a project for nearly a week now.
Private Sub Form_Open(Cancel As Integer)
Dim maxDate As Date
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
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