Share via

Modifying control.layout using VBA using Access >= 2007

Anonymous
2010-07-20T13:25:30+00:00

Hi,

I'm developping an application wher a form creates another form. So I use CreateControl to add controls in this new form.

I wan't to use the stacked layout feature, but the control.layout (as the control.layoutID) property is read-only.

    Set ctl = CreateControl(frm.Name, acLabel, acDetail, parent, , 100, currentTop, 10000, 500)

    With ctl

        .Name = "Label_" & num

        .Caption = label

        '.Layout = acLayoutStacked ' This throws an error about read-only property

        .Properties!Layout = acLayoutStacked ' This does nothing

    end with

How am I supposed to switch my controls to stacked layout ?

Note that with layout == 0, RowStart, RowEnd, ColumnStart and ColumnEnd properties do not exist, so I can't just set them.

Thanks !

Microsoft 365 and Office | Access | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

6 answers

Sort by: Most helpful
  1. Anonymous
    2010-07-20T15:23:07+00:00

    That seems to imply that the table is very strange and may be the root of the problem.

    If you really feel compelled to create a form on the fly, then be sure you are prepared to deal with the consequences.

    Was this answer helpful?

    0 comments No comments