Change to:
Code:
start = Now()
StrSQL = "INSERT INTO log (start_date) VALUES (" & start & ")"
DoCmd.RunSQL StrSQL
You might need to format start a bit to get it to go into a date-type field. the example I have creates SQL like
âINSERT INTO tbl (fld1, date_fld)
VALUES ('Hey', TO_DATE('FEB 3, 2003', 'MON DD, YYYY');â
(When entering SQL into SQL-Plus for Oracle, the SQL must be terminated with a â;â but in code, when building an SQL string, the â;â generates a syntax error.)
Access uses â#âs to delineate dates, so perhaps this will work for you
Code:
start = Now()
StrSQL = "INSERT INTO log (start_date) VALUES (#" & Format(start, "mm/dd/yyyy") & "#)"
DoCmd.RunSQL StrSQL
What you posted causes Accessâ SQL interpreter to try to assess a variable in the SQL named start, whereas what you are trying to do is to feed a VBA variable into the string that will be sent to the SQL interpreter.