Hello there
I want to place the current date into af field. The code looks like this:
Private Sub cmdNew_Click()
Dim mySQL As String
Dim day
day = Date
mySQL = "INSERT INTO tblAfsluttet( IdJournal, Afslutningsdato)"
mySQL = mySQL & " Values (" & IdJournal & ", " & Date & ")"
MsgBox "Today's Date is " & Date
DoCmd.SetWarnings False
DoCmd.RunSQL mySQL
DoCmd.SetWarnings True
End Sub
The code puts in a date in the [Afslutningsdato] field all right, but it is 19-07-1894!!! The msgbox which is for verifing the date data shows 25-03-2012, which is the correct one :-).
The code is working, but the date is really strange!
The field where the wrong date is put in has the same specification as other date fields which shows the correct date.
So the question is has any one of you clever access guys had this problem and what was the solution?
Regards
Morten