467,212 Members | 1,080 Online
Bytes | Developer Community
Ask Question

Home New Posts Topics Members FAQ

Post your question to a community of 467,212 developers. It's quick & easy.

Adding multiple records with checkboxes

Hi there,

SQL 2000 database with ASP

I've found many things "out there" regarding updating and deleting
multiple records with checkboxes but I can't seem to find anything
about adding them. A user wants to create a price list for their
client and they need to add parts to it in a separate table. I would
like to display the list of parts and the user would select multiple
parts to add to a price list by checking a checkbox and submitting the

I have a form, it dynamically lists all of the parts with a checkbox.

set rs=db.execute("select * from parts")
response.write "<form method=post>"
do while not rs.eof
response.write rs("parts_no") & "<input type=checkbox value=" &
rs("parts_no") & "><br>"
response.write "<input type=submit>"
response.write "</form>"

The user checks the checkbox, clicks submit and it adds the selected
items as records to another table. If somebody could point me in the
right direction, I'd be most appreciative. Thanks in advance.
Jul 19 '05 #1
  • viewed: 2357
1 Reply
SQL IN can be useful since HTML checkboxes with the same name produce a
comma-separated list on the page receiving the post:
strSQL = "SELECT * FROM MyTable WHERE MyID IN (" &
Request.Form("MyIDCheckbox") & ")"

But if the field is a text field instead of numeric, then you'll want to
put something like singe quotes around each item perhaps using the
VBScript Split() function to help do this.


Best regards,
J. Paul Schmidt, Freelance ASP Web Designer
ASP Designer Tips, ASP Web Database Demo, Free ASP Bar Chart Tool...
*** Sent via Devdex http://www.devdex.com ***
Don't just participate in USENET...get rewarded for it!
Jul 19 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

5 posts views Thread by Ralph Freshour | last post: by
13 posts views Thread by Adrian Parker | last post: by
3 posts views Thread by Ankit Aneja | last post: by
10 posts views Thread by chimambo@googlemail.com | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.