Click to See Complete Forum and Search --> : null date when entering into database through ado


brainfire
September 30th, 2001, 03:06 AM
I have a samall problem .When i enter a date value through a recordset object the sql statement does not execute.

i am getting this value from a textfield which is blank.
the idea is to enter date of birth which the user of the form may not know.so to allow null entries.
please help.
thanx

shripad_nayak
October 1st, 2001, 02:31 AM
Make sure that DateField allows Null value. Then,


If (IsDate(MyForm.txtDate) = true) then
m_rs("DateField") = CDate(MyForm.txtDate)
else
m_rs("DateField") = null
End If
m_rs.Update





--Take the life as it comes--

bthomas
October 5th, 2001, 08:50 AM
Hi. Try the Nz function. It handles zero values.

Cakkie
October 5th, 2001, 09:35 AM
Note about that, Nz is only available in VBA, not in real VB.

Tom Cannaerts
slisse@planetinternet.be

Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the universe trying to produce bigger and better idiots. So far, the universe is winning -- Rich Cook