Error 1 : Setting Date Field in Recordset to null
This Forum helped me a lot and i would like to return the favor ..
I will save u a lot of time searching for a solution on the internet to the most Frustrated error in ms access in a simple way without too much coding .
Error 1 : Setting Date Field in Recordset to null " data conversation error 3421 "
Introduction : I gave up finding a straight solution on the internet for this one , so i came up with my own and it worked , so i hope it will work for you also ..
Solution : If the field is null set it back to itself .
Here is a simple dummy example i wrote to demonstrate the solution ( look for the bold text in side the code )
Code :
Code:
Sub Event_btnSaveEndTime ()
dim strEndDate as string
With Form_frmMainForm
strEndTime = .txtEndTime.Value
rs.Edit
'if the date field is null set it back to itself
If IsNull(rs.Fields("actEndTime")) Then
rs.Fields("actEndTime") = rs.Fields("actEndTime")
Else
rs.Fields("actEndTime") = strEndTime
End If
rs.Update
End With
End Sub
Note : Keep visiting the forum from time to time , i will keep posting more solutions. For consistency i will use the same format for this thread - Error1 , Error 2 , and so on .
Best regards to all And happy coding
Ali - Capsule