Looping question

D

David

Hi,

I have an asp page which lists records out in rows
Each record has a checkbox with a value parameter equal to the
RecordID

When the form is run, it goes to a page which I am trying to create 1
report printed after the other.
i.e. if the user selects 3 records on the form, the report is printed
on the next asp page for record 1 and then straight after it runs the
same data and prints the report for record 2.

In the report page I have the following code:

For i = 1 to Request.Form.Count
fieldName = Request.Form.Key(i)
fieldValue = Request.Form.Item(i)

if Request.Form.key(i) <> "Submit" then

**** "SELECT * blah blah blah and response.write all my asp data for
report ****

end if
Next

The above code prints the report for record 1, but that is all.
What would I need to do to make it print all the selected records

On the initial form I have the following code for each checkbox
against each record:
<input type=checkbox name=printme value=" & RS("ReportID") & ">

I hope there is a solution out there

Many thanks in advance

David
 
D

David

Hello Jon,

My SQL is as follows:-

strquery = ""
strquery = "SELECT * FROM reports"
strquery = strquery & " WHERE ((reports.ReportID='" & fieldValue &
"'));"

--------------------------------------------------------------------------------------------------------------------------------------------
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,065
Latest member
OrderGreenAcreCBD

Latest Threads

Top