[RESOLVED] What the different with this 2 statement ?
Hi all,
I got 2 statement, logically it should be same, but the result is different.
VB Code:
Select Case rs.fields(7)
Case IsNull(rs.fields(7))
itmx.subitems(7) = ""
Case Else
itmx.listsubitems.Add , , "", 1
End Select
VB Code:
If IsNull(rs.fields(7)) Then
itmx.subitems(7) = ""
Else
itmx.listsubitems.Add , , "", 1
End If
Actually i need to detect the record if the record in database is null then it would not display a reporticon else it will display the report Icon. By using the if else statement the reporticon display follow record. However, if i used case statement, all the record displaying reporticon regardless the record is null or not !
Re: What the different with this 2 statement ?
In your case structure, your comparing record column value to a boolean value, if no boolean match then goto Else part. I'm guessing fields(7) is not a boolean value. It should have been (to restrict/conform to boolean test)...
Select Case True
Case IsNull(rs.fields(7))
...
Case Else
...
End Select
Re: What the different with this 2 statement ?
Yes resolved, that was my mistake. I learn one more thing again.. thanks