Can someone tell me what the correct way of writing this would be, it's driving me nuts :
If rs("nodename") NOT = "Home" Then
Thanks in advance
Ian.
Printable View
Can someone tell me what the correct way of writing this would be, it's driving me nuts :
If rs("nodename") NOT = "Home" Then
Thanks in advance
Ian.
If rs("nodename") NOT = "Home" Then
should be:
the above guarantees that the case issue is resolved, (and i'm assuming it's a field)Code:if UCase(rs.Fields("nodename")) <> "HOME" Then
HTH
Good luck!Code:If Not rs("nodename") = "Home" Then
'or
If rs("nodename") <> "Home Then
'when you read data from a DB the string might return extra
'spaces or it might contain null values which VB won't
'recognize as a string so you should type it in the
'following manner instead
If Trim$(rs("nodename") & "") <> "Home" Then
with a bang(!)
Code:If Trim$(rs!nodename) <> "Home" Then