Click to See Complete Forum and Search --> : Saving an Empty Date


jakemira
July 10th, 2001, 01:35 PM
how can you assign an empty text to a date type field and then save it?

ex.

fieldname is Bdate as date typefield
textname is txtBdate

code is: tablename![Bdate]=txtBdate
error is type mismatch

Iouri
July 10th, 2001, 02:03 PM
In the database in the field definition must be specified that null is allowed.

after that:
if len(txtBdate)=0 then
tablename![Bdate]= vbNull
else
tablename![Bdate]= "#" & txtBdate & "#"
end if

Iouri Boutchkine
iouri@hotsheet.com