DELETE command in VBA does not work

1

I have a project that adds and deletes dates, to add I have the following code:

   Set dbs = CurrentDb
   dbs.Execute " INSERT INTO TMP " _
   & "(diaMes) VALUES( " _
    & "'" & tmp7 & "') "

where tmp7 is the date in dd-mm-yyyy and works perfectly

and to remove use the following code:

    Set dbs = CurrentDb
   dbs.Execute " DELETE * FROM TMP " _
   & "WHERE diaMes=#" & tmp7 & "#;"

The problem is that deleting only deletes if the day is greater than 12, ie I understand that if the day is less than or equal to 12 you are interpreting as mm-dd-yyyy

tmp7 is a string with string concatenation.

How can I force SQL to pass as dd-mm-yyyy?

The field in the table looks like this:

    
asked by anonymous 08.10.2014 / 13:41

1 answer

2

I found out how to do it,

    Set dbs = CurrentDb
    dbs.Execute "DELETE * FROM TMP WHERE diaMes = " & _
    Format(tmp7, "\#mm\/dd\/yyyy\#")
    
08.10.2014 / 16:10