ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Accessing a Forms Properties (https://www.excelbanter.com/excel-programming/359408-accessing-forms-properties.html)

Chaplain Doug

Accessing a Forms Properties
 
Excel 2003. I have created a user form called "Initialize." How do I
programmatically reference the properties of controls on the form? For
instance, how would I reference and change the Caption property for a textbox
called TextBox1 on the form called Initialize? Thanks for the help.

Dr. Doug Pruiett
Good News Jail & Prison Ministry
www.goodnewsjail.org

Jim May

Accessing a Forms Properties
 
Seems like textbox controls DO NOT have a Caption property..
You probably want to creat a new control (a label cotrol) which has
(I think) a caption property.

"Chaplain Doug" wrote:

Excel 2003. I have created a user form called "Initialize." How do I
programmatically reference the properties of controls on the form? For
instance, how would I reference and change the Caption property for a textbox
called TextBox1 on the form called Initialize? Thanks for the help.

Dr. Doug Pruiett
Good News Jail & Prison Ministry
www.goodnewsjail.org


Edwin Tam[_7_]

Accessing a Forms Properties
 
The syntax should be like:
Initialize.TextBox1.Text = "hello"

however, if your piece of code is already within the form "Initialize", you
can just refer to the textbox directly:
TextBox1.Text = "hello"

Regards,
Edwin Tam

http://www.vonixx.com

"Chaplain Doug" wrote:

Excel 2003. I have created a user form called "Initialize." How do I
programmatically reference the properties of controls on the form? For
instance, how would I reference and change the Caption property for a textbox
called TextBox1 on the form called Initialize? Thanks for the help.

Dr. Doug Pruiett
Good News Jail & Prison Ministry
www.goodnewsjail.org


Bob Phillips[_6_]

Accessing a Forms Properties
 
A textbox doesn't have a caption. It has a text value though

Initialize.TextBox1.Text = "Doug"

--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)

"Chaplain Doug" wrote in message
...
Excel 2003. I have created a user form called "Initialize." How do I
programmatically reference the properties of controls on the form? For
instance, how would I reference and change the Caption property for a

textbox
called TextBox1 on the form called Initialize? Thanks for the help.

Dr. Doug Pruiett
Good News Jail & Prison Ministry
www.goodnewsjail.org





All times are GMT +1. The time now is 07:26 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com