Dynamically add control to form after form is open.

I have seen this question asked several times, and always the answer is NO. But I am stubborn, and come from other environments where it is easy to dynamically add controls.

I hope there is a way (Access 2000) to do this. Please help me find it. This is so important, as I specialize in dynamically growing forms.

Frustrated Fox.
LVL 17
ramromconsultant Asked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

thenelsonCommented:
Yes you can if the form is open in design mode.  Controls can be added only in design mode.  You use the CreateControl Method to do it:
CreateControl(formname, controltype[, section[, parent[, columnname[, left[, top[, width[, height]]]]]]])
dqmqCommented:
And of course, you can open it in design mode:

docmd.openform "formname", acdesign
Leigh PurvisDatabase DeveloperCommented:
Obviously if you deploy mde's though - you can't add controls (as you can't open a form in design mode).
The usual Access workaround is to provide as many hidden controls as could ever be required on the form - setting them a visible and positioned as required.
Admittedly - it's not as nice as spontaneous control arrays - but Access form controls aren't actual windows as in other environments.
Only the control which currently has the focus is a window in a real sense - the rest are effectively "paint on screen" up til that point - which Access uses as a means of keeping system resource use down.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
ramromconsultant Author Commented:
Thank you. So sad. All my good work in FoxPro can't be easily ported to Access.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Access

From novice to tech pro — start learning today.