Bem Bia
asked on
CheckListBox usage
I have mysql database wich includes tables:
Manipulation (mid, mname),
Treatment (tid, tname),
Manipulation_treatment (mid, tid)
And i have checklistbox, 2buttons,
2 queries, one fills treatments into checkbox, another one to record data into manipualtion_treatment, IS IT RIGHT SOLUTION? :)
on firstbuttonclick load items (select * from treatment) :
on secondbuttonclick i need to record checked items by treatment_id into manipulation_treatment, can anybody help me?
.......................... .......... .......... ......
Thanks,
Bembia
Manipulation (mid, mname),
Treatment (tid, tname),
Manipulation_treatment (mid, tid)
And i have checklistbox, 2buttons,
2 queries, one fills treatments into checkbox, another one to record data into manipualtion_treatment, IS IT RIGHT SOLUTION? :)
on firstbuttonclick load items (select * from treatment) :
Checklistbox.clear;
Qtreatment.First;
while not Qtreatment.Eof do
begin
Checklistbox.items.AddObject(Qtreatment.FieldByName('treatment_name').AsString, tobject(Qtreatment.fieldbyname('treatment_id').asinteger));
Qtreatment.Next;
on secondbuttonclick i need to record checked items by treatment_id into manipulation_treatment, can anybody help me?
for i := 0 to CheckListBox.Items.Count - 1 do
begin
if CheckListBox.Checked[i] = True then
begin
..........................
Thanks,
Bembia
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thank you!
For Ist Checkboxlist use-
Open in new window
tid - Should be ValuetName - should be display Text
When the user selects any tName internally tid should be passed.
For 2nd Checkboxlist use-
@tid - will be the parameter passed from the above checkbox selection. If you pass multiple comma separated values then you have to split and then use it with the IN clause
Open in new window
Hope it helps!!