Rob, 

1.  Your problem is probably occurring in code you didn't send.  You
need to look at how your recordset is opened and what happens to it
before you begin the code below.  My guess is that you're somehow moving
to the second record (doing a Movenext?) before you start this code,
thereby skipping over the first record.

2.  Don't mean to offend, but there are a lot of things wrong with the
code you've shown us.  You could do what you seem to be doing much more
efficiently!

<%
Dim strLabelText
Dim strInputText
strLabelText = report.Fields.Item("a1")
Select Case strLabelText
  Case "A: Far exceeds job requirements"
    strInputText = "90"
  Case "B: Exceeds job requirements"
    strInputText = "75"
'(etc.)
  Case "T: Unproved"
    strInputText = "0"
  Case Else
    ' what happens if it's NOT one of the above values
End Select
' now that you've got your values, the HTML below appears ONCE!!!
%>
<tr>
  <td><div align="center"><font color="#663366" size="1"><strong><%=
strLabelText %></strong></font></div></td>
  <td><b><font size="2" color="blue"><input name="p1" type="text"
value="<%= strInputText %>" size="3"></font></b></td>
  <td>&nbsp;</td>
</tr>

3.  If you insist on doing it your way, what are all those "End If"s at
the end?  You only need one for the structure you've shown us.

Good luck with your studying.

HTH


-----Original Message-----
From: lamb.rob [mailto:lamb.rob@;dbn.hc.co.za] 
Sent: Tuesday, November 05, 2002 9:08 AM
To: ActiveServerPages
Subject: if then problem


Hi

I have done the following code for a page and its duplicated for 10
question sets.

It works on questions 2-9 but for some reason it will not work for the
first one.  Can anyone help me with this?

Here is the code

-----------------------------------start---------------------------

<% Else If (report.Fields.Item("a1").Value)="B: Exceeds job
requirements" Then %>
                    <td><div align="center"><font color="#663366"
size="1"><strong>B: Exceeds job requirements</strong></font></div></td>
                    <td><b><font size="2" color="blue"><input name="p1"
type="text" value="75" size="3">
                      </font></b> </td>
                    <td>&nbsp;</td>
<% Else If (report.Fields.Item("a1").Value)="C+: Requires slightly less
than average amount of " Then %>
                    <td><div align="center"><font color="#663366"
size="1"><strong>C+: Requires slightly less than average amount of
</strong></font></div></td>
                    <td><b><font size="2" color="blue"><input name="p1"
type="text" value="65" size="3">
                      </font></b> </td>
                    <td>&nbsp;</td>
<% Else If (report.Fields.Item("a1").Value)="C: Meets job requirements"
Then %>
                    <td><div align="center"><font color="#663366"
size="1"><strong>C: Meets job requirements</strong></font></div></td>
                    <td><b><font size="2" color="blue"><input name="p1"
type="text" value="55" size="3">
                      </font></b> </td>
                    <td>&nbsp;</td>
<% Else If (report.Fields.Item("a1").Value)="C-: Performance barely
meets the basic requirements" Then %>
                    <td><div align="center"><font color="#663366"
size="1"><strong>C-: Performance barely meets the basic
requirements</strong></font></div></td>
                    <td><b><font size="2" color="blue"><input name="p1"
type="text" value="47" size="3">
                      </font></b> </td>
                    <td>&nbsp;</td>
<% Else If (report.Fields.Item("a1").Value)="D: Needs some improvement"
Then %>
                    <td><div align="center"><font color="#663366"
size="1"><strong>D: Needs some improvement</strong></font></div></td>
                    <td><b><font size="2" color="blue"><input name="p1"
type="text" value="35" size="3">
                      </font></b> </td>
                    <td>&nbsp;</td>
<% Else If (report.Fields.Item("a1").Value)="E: Does not meet minimum
requirements" Then %>
                    <td><div align="center"><font color="#663366"
size="1"><strong>E: Does not meet minimum
requirements</strong></font></div></td>
                    <td><b><font size="2" color="blue"><input name="p1"
type="text" value="20" size="3">
                      </font></b> </td>
                    <td>&nbsp;</td>
<% Else If (report.Fields.Item("a1").Value)="T: Unproved" Then %>
                    <td><div align="center"><font color="#663366"
size="1"><strong>T: Unproved</strong></font></div></td>
                    <td><b><font size="2" color="blue"><input name="p1"
type="text" value="0" size="3">
                      </font></b> </td>
                    <td>&nbsp;</td>
<% End If %>
<% End If %>
<% End If %>
<% End If %>
<% End If %>
<% End If %>                  
<% End If %>                  
<% End If %>

--------------------------end------------------------

TIA

Rob

---
You are currently subscribed to activeserverpages as:
[EMAIL PROTECTED] To unsubscribe send a blank email to
%%email.unsub%%



---
You are currently subscribed to activeserverpages as: [email protected]
To unsubscribe send a blank email to [EMAIL PROTECTED]

Reply via email to