cleteh
02-28-2016, 12:58 PM
This line of code works DoCmd.RunSQL "INSERT INTO SystemDate (SystemDate) VALUES (Date());"
Its inserting todays date into the Table SystemDate in the field also titled SystemDate. The Code is in the Form Open procedure.
Now, Im trying to build an if statement that will check to see IF todays date has already been entered THEN do nothing ELSE enter today's date.
Im getting an error on line 1, Here is my Code:
If [SystemDate].MAX[SystemDate] = Date() Then
Else
DoCmd.RunSQL "INSERT INTO SystemDate (SystemDate) VALUES (Date());"
End If
I get a compile error Expected: Then or GoTo
Its inserting todays date into the Table SystemDate in the field also titled SystemDate. The Code is in the Form Open procedure.
Now, Im trying to build an if statement that will check to see IF todays date has already been entered THEN do nothing ELSE enter today's date.
Im getting an error on line 1, Here is my Code:
If [SystemDate].MAX[SystemDate] = Date() Then
Else
DoCmd.RunSQL "INSERT INTO SystemDate (SystemDate) VALUES (Date());"
End If
I get a compile error Expected: Then or GoTo