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

Disappearing Field on page?

Status
Not open for further replies.

dongledell

Technical User
Dec 10, 2002
26
GB
In my recordset is a field scheme("ratedesc")

This is displayed at the top of the page in an area using the following code:

<%
If scheme(&quot;ratetype&quot;) = &quot;Fixed&quot; then
%>
<td><%=(scheme.Fields.Item(&quot;rate&quot;).Value)%>%<br> </td>
<%
Else
%>
<td><%=(scheme.Fields.Item(&quot;rate&quot;).Value)%>% over 
<%=(scheme.Fields.Item(&quot;ratedesc&quot;).Value)%> (currently <%=(scheme.Fields.Item(&quot;currate&quot;).Value)%>% )<br> </td>
<%
End if
%>

Further down the page, it needs to be displayed again, but using slightly different criteria:

<%
If scheme(&quot;ratetype&quot;) <> &quot;Tracker&quot; then
%>
<tr>
<td width=&quot;200&quot; valign=&quot;top&quot;><b>Reverting Rate</b></td>
<td><%=(scheme.Fields.Item(&quot;revetingrate&quot;).Value)%>  over <%=(scheme.Fields.Item(&quot;ratedesc&quot;).Value)%><br>
 </td>
</tr>
<%
End if
%>

Basically, if scheme(&quot;ratetype&quot;) Is = &quot;Fixed&quot;, then the first references to ....(&quot;ratedesc&quot;) should be omitted, which it does, and the second should appear, which it does.

However if scheme(&quot;ratetype&quot;) = &quot;Discount&quot;, then the first should should show, which it does, but also the second reference should show as scheme(&quot;ratetype&quot;) <> Tracker but it doesn't show?!

How come it works only when Scheme(&quot;ratetype&quot;) = Fixed?
 
mmmm, start by removing blanks

If rtrim(scheme(&quot;ratetype&quot;)) = &quot;Fixed&quot; then
'A
Else
' B
End if

If rtrim(scheme(&quot;ratetype&quot;)) <> &quot;Tracker&quot; then
' C
End if


Fixed: A C
Discount: B C




hth,
Foxbox
ttmug.gif
 
OK, tried that, but no joy. Still disappears when Discount is chosen.

Any other ideas people?
 
No one?!

OK, how about using a case statement instead? Just read a bit on them but not sure how to implement them in this..ermm.. case!
 
&quot;Further down the page&quot;: are you sure scheme(&quot;ratetype&quot;) is not changed in between?

my suggestion is to put several
response.write &quot;>&quot; & scheme(&quot;ratetype&quot;) & &quot;<&quot;
lines in your code to see what the value is...

hth,
Foxbox
ttmug.gif
 
nice idea - thanks foxbox.

I dont think it can be changing as the scheme&quot;ratetype&quot; is taken directly from a single record, and the variable it compares it to is passed to the page by the previous page, but it's worth checking!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top