Your SQL is wrong. Try something like
strSQL = "INSERT INTO tblNewDates (TestDate) values ('" & TestDate & "')"
(Although note my comment above about
SQL Injection[
^] )
Now to the value of TestDate.
Firstly, do not use
Set
with strings.
Secondly, ensure that whatever is in that variable is a date,
in the correct format. It is always advisable to
Use Unambiguous Date formats[
^] so that could be something like
TestDate = Format(txtRelativeList.Value, "yyyy-MM-dd")
If you wanted to be sure to avoid SQL Injection you could even use
TestDate = Format(CDate(txtRelativeList.Value), "yyyy-MM-dd")
as that will throw a Run-time error '13': Type mismatch exception if
txtRelativeList.Value
is not an actual date
Edit: I forgot to tell you how to execute the SQL - i.e. the "reference to the database" bit
You could use
CurrentDb.Execute strSQL, dbFailOnError
although for linked tables I sometimes also use
CurrentProject.Connection.Execute strSQL