Im having some problems with my nested if statment below! has anyone got any tips or alternative ways of coding this??
the error is
Error Type:
Microsoft VBScript compilation (0x800A03EA)
Syntax error
/toner/view.asp, line 93, column 8
<% OPTION EXPLICIT %>
<!--#include file="common.inc" -->
<%
dim rsveiw
dim strID, strPname, strrequestedby, strdate, strSortBy, strteam
dim intrecordloopcounter
dim strcollected, strcollect, recived
recived = "Collected"
strSortBy = "ID DESC"
strsql = "SELECT tblrequestedasp.* "
strSQL = strSQL & "FROM tblrequestedasp "
strSQL = strSQL & "ORDER BY tblrequestedasp." & strSortBy & ";"
Set rsveiw = Server.CreateObject("ADODB.Recordset"
rsveiw.CursorType = 1
rsveiw.open strSQL, strCon
%>
<body bgcolor="#FFFFFF">
<form action="modify.asp" method="post">
<table width="100%" border="2" cellpadding="3" cellspacing="0" bordercolorlight="#FFFFFF" bordercolordark="#FFFFFF" bgcolor="#FFFFCC" bordercolor="#6699FF" class="unnamed1">
<tr class="tableheading" bgcolor="#003399">
<th align="left" width="15%" bgcolor="0060a5">
<div align="center" class="tableheaders">Date Sent</div>
</th>
<th align="left" width="25%" bgcolor="0060a5">
<div align="center" class="tableheaders">Printer</div>
</th>
<th align="left" width="25%" bgcolor="0060a5">
<div align="center" class="tableheaders">Team</div>
</th>
<th align="left" width="30%" bgcolor="0060a5">
<div align="center" class="tableheaders">Name</div>
</th>
<th align="left" width="10%" bgcolor="0060a5">
<div align="center" class="tableheaders">Collected</div>
</th>
</tr>
<%
For intRecordLoopCounter = 1 to 20
strpname = rsveiw.Fields("printer"
strteam = rsveiw.Fields("team"
strdate = rsveiw.Fields("date"
strID = rsveiw.Fields("name"
strcollect = rsveiw.fields("collected"
if strcollect = true then
strcollected = "YES"
else
strcollected = "NO"
end if
strNTUser = RTrim(Request.ServerVariables("LOGON_USER"
)
iPos = Len(strNTUser) - InStr(1, strNTUser,"\",1)
strNTUser = Right(strNTUser, iPos)
%>
<tr>
<tr class="tableheading" bgcolor="#003399">
<th align="left" width="15%" bgcolor="#CCCCCC">
<div align="center" class="tableheaders"><% response.write strdate %></div>
</th>
<th align="left" width="25%" bgcolor="#CCCCCC">
<div align="center" class="tableheaders"><% response.write strpname %></div>
</th>
<th align="left" width="25%" bgcolor="#CCCCCC">
<div align="center" class="tableheaders"><% response.write strteam %></div>
</th>
<th align="left" width="30%" bgcolor="#CCCCCC">
<div align="center" class="tableheaders"><% response.write strID %></div>
</th>
<th align="left" width="10%" bgcolor="#CCCCCC">
<div align="center" class="tableheaders"><%
if strNTUser = "Chris.Johnson" or "Gareth.Finlay" then
If strcollected = "NO" then
response.write "<input TYPE=checkbox NAME=<%Recived & intRecordLoopCounter %> value = false>"
Else
response.write "<input TYPE=checkbox NAME=<%Recived & intRecordLoopCounter %> value = true>"
End if
Else
response.write strcollected
End if
%></div>
</th>
</tr>
<%
rsveiw.MoveNext
If rsveiw.EOF Then Exit For
Next
%>
</table>
</form>
the error is
Error Type:
Microsoft VBScript compilation (0x800A03EA)
Syntax error
/toner/view.asp, line 93, column 8
<% OPTION EXPLICIT %>
<!--#include file="common.inc" -->
<%
dim rsveiw
dim strID, strPname, strrequestedby, strdate, strSortBy, strteam
dim intrecordloopcounter
dim strcollected, strcollect, recived
recived = "Collected"
strSortBy = "ID DESC"
strsql = "SELECT tblrequestedasp.* "
strSQL = strSQL & "FROM tblrequestedasp "
strSQL = strSQL & "ORDER BY tblrequestedasp." & strSortBy & ";"
Set rsveiw = Server.CreateObject("ADODB.Recordset"
rsveiw.CursorType = 1
rsveiw.open strSQL, strCon
%>
<body bgcolor="#FFFFFF">
<form action="modify.asp" method="post">
<table width="100%" border="2" cellpadding="3" cellspacing="0" bordercolorlight="#FFFFFF" bordercolordark="#FFFFFF" bgcolor="#FFFFCC" bordercolor="#6699FF" class="unnamed1">
<tr class="tableheading" bgcolor="#003399">
<th align="left" width="15%" bgcolor="0060a5">
<div align="center" class="tableheaders">Date Sent</div>
</th>
<th align="left" width="25%" bgcolor="0060a5">
<div align="center" class="tableheaders">Printer</div>
</th>
<th align="left" width="25%" bgcolor="0060a5">
<div align="center" class="tableheaders">Team</div>
</th>
<th align="left" width="30%" bgcolor="0060a5">
<div align="center" class="tableheaders">Name</div>
</th>
<th align="left" width="10%" bgcolor="0060a5">
<div align="center" class="tableheaders">Collected</div>
</th>
</tr>
<%
For intRecordLoopCounter = 1 to 20
strpname = rsveiw.Fields("printer"
strteam = rsveiw.Fields("team"
strdate = rsveiw.Fields("date"
strID = rsveiw.Fields("name"
strcollect = rsveiw.fields("collected"
if strcollect = true then
strcollected = "YES"
else
strcollected = "NO"
end if
strNTUser = RTrim(Request.ServerVariables("LOGON_USER"
iPos = Len(strNTUser) - InStr(1, strNTUser,"\",1)
strNTUser = Right(strNTUser, iPos)
%>
<tr>
<tr class="tableheading" bgcolor="#003399">
<th align="left" width="15%" bgcolor="#CCCCCC">
<div align="center" class="tableheaders"><% response.write strdate %></div>
</th>
<th align="left" width="25%" bgcolor="#CCCCCC">
<div align="center" class="tableheaders"><% response.write strpname %></div>
</th>
<th align="left" width="25%" bgcolor="#CCCCCC">
<div align="center" class="tableheaders"><% response.write strteam %></div>
</th>
<th align="left" width="30%" bgcolor="#CCCCCC">
<div align="center" class="tableheaders"><% response.write strID %></div>
</th>
<th align="left" width="10%" bgcolor="#CCCCCC">
<div align="center" class="tableheaders"><%
if strNTUser = "Chris.Johnson" or "Gareth.Finlay" then
If strcollected = "NO" then
response.write "<input TYPE=checkbox NAME=<%Recived & intRecordLoopCounter %> value = false>"
Else
response.write "<input TYPE=checkbox NAME=<%Recived & intRecordLoopCounter %> value = true>"
End if
Else
response.write strcollected
End if
%></div>
</th>
</tr>
<%
rsveiw.MoveNext
If rsveiw.EOF Then Exit For
Next
%>
</table>
</form>