S
Sheldon
Hello -
The following code is returning the error "Invalid cast exception.
Conversion from type DBNull to type Date is not valid." It will return the
recordset if DateWritten has a date in it, but if it does not, I get the
error. Any help will be appreciated1
<snip>
If dsEmailSearch.Tables("tblEmailAdd").Rows(currentEmailRow)("DateWritten")
Is Nothing = True Then
dtpWritten.Value =
dsEmailSearch.Tables("tblEmailAdd").Rows(currentEmailRow)("DateWritten")
txtWritten.Hide()
dtpWritten.Show()
Else
txtWritten.Show()
dtpWritten.Hide()
End If
<snip>
BTW, the data is from tables in a Sql Server 2005 database.
The following code is returning the error "Invalid cast exception.
Conversion from type DBNull to type Date is not valid." It will return the
recordset if DateWritten has a date in it, but if it does not, I get the
error. Any help will be appreciated1
<snip>
If dsEmailSearch.Tables("tblEmailAdd").Rows(currentEmailRow)("DateWritten")
Is Nothing = True Then
dtpWritten.Value =
dsEmailSearch.Tables("tblEmailAdd").Rows(currentEmailRow)("DateWritten")
txtWritten.Hide()
dtpWritten.Show()
Else
txtWritten.Show()
dtpWritten.Hide()
End If
<snip>
BTW, the data is from tables in a Sql Server 2005 database.