I am trying to do an update query via vba sql . I have tried setting the variable to Null and to "" and throws an error, I am sure that this is an easy solution, but my brain is fried and tried searching see if anyone has had this issue.
The ones that are giving me issues is dpd and dpt, they are declared dates. I don't want to delete the record just remove the date and time from the record.
Thank you in advance for the help.
Code:
With db
.Execute "UPDATE tblSerialNumber " & _
"Set ModelID = " & mdi & ", PickupLocationID = " & pul & ", DeliveredByID = " & dbi & ", " & _
"PickupTime = #" & pkt & "#, PickupDate = #" & pud & "#, ArrivalDate = #" & ald & "#, " & _
"ArrivalTime = #" & ald & "#, ArrivalTime = #" & alt & "#, eDriverID = " & edi & ", " & _
"CurrentLocation ID = " & cli & ", ReturnLocationID = " & rli & ", DepartureDate = " & _
"#" & dpd & "#, DepartureTime = #" & dpt & "# " & _
"WHERE SerialNumberID = '" & ssn & "'"
End With
The ones that are giving me issues is dpd and dpt, they are declared dates. I don't want to delete the record just remove the date and time from the record.
Thank you in advance for the help.
Last edited by a moderator: