When I type strDate = Date() it switches to strDate = date, and then the code does not run correctly because it does not know what "date" refers to. This is in a brand new Access 2013 database with only a single form with a button to run the code and a table with only one field to insert the date.
References that are checked for this database are:
- Visual Basic For Applications
- Microsoft Access 15.0 Object Library
- OLE Automation
Microsoft Office 15.0 Access database engine Object Library
Dim strDate As String strDate = Date() DoCmd.SetWarnings False Dim strSQL As String strSQL = "INSERT INTO Table1 VALUES ('" & strDate & "');" DoCmd.RunSQL strSQL DoCmd.SetWarnings True