Smart questions
Smart answers
Smart people
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Member Login




Remember Me
Forgot Password?
Join Us!

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips now!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

Join Tek-Tips
*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Donate Today!

Do you enjoy these
technical forums?
Donate Today! Click Here

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.
Jobs from Indeed

Link To This Forum!

Partner Button
Add Stickiness To Your Site By Linking To This Professionally Managed Technical Forum.
Just copy and paste the
code below into your site.

asrg (TechnicalUser)
11 Jul 11 5:40
Hi ..

My page is connected to an Access DB running on IIS 7.

Im simply trying to show an image if the condition is true. I have 4 conditions looking at True/False fileds in the Db..
Ive Tried this code but no real luck ...

Just get error
/fusion/css/Z.ASP, line 187
elseif  (openlist.Fields.Item("netmeetcall").Value)
^


<!-- START if statements -->
<%
if (openlist.Fields.Item("telcall").Value) then response.write ("<img src='../images/icons/mobile_phone.gif' alt='True'>")
elseif  (openlist.Fields.Item("netmeetcall").Value)
then response.write ("<img src='../images/icons/netmeet.gif' alt='True'>")
elseif  (openlist.Fields.Item("opdef").Value)
then response.write ("<img src='../images/icons/tick.gif' alt='True'>")
elseif  (openlist.Fields.Item("emailcall").Value)
then response.write ("<img src='../images/icons/tick.gif' alt='True'>")
else response.write ("nothing")
end if
%>

     <!-- END if statements -->

Im a new technical developer and  stuck ... HELP sad
 
MakeItSo (Programmer)
11 Jul 11 11:24
Your first "if... then" statement is on one line, meaning it starts and ends on that line, no "end if" expected.

When using "if..then..elseif...else...end if", your introducing if ... then statement must be on two lines, like this:

CODE

if (openlist.Fields.Item("telcall").Value) then
 response.write ("<img src='../images/icons/mobile_phone.gif' alt='True'>")

winky smile

Cheers,
MakeItSo

"We had to turn off that service to comply with the CDA Bill."
- The Bastard Operator From Hell

MakeItSo (Programmer)
11 Jul 11 11:25
Also:

does "telcall" return a boolean value? if not, you must first make a comparison:
[code]if (openlist.Fields.Item("telcall").Value = comparetowhateverstring)

"We had to turn off that service to comply with the CDA Bill."
- The Bastard Operator From Hell

asrg (TechnicalUser)
12 Jul 11 4:40
Thanks guys, it works great. Makitso, (openlist.Fields.Item("telcall").Value is true/false.

Code ------ this works great Many thanks Makeitso
<%
if (openlist.Fields.Item("telcall").Value) then
response.write ("<img src='../images/icons/mobile_phone.gif' alt='True'>")
elseif  (openlist.Fields.Item("netmeetcall").Value) then
response.write ("<img src='../images/icons/netmeet.gif' alt='True'>")
elseif  (openlist.Fields.Item("opdef").Value) then
response.write ("<img src='../images/icons/tick.gif' alt='True'>")
elseif  (openlist.Fields.Item("emailcall").Value) then
response.write ("<img src='../images/icons/tick.gif' alt='True'>")
else response.write ("nothing")
end if
%>
asrg (TechnicalUser)
12 Jul 11 5:09
Its attention to the small details in life ... lesson learnt smile

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close