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

If/Else statment 1

Status
Not open for further replies.

schase

Technical User
Sep 7, 2001
1,756
US
Access2000

Query called: pilotdetails

Basically what I want to do - is if one cell called fldHideEmail says Yes - I want the word "Hidden" to be displayed, if it says anything other than yes I want it to display the email address in cell email.

heres the code

any ideas?

<%
If (rsUsers.Fields.Item(&quot;fldHideEmail&quot;).Value) = &quot;YES&quot; Then
response.write(&quot;Hidden&quot;)
Else
response.write(rsUsers.Fields.Item(&quot;email&quot;).Value)
End If

%>

Thank you in advance.
 
Use :

<%
If (strComp(rsUsers.Fields.Item(&quot;fldHideEmail&quot;).Value & &quot;&quot;,&quot;YES&quot;,vbtextCompare)=0) Then
response.write(&quot;Hidden&quot;)
Else
response.write(rsUsers.Fields.Item(&quot;email&quot;).Value)
End If

%>

Cheers!

srinu

 
no, if one field has the value of yes - then display on a webpage table cell - &quot;hidden&quot;, if the fields value is anything other than yes - then display whats in another field.

 
Yes u can use what i have sent .. it will write &quot;hidden&quot; when value is &quot;yes&quot;..else it will write email as required for any other thing including null...

hope it helps..

srinu...
 
Hey Srinu,

Sorry your post didnt show until after I had posted earlier to John, your post worked perfectly!

And thank you also John for your inquiry.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top