By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,688 Members | 1,900 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,688 IT Pros & Developers. It's quick & easy.

adding controls in forms from vba

P: n/a
In vb excel i can load a form and write this code for adding labels that
i need during program execution

Set l = frmOrders.Controls.Add("Forms.Label.1")

With l
.Caption = "January"
.FontBold = True
..............
End With

This is inside a loop of 12 months and i want to add labels
only if the record of the month has been filled.

If i use CreateControl i get the error that i can do it
only in view structure.

How can i do it?
Nov 13 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
I always create all the labels in design view, make them invisible, and
only show them if I need them.
Hank Reed

Nov 13 '05 #2

P: n/a

"Hank" <ha********@aol.com> ha scritto nel messaggio
news:11*********************@o13g2000cwo.googlegro ups.com...
I always create all the labels in design view, make them invisible, and
only show them if I need them.
Hank Reed

Yes but it means i should add 60 text controls for 5 strips???

And notmanaging them by code?
Nov 13 '05 #3

P: n/a
Circe wrote:
In vb excel i can load a form and write this code for adding labels that
i need during program execution

Set l = frmOrders.Controls.Add("Forms.Label.1")

With l
.Caption = "January"
.FontBold = True
..............
End With

This is inside a loop of 12 months and i want to add labels
only if the record of the month has been filled.

If i use CreateControl i get the error that i can do it
only in view structure.

How can i do it?

I suppose you can open the form in design mode and open it with hidden
set to True (it's on the command line for opening the form), make your
modes and save and then open in normal mode.
Nov 13 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.