Dynamically creating a combo box

J

Jonathan Blitz

Is there any way, in VBA, to dynamically create a combo box.

I tried:

Dim cmb as ComboBox
cmd = New ComboBox

but it doesn't like it:

"ActiveX component can't create object"

So, is it possible to do it?

--
Jonathan Blitz
AnyKey Limited
Israel

"When things seem bad
Don't worry and shout
Just count up the times
Things have worked themselves out."
 
M

MacDermott

In Access, unlike some other languages, controls can only be added to a form
programmatically when it is in Design View.
This limits the usefulness of this approach so severely that it is unusual
for programmers to use it.
Two common alternative approaches are:
1. Create all possibly needed controls ahead of time, and set the visible
property of "extras" to false until they are needed.
2. Put the control on a subform, where additional records will create
additional copies.

HTH
- Turtle
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top