G
Guest
Hi,
I am trying to create a function to deal with nulls, but I'm enconntering an
error (invalid use of null) by simply passing null to a function.
The following code creates the issue
Sub go()
Dim sreturn As String
sreturn = nulls("hello")
MsgBox "return is :" & sreturn
sreturn = nulls(Null)
MsgBox "return is :" & sreturn
End Sub
Function nulls(instring As String) As String
If IsNull(instring) Then
nulls = ""
Else
nulls = instring
End If
End Function
Does anybody have any ideas?
Many thanks in advance
Andy
I am trying to create a function to deal with nulls, but I'm enconntering an
error (invalid use of null) by simply passing null to a function.
The following code creates the issue
Sub go()
Dim sreturn As String
sreturn = nulls("hello")
MsgBox "return is :" & sreturn
sreturn = nulls(Null)
MsgBox "return is :" & sreturn
End Sub
Function nulls(instring As String) As String
If IsNull(instring) Then
nulls = ""
Else
nulls = instring
End If
End Function
Does anybody have any ideas?
Many thanks in advance
Andy