Curse you DBNull and/or Is Nothing!
that's right, just a title... we do that here. We also have no logo, or branding or consistent income... However, we DO have a hatred for redundant logic.
Function Notta(ByVal x As Object) As String
Dim ret As String
If (x Is DBNull.Value) OrElse (x Is Nothing) OrElse (x Is String.Empty) Then
ret = ""
Else
Try
ret = CStr(x).Trim
Catch
ret = ""
End Try
End If
Return ret
End Function