I have the code below which executes perfectly until I added the if... then... end if statement.
Am I just missing something, can I not execute an IF in a recordset loop?
This is the error I am getting:
Microsoft VBScript runtime (0x800A0023)
Sub or Function not defined
/costcenter_Table1.asp, line 108
<%
'______________________________
'Loop thru the records for top of page summary calcs
do While not RS.EOF
CurrentStatus = rs.fields.item("CurrentStatus"
.Value
If CurrentStatus like "*with*" Then
withSum = withSum + RS.Fields.Item("NoteAmount"
.Value
Elseif CurrentStatus like "*den*" Then
denSum = denSum + RS.Fields.Item("NoteAmount"
.Value
Else
closedSum = closedSum + RS.Fields.Item("NoteAmount"
.Value
End If
RS.MoveNext
Loop
'jump back to the first record so that the loop can execute again
Rs.MoveFirst
'______________________________
%>
Am I just missing something, can I not execute an IF in a recordset loop?
This is the error I am getting:
Microsoft VBScript runtime (0x800A0023)
Sub or Function not defined
/costcenter_Table1.asp, line 108
<%
'______________________________
'Loop thru the records for top of page summary calcs
do While not RS.EOF
CurrentStatus = rs.fields.item("CurrentStatus"
If CurrentStatus like "*with*" Then
withSum = withSum + RS.Fields.Item("NoteAmount"
Elseif CurrentStatus like "*den*" Then
denSum = denSum + RS.Fields.Item("NoteAmount"
Else
closedSum = closedSum + RS.Fields.Item("NoteAmount"
End If
RS.MoveNext
Loop
'jump back to the first record so that the loop can execute again
Rs.MoveFirst
'______________________________
%>