In the code below I am getting an error on the line
DoCmd.RunSQL "INSERT INTO TotalInterest (FileNo,TotInt) VALUES (FileNumber,NewTotalInterest)FROM TotalInterestQuery;"
saying missing colon at the end of SQL Statement
DoCmd.RunSQL "INSERT INTO TotalInterest (FileNo,TotInt) VALUES (FileNumber,NewTotalInterest)FROM TotalInterestQuery;"
saying missing colon at the end of SQL Statement
Code:
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) VALUES (FileNumber,NewTotalInterest)FROM TotalInterestQuery;"
DoCmd.Close ("Daily Interest")
DoCmd.Close ("TotalInterestQuery")
DoCmd.SetWarnings True
End If
End Sub