I want to add a Control in every for in my application. Let’s say I have 5 frames…
I want to do someting like this:
Set cControl = Me!iooly&i.Controls.Add("Forms.Label.1", "str12" & i, True)
With cControl
.Caption = "1/2"
.Width = 20
.Height = 8
.Top = 10
.Left = 435
End With
i is a counting variable
the problems is that Me!iooly&i … Can I do this operation when my frames have names la iooly1, iooly2, iooly3 and so on?
Your
Meis presumably a form? This won’t work. Also, theMe!iooly&isyntax doesn’t work, this only works if your string is a constant.You can use the
Formscollection though:This is assuming that the form already exists. If it doesn’t, you need to first load it.