So, what is the source object of the 20 subform controls? Is it the same form or different forms?
How does the control definitions look?
Sounds like a clever way to deploy applications for those that don't have strict specifications. So it's good.
Hi Edgar_,
Your question points to the right spot for one of the findamentals of this approach.
I will try to explain this as simple as possible. So I will drop for the moment all kind of accompaning remarks.
I have ONE flexible form to make a multitude of representations, on the spot. In fact there are two, one for the continuos case, and one for all the rest. Within my concept that makes no difference, because it is the Control that is important, and the form is just a carrier.
You referred to the form with the subform control, and I will handle that, let us call it the "Mainform".
This Mainform has 20 subform control. The number 20 is just arbitrairely. I use these subforms more or less to create columns in the representation. Each subform control can be loaded with the same "Subform", if necessary. This subform carries 66 (grown through evolution) Textbox controls, without any definition.
Before I continu I have to say the each field in each table/item/identity has a record in a metadata table, the "A_Veld_tbl", with the specification how each field-representation on the form, thus each control, should behave.
When you open a dynamical form, you must give it a name, e.g. "Person". the generalized code searchs for a sub named "Person_Open". In this sub is specified what you want to see on the form. A couple of these result is already shown somewhere in this thread.
In this sub I define where the control is placed, and specified which function it will have: representing a field in an Item, or be a Label, Commandbutton, ... If it is a Textbox, an Item and Fieldname are defined, and searched in the A_veld_tbl to catch the A_veld_id. This A_Veld_id is tagged in the control. With ths t you can retrieve the value and display it in the control. I do this for every necessary Subform.
Then the form is displayed. The form itself is not important anymore, but the Control and its Tag.
How the form is reorganised afterwards is not important, as long as the control keeps its tag. But nothing prohibits to change the tag, but that is out of scope on this moment.
Now how work the controls.
Whenever you Enter a control, its Tag identifies which A_Veld_rec must be opened, to have all the attributes for this control, but also the initial value is stored. On Exit, you can immediately identify the "Dirty" state.
In related metadata tables is described all details about validation the data in the control, and actions after changing the value of the control. All these steps are only performd if the control-value has changed.
Depending on preferences, the you can store the new value or not.
How to react after entering, clicking, dblclicking, ... is described in the general code.
If things are application dependant, the program flow is passed on to local subs, named e.g. "Person_Click".
All what is necassary are metadata-tables, shared general code, and if necessary, local code in a general module.
I hope this base-information helps you in understanding the concept.
Imb.