Hi Sandy,
In VBA it would be as follows:
If IsNull(rs.Fields("FieldName").Value) Then
txtFields(0).Text = ""
Else
txtFields(0).Text = rs.Fields("FieldName").Value
End if
That code is what works when using DAO, and it will be
very very similar for ADO objects as well.
Hope that helps.
--
Jim Carlock
http://www.microcosmotalk.com/
Post replies to the newsgroup.
Hi Armin:
I guess I wasn't too clear. These textboxes are not connected to any
database. They are textboxes that can contain a DateTime value or can
contain nothing. I need code that essentially says "If the textbox is
empty, disregard the code that pertains to that textbox."
The error generated is: "System.InvalidCastException. Cast from string ""
to type 'Date' is not valid."
If I could find away to have the textboxes default to a 00:00:00 time value
if they were blank, that would work, but I don't know how to do that.
As long as all the textboxes are filled in with a time, the code works. If
some are left blank, I get the error.
Any ideas?
Sandy