UPDATE with DoCmd

DemonHub

Registered User.
Local time
Today, 10:29
Joined
Jul 26, 2005
Messages
14
I need help with this code

DoCmd.RunSQL "UPDATE CocheDivers SET Diver1 =" & div1 & ", Diver2=" & div2 & _
", Diver3=" & div3 & ", Diver4=" & div4 & _
" WHERE NumDossier=" & "'" & Me!NumDossier & "'" & _
" AND Critere=" & "'" & Me!Criteres1 & "'" & _
" AND DateRecu=" & Me!DateRecu


The criteria in Green is not working and I don't know how to fix the problem.
It's look like he can't compare the two dates.
 
try this as the green line

" AND DateRecu= date'" & Me!DateRecu & "'"

not sure if it will work, but thats how you force a string into a date on some db systems.
 
Ok I've found the way

" AND DateRecu=#" & Format(Me!DateRecu, "yyyy-mm-dd") & "#"

Now It's working.
 
Last edited:

Users who are viewing this thread

Back
Top Bottom