Adding controls to open form

  • Thread starter Thread starter Allen Browne
  • Start date Start date
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.
 
Hi All
I would like to known how to add a number of "boxes" to a form that is open.

They will represent the number of squares/rectangles you can cut out of a
given area eg. in a 300 x 300 sheet 9; 100 x 100 boxes will fit, I would
like to display these 9 boxes in a matrix shape on the form.

How do I create these controls "acRectangle" on the fly when the user clicks
a button on the form, and later removing them when the form is closed.

Thanks in advance
 
Thanks Allen

Was hoping for a neater way of handling this problem, other than multiple
invisible controls.
But if it can't be done it can't be done.
Maybe I could make the display an Image control and display the different
configuration as reguired.

Thanks again, least I won't waste any more time pursuring the acDesign path.
 
Back
Top