Dynamic/reusable forms (1 Viewer)

Quote from post #1:
Now finally my question. I am looking for developpers that work in the same area, to share ideas, and to improve the whole process, or articles that cover the same approach.
I don't know why some posts talk about advertising for the marketing of a framework. From the quote above, I understand that you want to share ideas about the design. Am I wrong about this?

As already written in #36, I also use forms from time to time that provide (show) dynamically required controls. However, these forms always have a specific task for me, they just look different or have different control source. Example: Attributes of an article that are different depending on the article group (different names, look-up data, etc.).
If I want to react to an event for an attribute, I intercept this in the form and use the attribute code to check whether something should be done.

Code:
Private Sub txtAttributeValueTxt_GotFocus()
 
   Dim AttributeCode As String
   Dim ...
 
   AttributeCode = Me!fiAttributeCode.Value

   If AttributeCode = "ProductionLock" Then
       ' (open dialog form to select lock state, description, ...)
       ....
   ElseIf ....
This is sufficient for my case, as the number of attributes is manageable.
This would be nothing for a generally usable form.
How do you design this in your form?
 
Last edited:
Quote from post #1:

I don't know why some posts talk about advertising for the marketing of a framework. From the quote above, I understand that you want to share ideas about the design. Am I wrong about this?
Hi Josef,

You are absolutely right! That is the only point.

I agree that a video would have clarified a lot, but I have no expertise to make video.
And publishing an example database: the most important part is the generalized code to make it dynamical.
You must have quite an experience in reverse engineering, to understand how it works.

In a few moments I start an answer to another post, a post without all those cumulated emotions. Perhaps that is also interesting for you.

Have a nice day, Imb.
 
Last edited:
I hate to say, but you TOTALLY MISSED the concept, only ventilating your own ideas.

Imb.
 
I would have started this thread/concept with the smallest idea of creating a single multipurpose form with a little metadata to customize it at runtime. This would have been easier to conceptualize and digest. Most of us have done something like this (as evidenced from many posts) and would follow the logic. The idea could have been slowly developed with an explanation of the ERD of the metadata and snippets of code.

Instead we got
1736436967483.png
 
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.
 

Users who are viewing this thread

Back
Top Bottom