It looks like you have one column for check boxes, and then one column each for all of the text fields? This depends on that you want to put in the checkbox column, but if you are inserting text to a field for each of the textbox columns and those correspond to a certian checkbox, you will be able to search your table for which textboxes have text for an entry and decide from that which boxes where checked, so you might even be able to just use the checkbox column as your identity (primary key). i.e., data structure like so:
Columns: checkbox / text1 / text2 / text3 / text4
Data: "some number" / "" / "some text" / "" / "some text"
If you were to query that data row above, you would be able to see that the check boxes in question are the ones without null text field rows. However, if you allow null text values you'd have to re-think this method a bit.
Anyway, the checkbox field can be whatever you want, and that will just depend on whatever logic you come up with. You could do it the long way and make a reference table that holds a unique value for each combination of textboxes, but this will get long and messy. Using 1 column to signify a checkbox group might not be the best way to do things, but that's not up to me since it's your data. Anyway, with that setup an insert query something like this might work for you:
"INSERT INTO check (checkBoxField,TextField1,TextField2,TextField3...)VALUES (" & "checkboxNumber" & "," & text1.text & ", " & text2.text & ", " & text3.text & ")" ..where *check* is the table name, and checkboxNumber is whatever you decide to put in the checkbox field.
 
No comments:
Post a Comment