>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

Signature
Marsh
MVP [MS Access]
Brad Pears - 23 Jun 2006 16:11 GMT
Thanks for that... I was hoping to be able to simple create/remove hidden
controls (to be used for criteria info) on the fly for a particular
application but I suppose I could do what you suggest.
Thanks,
Brad
>>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?
[quoted text clipped - 19 lines]
> intX = intX + 1
> End With
Marshall Barton - 23 Jun 2006 19:45 GMT
Working with a precreated set of invisible controls is
actually easier than creating new controls. so don't be too
disappointed ;-)

Signature
Marsh
MVP [MS Access]
>Thanks for that... I was hoping to be able to simple create/remove hidden
>controls (to be used for criteria info) on the fly for a particular
[quoted text clipped - 25 lines]
>> intX = intX + 1
>> End With
eos - 27 Jun 2006 14:51 GMT
AUTO-REPLY From George Levitt
Please allow this to confirm a system receipt of your e-mail.
I am out of the office until Wednesday morning (1/12/05) and will not be
reviewing or responding to email or voicemail until that time.
I look forward to replying to your message on Wednesday.
Thanks and warmest regards, George
eos - 27 Jun 2006 14:51 GMT
AUTO-REPLY From George Levitt
Please allow this to confirm a system receipt of your e-mail.
I am out of the office until Wednesday morning (1/12/05) and will not be
reviewing or responding to email or voicemail until that time.
I look forward to replying to your message on Wednesday.
Thanks and warmest regards, George
eos - 27 Jun 2006 14:51 GMT
AUTO-REPLY From George Levitt
Please allow this to confirm a system receipt of your e-mail.
I am out of the office until Wednesday morning (1/12/05) and will not be
reviewing or responding to email or voicemail until that time.
I look forward to replying to your message on Wednesday.
Thanks and warmest regards, George
AUTO-REPLY From George Levitt
Please allow this to confirm a system receipt of your e-mail.
I am out of the office until Wednesday morning (1/12/05) and will not be
reviewing or responding to email or voicemail until that time.
I look forward to replying to your message on Wednesday.
Thanks and warmest regards, George