Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Adding Entries into Access From Check boxes

Status
Not open for further replies.

jvet4

Technical User
Jul 24, 2000
54
US
I have a form that has 12 checkboxes for the user to select. The user can select any amout of checkboxes. I have an Access table to store the information and want to store the selection in individual cells similiar to:
ID Selection
01 UserSelection1
01 UserSelection2
01 UserSelection3

My question is, What ASP code do I use to get Access to put the users selections into different cells as opposed to putting them into a single cell as a long string.

Thanks, Jason
 
hi,

i will try to answer this. if you create your checkboxes with different names, such as <input type='checkbox' name='chkBox1' value='Y'>, <input type='checkbox' name='chkBox2' value='Y'> and so on, you can reference them by their name. here is an abbreviated example,

con.open strConnect

strSQL=&quot;update
set field1=x&quot;
if request.form(&quot;chkBox1&quot;)=&quot;Y&quot; then strSQL=strSQL & &quot;, fielda=&quot; & request.form(&quot;chkBox1&quot;)
if request.form(&quot;chkBox2&quot;)=&quot;Y&quot; then strSQL=strSQL & &quot;, fieldb=&quot; & request.form(&quot;chkBox2&quot;)
strSQL=strSQL & &quot; where condition=condition&quot;

con.execute strSQL

hope this helps
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top