I have a date field in my table, with "dd/mm/yyyy" format.
I am trying to insert into that field a variable through a form using VBA code. I have this:
vardtedate = CDate(Format(Me.dtedate.Value, "dd/mm/yyyy"))
DoCmd.RunSQL "INSERT INTO table (dtedate) VALUES (#" & vardtedate & "#);"
It works fine, but only when the day is over 12. If I try to insert something like '12/06/2016' it shows it reversed, like '06/12/2016', and the field takes that date as 6th of december instead of 12 of june. What am I doing wrong? What am I missing?
I tried to parametize and the problem persists.
Datetypes instead ofStrings.vardtedate = CDate(Format(Me.dtedate.Value, "mm/dd/yyyy")). Reverse month and day when you set vardtedate