Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Null date causes #Error 1

Status
Not open for further replies.

oystercracker

Technical User
Jun 11, 2001
13
0
0
US
I wrote a very simple Date function with one date parameter. It is supposed to return 1/1/1999 if the parameter date is Null, else 1/1/2000. A record with a null parameter date returns #Error, while all other records return 1/1/2000 correctly. Changing the Null date in the record does eliminate the #Error. It seems as though the function simply will not accept a record with a null value in its
 
Oyster:

Try:

If IsNull(DateIn) Then
ReturnValue = "1/1/1999"
Else
ReturnValue = "1/1/2000"
End If

Should do it.
Larry De Laruelle
larry1de@yahoo.com

 
Trying to evaluate or assign Null to a non-variant data type causes an #Error MS knowledge base tells me. Changing the Date type to Variant in the function parameters did the trick. Thanks.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top