Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Add a label to a form programmatically?

Status
Not open for further replies.

aaea73

Technical User
Sep 26, 2002
5
US
Hi,

I wonder if someone can help me with a script that programmatically adds a label control to an existing MS Access form.

Thanks for any help,

aaea73
 
Can't you create the label control in design mode and set the visible setting to false, then set it to true programmatically when required?
 
Shake,

Yes, I've thought about that solution, but I want to insert many labels in the form and I don't know how many of it will be needed at deign time. Any ideas?

Thanks
 
Sorry I can't find any solution to this one. I'll look again this afternoon. If you get anywhere, let me know. Good luck.
 
Below is how you create a label. However, the form must be in design view in order to create the label.

Set ctlNew = CreateControl(Forms("form1").Name, acLabel)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top