Brad said:
If I wanted to dynamically add new text box controls (or any control for
that matter) to a form at run time how would I go about doing this?
Making design time changes to a form (or report,macro,
module, table) at runtime is a really big No-No.
What you should do is precreate an adequate pool of
invisible controls and, when needed, make them visible and
set their other properties (Top, Left, etc). Simple and
quick!
Tip - to make the pool easier to manage, name them with a
common prefix (e.g. txtA) and a sequential number suffix.
This way you can use a module level variable to hold the
number of the next available control.
With Me("txtA" & intX)
.Top = . . .
.Left = . . .
.ControlsSource = " . . .
.Visible = True
intX = intX + 1
End With