TKO said:
I would prefer make the app executable, but can not create runtime forms with
modules in an .mde file. the forms created at runtime are based on
fieldnames in tables, these are not known at design time. Has anyone
attempted to implement this sort of runtime functionality, to create forms
with modules from an executable (.mde)
The trick to this kind of thing is to **never** create a
form or control at runtime.
At design time, create a form with plenty of invisible text
boxes. Then at runtime, make a text box visible, assign a
field name to its ControlSource and maybe even set its Top,
Left, etc properties as needed. This approach is actually
easier than creating a form and its controls completely in
code and it avoides all the bloat and corruption issues that
might occur with runtime creation.
Hint, name the controls with a common prefix and a
sequential, numerical suffix (e.g. txt1, txt2, etc). Use a
different prefix each control in a group of controls. This
way you can use a trivial allocation scheme when you need
another control:
Me("txt" & intNext).Visible = True
Me("txt" & intNext).ControlSource = strfieldname
Me("lbl" & intNext).Visible = True
. . .
intNext = intNext + 1