|
-
Nov 26th, 2007, 01:54 AM
#1
Thread Starter
Hyperactive Member
[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 !
Where there is no hope, there can be no endeavor.
There are two ways of rising in the world, either by your own industry or by the folly of others.
-
Nov 26th, 2007, 02:16 AM
#2
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
-
Nov 26th, 2007, 02:22 AM
#3
Thread Starter
Hyperactive Member
Re: What the different with this 2 statement ?
Yes resolved, that was my mistake. I learn one more thing again.. thanks
Where there is no hope, there can be no endeavor.
There are two ways of rising in the world, either by your own industry or by the folly of others.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|