Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22
Default Name of Current TextBox on Userform

I have a user form that has a number of text boxes named "T1", "T2", "T3",
etc. I am writing a procedure in which I would like to access the text box
name (since there are different items to put into the text box depending on
the identity of the text box). Specifically, I would like to create a
variable by a command such as

tmp_box="T"&str(box_nbr)

When I then try to use this variable in something like

frm_name.tmp_box.value

It doesn't use the "T1", "T2", etc.

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,202
Default Name of Current TextBox on Userform

Try it this way...

Me.Controls(tmp_box).Text

Rick


"dunnerca" wrote in message
...
I have a user form that has a number of text boxes named "T1", "T2", "T3",
etc. I am writing a procedure in which I would like to access the text
box
name (since there are different items to put into the text box depending
on
the identity of the text box). Specifically, I would like to create a
variable by a command such as

tmp_box="T"&str(box_nbr)

When I then try to use this variable in something like

frm_name.tmp_box.value

It doesn't use the "T1", "T2", etc.


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22
Default Name of Current TextBox on Userform

Great, Rick. Many thanks .... again.

"Rick Rothstein (MVP - VB)" wrote:

Try it this way...

Me.Controls(tmp_box).Text

Rick


"dunnerca" wrote in message
...
I have a user form that has a number of text boxes named "T1", "T2", "T3",
etc. I am writing a procedure in which I would like to access the text
box
name (since there are different items to put into the text box depending
on
the identity of the text box). Specifically, I would like to create a
variable by a command such as

tmp_box="T"&str(box_nbr)

When I then try to use this variable in something like

frm_name.tmp_box.value

It doesn't use the "T1", "T2", etc.



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to force selection of all current text in textbox control onentry? Chrisso Excel Programming 2 November 25th 07 09:55 PM
Userform Textbox [email protected] Excel Programming 3 October 21st 07 05:18 PM
Userform textbox help [email protected] Excel Programming 0 September 16th 06 10:57 PM
textbox setfocus and select current contents rcmodelr Excel Programming 3 August 15th 05 02:05 PM
UserForm TextBox to ActiveSheet TextBox over 256 characters Dan E[_2_] Excel Programming 1 July 28th 03 07:36 PM


All times are GMT +1. The time now is 04:57 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"