Dynamically creating a combo box

  • Thread starter Thread starter Jonathan Blitz
  • Start date Start date
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."
 
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
 
Back
Top