Gary Williams
04-09-2006, 08:29 AM
Hi All,
I am displaying the contents of 3 fields from an access database using the following code:
<tr><td height="20"></td>
<tr><td bgcolor="#eeeeee">Page 1</td><td><TEXTAREA WRAP=PHYSICAL ID="page1" NAME="page1" ROWS=20 COLS=120 ><%=(ors.Fields.Item("page1").Value)%></TEXTAREA></td></tr>
<tr><td height="20"></td>
<tr><td bgcolor="#c0c0c0">Page 2</td><td><TEXTAREA WRAP=PHYSICAL ID="page2" NAME="page2" ROWS=20 COLS=120 ><%=(ors.Fields.Item("page2").Value)%></TEXTAREA></td></tr>
<tr><td height="20"></td>
<tr><td bgcolor="#eeeeee">Page 3</td><td><TEXTAREA WRAP=PHYSICAL ID="page3" NAME="page3" ROWS=20 COLS=120 ><%=(ors.Fields.Item("page3").Value)%></TEXTAREA></td></tr>
<tr><td height="20"></td>
This works perfectly.
I'm now trying to be clever and replace the above code with a loop. This almost works:
<%
Dim i
For i=1 to 3
response.write "<tr><td height=""20""></td>"
response.write "<tr><td bgcolor=""#eeeeee"">Page "&i&"</td><td><TEXTAREA WRAP=PHYSICAL ID=""page"&i&""" NAME=""page"&i&""" ROWS=""20"" COLS=""120"" >"
response.write "<%=(ors.Fields.Item(""page"&i&""").Value)% >"
response.write "</TEXTAREA></td></tr>"
next
%>
The problem is the end of this 3rd row:
response.write "<%=(ors.Fields.Item(""page"&i&""").Value)% >"
If I close up the space between the " % " and the " > " the script doesn't work.
How can I get this line of code [response.write "<%=(ors.Fields.Item(""page"&i&""").Value)% >"] to produce this [><%=(ors.Fields.Item("page2").Value)%>]?
Regards
Gary
I am displaying the contents of 3 fields from an access database using the following code:
<tr><td height="20"></td>
<tr><td bgcolor="#eeeeee">Page 1</td><td><TEXTAREA WRAP=PHYSICAL ID="page1" NAME="page1" ROWS=20 COLS=120 ><%=(ors.Fields.Item("page1").Value)%></TEXTAREA></td></tr>
<tr><td height="20"></td>
<tr><td bgcolor="#c0c0c0">Page 2</td><td><TEXTAREA WRAP=PHYSICAL ID="page2" NAME="page2" ROWS=20 COLS=120 ><%=(ors.Fields.Item("page2").Value)%></TEXTAREA></td></tr>
<tr><td height="20"></td>
<tr><td bgcolor="#eeeeee">Page 3</td><td><TEXTAREA WRAP=PHYSICAL ID="page3" NAME="page3" ROWS=20 COLS=120 ><%=(ors.Fields.Item("page3").Value)%></TEXTAREA></td></tr>
<tr><td height="20"></td>
This works perfectly.
I'm now trying to be clever and replace the above code with a loop. This almost works:
<%
Dim i
For i=1 to 3
response.write "<tr><td height=""20""></td>"
response.write "<tr><td bgcolor=""#eeeeee"">Page "&i&"</td><td><TEXTAREA WRAP=PHYSICAL ID=""page"&i&""" NAME=""page"&i&""" ROWS=""20"" COLS=""120"" >"
response.write "<%=(ors.Fields.Item(""page"&i&""").Value)% >"
response.write "</TEXTAREA></td></tr>"
next
%>
The problem is the end of this 3rd row:
response.write "<%=(ors.Fields.Item(""page"&i&""").Value)% >"
If I close up the space between the " % " and the " > " the script doesn't work.
How can I get this line of code [response.write "<%=(ors.Fields.Item(""page"&i&""").Value)% >"] to produce this [><%=(ors.Fields.Item("page2").Value)%>]?
Regards
Gary