|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Add data from checkboxes to Access database
I have a column in Access table which accepts Yes/No values. Now on the web page, when the user checks the check box the same has to be entered into the table column accepting the Yes/No values. How do I do it?<br><br><br><br> Thank in advance. <img border="0" src="/forum/emoticons/smilewinkgrin.gif" height="15" width="15" alt="smilewinkgrin" />
|
|
#2
|
||||
|
||||
|
If the checkbox name is chk1, for example:<br><br>if Request.Form("chk1") = "ON" Then<br> '....SQL to set the column to true<br>else<br> '...SQL set the column to false<br>endif<br><br>Your SQL string would be something like this: <br><br>UPDATE Table1 <br>SET column1 = true<br>WHERE somecolumn = 'somevalue'<br><br>Here is a good example on this site: http://www.aspfree.com/authors/adrian/MultipleCheckboxes.asp
|
|
#3
|
|||
|
|||
|
Re:
Another way I use to manipulate the Yes/No Access field is to add it using straight numbers.
Example: INSERT INTO tblTable(chkBox1fld, chkBox2fld) VALUES ( 0, 1) This SQL would set chkBox1fld to false and chkBox2fld to true. This has been tested and worked for Access databases. I think adding a value of -1 is the equivalent of a NULL but I cannot confirm it. |
![]() |
| Viewing: ASP Free Forums > Database > Microsoft SQL Server > Add data from checkboxes to Access database |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|