I need help
On main form i have combobox with customers. When I select a customer and click button, new form appears (ie. form2). I want to put controls on form2 taken from mysql.
My customer's table in mysql looks like:
customer_id; ... ; controls_ids; ...
My control's table looks like:
control_id (autoincrement); label; type; alignment
label - label's caption
type - 0, 1 or 2 (0 - TEdit, 1 - TMemo, 2 - TdateTime)
alignment - text alignment in control (0 - taLeftJustify, 1 - taCenter, 2 - taRightJustify)
Customer's table data:
customerA; 1,2,3,4
customerB; 2,3,4
customerC; 1,3,4
Control's table data:
1; aaaaaa; 0; 0
2; bbbbbb; 1; 0
3; cccccc; 2; 1
4; dddddd; 0, 2
So, when I select customerA and click button, form2 opens with 4 controls - TEdit with leftjustify, TMemo with leftjustify, TDateTime with center alignment, TEdit with leftjustify.
When I select customerB and click button, form2 opens with 3 controls - TMemo with leftjustify, TDateTime with center alignment, TEdit with leftjustify and so on.
Before I put TEdit1.Create I have to declare TEdt1:TEdit in var section, but I don't know what and how many controls I will put on form. Additionally I can add controls to mysql.
Can someone give an idea how to solve my problem?