
Programmatically creating controls from a field list
Paul,
I'm assuming this is not a wizard... you're NOT hoping to be in
design view and actually create controls and then save the form, yes?
Are you hoping for these records to be editable? (or, more
accurately, were you hoping for combo boxes and things?)
I have done this with a subform that's displayed as a datasheet in
non-editable mode.
I made a form w/255 text boxes and associated labels, all unbound
and invisible. I named them from "ctl001" to "ctl255".
Then, when I set the forms recordset, I loop through its .Fields
collection to set the source (and visible property) for each control.
I also use the name of the field to set the text of the label.
-Tom
Quote:
> I am currently in the process of dynamically creating a
> sub-form using different tables.
> When I select a record, that record will refer to one of
> several tables. I need to create a textbox for each field
> in a sub-form and bind that textbox to the selected
> table's field. Any pointers would be appriciated.
> TIA
> Paul