Forums
This topic is locked
Compare Result
24 Jan 2003 22:37:40 jacque jd posted:
I populate a recordset of only the "goodies" from a an Access db.A table lists them all with a checkbox first, then a description of the goody, then it's cost.
The user checks which goddies they want, and then submit the form.
The resulting page shows only the goodies that were checked off with their description and cost. I've tried everything. Do Until, For Each Next, etc. What do i use for the checkbox name and value on the preceding page? exactly how do i request the checked items on the next page and also show the descrip and cost?
Thank you
Replies
Replied 25 Jan 2003 03:23:46
25 Jan 2003 03:23:46 Owen Eastwick replied:
Create the list of goodies in a repeat region with a check box next to them. Make the checked value of the checkbox equivalent to the goodies Record ID:
<td><%= rsName.Fields.Item("GoodieDescription"
.Value %></td>
<td><input type="checkbox" name="chkGoodieID" value="<%= rsName.Fields.Item("GoodieID"
.Value %>"></td>
When several checkboxes are checked and the form submitted it will give a comma separated list.
So: <b>Request("chkGoodieID"
</b> will give you: 2, 5, 6, 9, 12
Now you can use this in a SELECT statement to give a recordset that just retreives the items selected, like this:
rsName.Source="SELECT GoodieName, GoodieDescription, GoodiePrice FROM GoodiesTable WHERE GoodieID IN(" & Request("chkGoodieID"
& "
"
Regards
Owen.
-------------------------------------------------------------------------------------------
Used programming books and web development software for sale (UK only):
www.tdsf.co.uk/Shop.htm
Multiple Parameter UD4 / Access 2000 Search Tutorial:
www.tdsf.co.uk/tdsfdemo/
<td><%= rsName.Fields.Item("GoodieDescription"

<td><input type="checkbox" name="chkGoodieID" value="<%= rsName.Fields.Item("GoodieID"

When several checkboxes are checked and the form submitted it will give a comma separated list.
So: <b>Request("chkGoodieID"

Now you can use this in a SELECT statement to give a recordset that just retreives the items selected, like this:
rsName.Source="SELECT GoodieName, GoodieDescription, GoodiePrice FROM GoodiesTable WHERE GoodieID IN(" & Request("chkGoodieID"


Regards
Owen.
-------------------------------------------------------------------------------------------
Used programming books and web development software for sale (UK only):
www.tdsf.co.uk/Shop.htm
Multiple Parameter UD4 / Access 2000 Search Tutorial:
www.tdsf.co.uk/tdsfdemo/
Replied 28 Jan 2003 00:46:32
28 Jan 2003 00:46:32 jacque jd replied:
Thanks Owen, on my result page still cannot display, what has been requested,
Only the first record on database.
any idea.
Thank you
Edited by - jhd on 28 Jan 2003 00:54:18
Only the first record on database.
any idea.
Thank you
Edited by - jhd on 28 Jan 2003 00:54:18
Replied 28 Jan 2003 01:59:45
28 Jan 2003 01:59:45 Owen Eastwick replied:
Have you put the result in a repeat region?
Regards
Owen.
-------------------------------------------------------------------------------------------
Used programming books and web development software for sale (UK only):
www.tdsf.co.uk/tdsfdemo/Shop.htm
Multiple Parameter UD4 / Access 2000 Search Tutorial:
www.tdsf.co.uk/tdsfdemo/
Regards
Owen.
-------------------------------------------------------------------------------------------
Used programming books and web development software for sale (UK only):
www.tdsf.co.uk/tdsfdemo/Shop.htm
Multiple Parameter UD4 / Access 2000 Search Tutorial:
www.tdsf.co.uk/tdsfdemo/
Replied 28 Jan 2003 04:52:10
28 Jan 2003 04:52:10 jacque jd replied:
Thank you so much OWEN it worked