A
Allen Browne
You can only CreateControl() in design view.
You could
DoCmd.OpenForm "MyForm", acDesign, WindowMode:=acHidden
add the controls, open in acNormal view, and DeleteControl() before closing.
That kind of design approach will not work if you ever want to release an
MDE, so you may be better off just creating as many rectangles as you will
ever need, and set their properties to display them where and when you want.
Visible, Left, Height, and Width should do the trick.
You could
DoCmd.OpenForm "MyForm", acDesign, WindowMode:=acHidden
add the controls, open in acNormal view, and DeleteControl() before closing.
That kind of design approach will not work if you ever want to release an
MDE, so you may be better off just creating as many rectangles as you will
ever need, and set their properties to display them where and when you want.
Visible, Left, Height, and Width should do the trick.