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:
I hope there is a solution out there
Many thanks in advance
David
Re: Looping question
am 13.06.2007 18:54:44 von Jon Paal
The problem appears to be in this block:
" **** "SELECT * blah blah blah and response.write all my asp data for
report **** "
You will need to correctly configure the Select statement to build it up from the user chosen form elements
google :
asp -.net dynamnic sql
and then loop through the records to display them.
google:
asp -.net looping through records
"David" wrote in message news:1181745388.553961.92170@g37g2000prf.googlegroups.com...
> 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:
>
>
> I hope there is a solution out there
>
> Many thanks in advance
>
> David
>
Re: Looping question
am 14.06.2007 11:16:02 von davidgordon
Hello Jon,
My SQL is as follows:-
strquery = ""
strquery = "SELECT * FROM reports"
strquery = strquery & " WHERE ((reports.ReportID='" & fieldValue &
"'));"
------------------------------------------------------------ ------------------------------------------------------------ --------------------
On 13 Jun, 17:54, "Jon Paal [MSMD]"
com> wrote:
> The problem appears to be in this block:
>
> " **** "SELECT * blah blah blah and response.write all my asp data for
> report **** "
>
> You will need to correctly configure the Select statement to build it up from the user chosen form elements
>
> google :
>
> asp -.net dynamnic sql
>
> and then loop through the records to display them.
>
> google:
>
> asp -.net looping through records
>
> "David" wrote in messagenews:1181745388.553961.92170@g37g2000prf.googlegroups .com...
> > 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:
> >
>
> > I hope there is a solution out there
>
> > Many thanks in advance
>
> > David
Re: Looping question
am 14.06.2007 18:34:48 von Jon Paal
That will return 1 record because you have specified exactly 1 record id.
"David" wrote in message news:1181812562.367926.295420@j4g2000prf.googlegroups.com...
> Hello Jon,
>
> My SQL is as follows:-
>
> strquery = ""
> strquery = "SELECT * FROM reports"
> strquery = strquery & " WHERE ((reports.ReportID='" & fieldValue &
> "'));"
>
> ------------------------------------------------------------ ------------------------------------------------------------ --------------------
> On 13 Jun, 17:54, "Jon Paal [MSMD]"
> com> wrote:
>> The problem appears to be in this block:
>>
>> " **** "SELECT * blah blah blah and response.write all my asp data for
>> report **** "
>>
>> You will need to correctly configure the Select statement to build it up from the user chosen form elements
>>
>> google :
>>
>> asp -.net dynamnic sql
>>
>> and then loop through the records to display them.
>>
>> google:
>>
>> asp -.net looping through records
>>
>> "David" wrote in messagenews:1181745388.553961.92170@g37g2000prf.googlegroups .com...
>> > 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:
>> >
>>
>> > I hope there is a solution out there
>>
>> > Many thanks in advance
>>
>> > David
>
>
>
>
>