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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Display an img if database value=True 1

Status
Not open for further replies.

DavidC271

Technical User
Jul 30, 2002
17
US
I need help in getting my code right. I am very new at programming and am learning on the fly. I would like to display a checkmark image when the value of my data is true. I have an enum('TRUE','FALSE') data type in my DB. I want ASP to display the check when the value is true and nothing when the value is False. Here is a clip from my code:
...
'Add 4247 Information
str = str & &quot;<TD><FONT FACE=VERDANA SIZE=2>&quot;
str = str & If rs(&quot;Signed_4247&quot;)=&quot;TRUE&quot; Then &quot;<img src=&quot; & &quot;../Images/checkmark3.jpg align=middle ALT=&quot; & &quot;4247 is Signed&quot; & &quot;></FONT>&quot;
str = str & Else rs(&quot;Signed_4247&quot;)=&quot;FALSE&quot; Then &quot;&quot; & End If & &quot;</TD>&quot;
[/b]
'Add Exception Information
str = str & &quot;<TD><FONT FACE=VERDANA SIZE=2>&quot;
str = str & rs(&quot;Exception&quot;) & &quot;</FONT></TD>&quot;
'Add Date Added
str = str & &quot;<TD><FONT FACE=VERDANA SIZE=2>&quot;
str = str & rs(&quot;Date_Added&quot;) & &quot;</FONT></TD>&quot;
'Add Date Modified
str = str & &quot;<TD><FONT FACE=VERDANA SIZE=2>&quot;
str = str & rs(&quot;Date_Modified&quot;) & &quot;</FONT></TD>&quot;
'Close off the <TABLE> row
str = str & &quot;</TR>&quot;

rs.MoveNext
Wend

GetAllRegAssets = str
End Function
...

The lines in red above is where I think my problem is. Could anyone please give me a hand with this? Thanks much.
David C.
 
str = str & &quot;<TD><FONT FACE=VERDANA SIZE=2>&quot;

If rs(&quot;Signed_4247&quot;)=TRUE Then
str = str & &quot;<img src='../Images/checkmark3.jpg' align=middle ALT='4247 is Signed'></FONT></TD>&quot;
Else
str = str & &quot;</FONT></TD>&quot;
end if
BDC.
 
Thanks for the help. I tried your code and I did not get any errors but the image was not displaying. I changed
If rs(&quot;Signed_4247&quot;)=TRUE Then
to
If rs(&quot;Signed_4247&quot;)=&quot;TRUE&quot; Then
and it worked. Now I think I will find an X jpg and use that for the False conditions. Thanks again for the help.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top