0

I'm getting a runtime error on a for next loop and need: Here's my code:

<%
for i=1 to Trim(UCase(Request.QueryString("print"))).Count
If Trim(UCase(Request.QueryString("print"))) (i) = Trim(UCase(rsAuto.Fields.Item("vin").Value)) Then %>
        <tr>
          <td width="10%" height="45" align="center" valign="middle"><%=(rsAuto.Fields.Item("year").Value)%></td>
          <td width="15%" align="center" valign="middle"><%=(rsAuto.Fields.Item("make").Value)%></td>
          <td width="30%" align="center" valign="middle"><%=(rsAuto.Fields.Item("vin").Value)%></td>
          <td width="15%" align="center" valign="middle"><%=(rsAuto.Fields.Item("title").Value)%></td>
          <td width="25%" align="center" valign="middle"><%=(rsAuto.Fields.Item("ticket").Value)%></td>
          <td align="middle" valign="middle"><%=(rsAuto.Fields.Item("color").Value)%>&nbsp;</td>
        </tr>
        <%
 End If
 Next
 %>

The Error I'm getting is:

Microsoft VBScript runtime error '800a01a8'
Object required: '[string: "1G4HR52K7VH448793, 2"]'

Looking at the URL parameters that are being passed it's not putting the value in the number 2 spot like I thought it would. I get the same error when only one option is being passed as well.

Thank you for any help.

Natalie

Edited by Ezzaral: Added code tags. Please use them to format any code that you post.

2
Contributors
2
Replies
3
Views
6 Years
Discussion Span
Last Post by sourceskill
0

try:

<%
'Note: No Trim() nor UCase() after the "to"
for i=1 to Request.QueryString("print").Count

'NOTE: the (i) is adjacent to querystring
If Trim(UCase( Request.QueryString("print")(i) ))  = Trim(UCase(rsAuto.Fields.Item("vin").Value)) Then %>
<tr>
<td width="10%" height="45" align="center" valign="middle"><%=(rsAuto.Fields.Item("year").Value)%></td>
<td width="15%" align="center" valign="middle"><%=(rsAuto.Fields.Item("make").Value)%></td>
<td width="30%" align="center" valign="middle"><%=(rsAuto.Fields.Item("vin").Value)%></td>
<td width="15%" align="center" valign="middle"><%=(rsAuto.Fields.Item("title").Value)%></td>
<td width="25%" align="center" valign="middle"><%=(rsAuto.Fields.Item("ticket").Value)%></td>
<td align="middle" valign="middle"><%=(rsAuto.Fields.Item("color").Value)%>&nbsp;</td>
</tr>
<%
End If
Next
%>
0

Thank you for your assistance with my issue. I am out of town for a week and will not be able to test the results of the fix on my post until I get back to my office. Hence the urgent request, I was hoping to resolve my problem before I left. I will post a new reply to this thread when I am able to test.

Warmest Regards
sourceskill

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.