473,698 Members | 2,480 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Looping question

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.Co unt
fieldName = Request.Form.Ke y(i)
fieldValue = Request.Form.It em(i)

if Request.Form.ke y(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

Jun 13 '07 #1
3 1894
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" <da*********@sc ene-double.co.ukwro te in message news:11******** *************@g 37g2000prf.goog legroups.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.Co unt
fieldName = Request.Form.Ke y(i)
fieldValue = Request.Form.It em(i)

if Request.Form.ke y(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

Jun 13 '07 #2
Hello Jon,

My SQL is as follows:-

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

--------------------------------------------------------------------------------------------------------------------------------------------
On 13 Jun, 17:54, "Jon Paal [MSMD]" <Jon nospam Paal @ everywhere dot
comwrote:
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" <davidgor...@sc ene-double.co.ukwro te in messagenews:11* *************** *****@g37g2000p rf.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.Co unt
fieldName = Request.Form.Ke y(i)
fieldValue = Request.Form.It em(i)
if Request.Form.ke y(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


Jun 14 '07 #3
That will return 1 record because you have specified exactly 1 record id.

"David" <da*********@sc ene-double.co.ukwro te in message news:11******** **************@ j4g2000prf.goog legroups.com...
Hello Jon,

My SQL is as follows:-

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

--------------------------------------------------------------------------------------------------------------------------------------------
On 13 Jun, 17:54, "Jon Paal [MSMD]" <Jon nospam Paal @ everywhere dot
comwrote:
>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" <davidgor...@sc ene-double.co.ukwro te in messagenews:11* *************** *****@g37g2000p rf.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.Co unt
fieldName = Request.Form.Ke y(i)
fieldValue = Request.Form.It em(i)
if Request.Form.ke y(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



Jun 14 '07 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
1866
by: Colin Steadman | last post by:
I've create a simple survey using ASP. Its finished and works, but one aspect of my coding is annoying me and I cant figure out a better way of doing it. Basically the questions are stored in an Access 2000 table like this: QUESTION_NUMBER QUESTION 1 Question 1 text.... 2 Question 2 text....
0
1533
by: | last post by:
Greets All, Question on data in datagrid /listbox and looping? I’m trying to decide the best way to write this code. 1 would like the user to make several selections from one listbox/combo box that would Populate another Listbox/datagrid. Then it would cycle through the selections made in the populated listbox/datagrid and do some calculations. The calculations made would have to add the first two numbers in the populated...
0
1402
by: | last post by:
Greets All, Question on data in datagrid /listbox and looping? I’m trying to decide the best way to write this code. 1 would like the user to make several selections from one listbox/combo box that would Populate another Listbox/datagrid. Then it would cycle through the selections made in the populated listbox/datagrid and do some calculations. The calculations made would have to add the first two numbers in the populated...
13
5019
by: JayCallas | last post by:
I know this question has been asked. And the usual answer is don't use cursors or any other looping method. Instead, try to find a solution that uses set-based queries. But this brings up several questions / senarios: * I created several stored procedures that take parameters and inserts the data into the appropriate tables. This was done for easy access/use from client side apps (i.e. web-based).
2
4718
by: clinttoris | last post by:
Hello, If someone could help me it would be appreciated as I am not having much luck. I'm struggling with my asp code and have some questions relating to asp and oracle database. First question. I have a web survey that I am working on and have successfully dynamically taken the info from a database, displayed it on the screen and then taken the users answers and inserted them into a
6
1818
by: Luke - eat.lemons | last post by:
Hi, Im pretty new to asp so all light on this question would be great. Basically i need to test to see what value is set (where to retrieve the data from) so ive done it like this: If Request.Querystring("id") = "" then TidF=Request.Form("TidF") Else
3
1283
by: Luke - eat.lemons | last post by:
Sorry for the post in this NG but im short on time to get this working and i haven't seem to of got a response anywhere else. Im pretty new to asp so all light on this question would be great. Basically i need to test to see what value is set (where to retrieve the data from) so ive done it like this: If Request.Querystring("id") = "" then TidF=Request.Form("TidF")
2
2078
by: Davaa | last post by:
Dear all, I am a student making a MS Form application in C++. I would ask a question about "Timer". Sample code which I am developing is below. private: System::Void buttonStart_Click(System::Object^ sender, System::EventArgs^ e){ for (int i=1; i<=10; i++){ String^ strValue; FunctionName(&strValue); int interval=1000; // time...
3
1950
by: chiku1523 | last post by:
Hi, Please find the following code. In function setAnswers, I am looping with each question. I have inner loop, which is looping for each answers of the questions. If any of the answer for question 1 and question2 is selected this code is working fine. But if None of answer of either question selected, it is not iterating through outer loop. Please help me to point out the error. <html> <head> <style type="text/css"> body...
1
1996
by: Robocop | last post by:
Having just started using C again after some years off, i've been stumped by a problem i think someone more experienced could probably solve pretty easily. I have these 4 objects (vectors), and i want to find a combination of these 4 objects into two pairs, where the sum of a specific attribute of each vector in each pair comes closest to some base value. So all i want to do is run through the permutations of these 4 objects and find the...
0
8676
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9029
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8867
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6522
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5860
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4370
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3050
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2332
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2006
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.