Another no brainer, but I can’t see it for the life of me.
I want to update a field in a table with a date. I’m using the following code to run the update but the date is always 12/30/1899 unless I hard code the date in.
[indent]
Function UpdateIt(myTable As String)
Dim mySQL As String
dPIFDate = Date
mySQL = “UPDATE ” & myTable & ” SET ”
mySQL = mySQL & myTable & “.[DateOfFile] = ” & dPIFDate & “;”
DoCmd.SetWarnings False
DoCmd.RunSQL mySQL
DoCmd.SetWarnings True
End Function
[/indent]
dPIFDate is a public variable as date
What am I doing wrong here?