In a Groupbox have multiple boxes, The diagram below:
The data table structure for
I set up A1 Checkbox is selected for data table 1 2 4 6 of 8 update data A2 Checkbox is selected for data table 9 11 12 13 update data For example, I chose the A1 Checkbox, number 5 submission is to insert a record data list The data in the table records for: I chose the A2 Checkbox, number is 6 points to submit to insert a record data list The data in the table records for: Other Checkbox corresponding to the other fields, like this need I wrote how convenient database? With 12 boxes, in actual application, the corresponding field also many, Consult this a good way!
CodePudding user response:
His top!
CodePudding user response:
Can combine the checkBox. Hint, hint can be stored in fields, such as the format fieldA fieldB, fieldC) to deal with, so you don't need to write a bunch of code, All the checkBox onclick can unified handling
If (not TCheckBox (sender). Checked) or (StrToIntDef (edtNum. Text, 0) & lt;> 5) then the exit; //analytical fields and assembled SQL script //write data...
CodePudding user response:
Looking at pictures, is operating the EXCEL table? Local directly with you (such as ADOQuery) EDIT, then we have to do is POST
Submit there to join code: AdoQuery1. Edit; For I:=0 to groupbox1. Do ControlCount - 1 If groupbox1. Controls [I] the ClassName='TCheckBox' then The begin AdoQuery1. Fields [TCheckBox (groupbox1 Controls [I]). The Tag]. AsString:=edtSL. Text;//here for a moment with the CHECKBOX of the TAG to mark your field, the rules themselves think again good, The end; AdoQuery1. Post;
CodePudding user response:
The building Lord still honestly write code, for every check box to write a SQL update feature, chose a few can run when submitted to see a few.