Steve, I don't see anything wrong with this code.  Your problem may be
in code preceding this, after the Enrollee recordset is created.
Perhaps you do a .Movenext before you hit the code below?

BTW, if you care about stylistic conventions a Do...Loop construct is
preferred by many to the less-flexible While...Wend construct you're
using.  I thought I read somewhere that While...Wend is being deprecated
but a quick search turns up no such information.  <sigh>  Sometimes a
47-year-old brain develops facts entirely on its own.

HTH

-----Original Message-----
From: Steve Abaffy [mailto:[EMAIL PROTECTED]] 
Sent: Thursday, August 22, 2002 10:22 AM
To: ActiveServerPages
Subject: Leaving out last record


Hello,

I have the following piece of code that for some reason does not display
the last record in the recordset, and if there is only one record in the
recordset it does not display that one (as it is also the last record in
the
set) Any help would be greatly apprecitated.

WHILE NOT Enrollee.EOF
        Response.write "<tr>" & vbCRLF
        If CurrentEnrollee = TRIM(Enrollee("CDIPIN")) THEN
                Name = "&nbsp;"
                NewEn = "&nbsp;"
        ELSE
                CurrentEnrolleeSignUpDate = Enrollee("SignUpDate")
                Name = Enrollee("Fname") & " " & Enrollee("Lname")
                CurrentEnrollee = TRIM(Enrollee("CDIPIN"))
                j = j + 1
                if (j mod 2) = 0 then
                        color = "#FFCCCC"
                ELSE
                        color = "#CCCCFF"
                END IF
        END IF
        Response.write "<td bgcolor=""" & color & """><B>" &  NAME &
"</b></td>" & vbCRLF
        Response.write "<td bgcolor=""" & color & """><B>" &
TRIM(Enrollee("CDIPIN")) & "</b></td>" & vbCRLF
        Response.write "<td bgcolor=""" & color & """ align=""right"">"
&
TRIM(Enrollee("ProductCode")) & "</td>" & vbCRLF
        if ISNULL(Enrollee("DateOrdered")) THEN
                Response.write "<td bgcolor=""" & color & """
align=""right""><B>&nbsp;</b></td>" & vbCRLF
        ELSE
                Response.write "<td bgcolor=""" & color & """
align=""right""><B>" &
FormatDateTime(Enrollee("DateOrdered"),2) & "</b></td>" & vbCRLF
        END IF
        Response.write "</tr>" & vbCRLF
        Enrollee.MoveNext
WEND



---
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