Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to stop "Invalid use of Null: 'Split'"

Status
Not open for further replies.

cyprus106

Programmer
Apr 30, 2001
654
Here's the code I've got. When I try to execute this code with nothing in rsUsers("Proposals"), it gives me a:
"Invalid use of Null: 'Split'" error...

if Trim(rsUsers(&quot;Proposals&quot;)) <> nothing then

Dim arrUser
arrUser = Split(rsUsers(&quot;Proposals&quot;), &quot;, &quot;)

end if



Cyprus
 
Two options: check for null with the ISNULL() function, or compare to an empty string &quot;&quot;.

Code:
if Not IsNull(Trim(rsUsers(&quot;Proposals&quot;))) Then..
-or-
if Trim(rsUsers(&quot;Proposals&quot;)) <> &quot;&quot; Then..

Try both :)

Posting code? Wrap it with code tags: [ignore]
Code:
[/ignore][code]CodeHere
[ignore][/code][/ignore].
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top