check for null

G

Guest

Why will this not work?
it comes back with an error saying it can't work because the value is null
this is a dataset value retreaved from db and it is null.
call to check for null
Me.txtExtra1.Text = Me.MNS(.usrExtra1)

function to return a default value:
Public Function MNS(ByVal s As Object) As String
If IsDBNull(s) Then
Return String.Empty
Else
Return CType(s, String)
End If
End Function
thnaks
kes
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,764
Messages
2,569,567
Members
45,042
Latest member
icassiem

Latest Threads

Top