View Single Post
  #13  
Old August 27th, 2004, 08:25 PM
Kevin Sheardy
external usenet poster
 
Posts: n/a
Default

I would have never thought it would have worked because it looks like your
setting the field to a character string of NULL but it works. Thanks a
million.

How did you know this ?


"John Vinson" wrote:

On Wed, 18 Aug 2004 07:09:03 -0700, "Kevin Sheardy"
wrote:

I think that should work as well but I seem to continue to get errors. I use
a public function that is as follows:

Public Function StoreDate(fld As Variant)
If Len(Trim(fld)) = 10 Then
StoreDate = "#" & Trim(fld) & "#"
Else
' StoreDate = Null
'StoreDate = "#" & nullDate & "#"
'StoreDate = "#" & "#"
End If
End Function


Try instead:

Public Function StoreDate(fld as Variant) As String
If IsDate(Trim(fld)) Then
StoreDate = Format(CDate(fld, "\#mm\/dd\/yyyy\#"))
Else
StoreDate = "NULL"
End If
End Function

this is executed after the field has been validated so if the length = 10
then it's a good date, otherwise no date exists. The field should be set to
null or blank. Is it possible to call you so we can discuss this ?


Sure... at my current consulting rates. Email me if you want to
explore this option (jvinson *at* wysardofinfo *dot* com).


John W. Vinson[MVP]
Come for live chats every Tuesday and Thursday
http://go.compuserve.com/msdevapps?loc=us&access=public