Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Text Box

Posted on 2002-07-25
7
Medium Priority
?
174 Views
Last Modified: 2011-08-18
If I  know name of textbox .And it's contain in some string.

For example,
dim str1 as String
str1="Text1" ' (Name of TextBox)
Now ,how can I get all the properties of this textbox?
0
Comment
Question by:irina_1973
7 Comments
 
LVL 2

Expert Comment

by:ventond
ID: 7177660
Forget str1.

Text1.text - The visible test
Text1.Backcolor
Text1.Left


etc
0
 
LVL 2

Expert Comment

by:ventond
ID: 7177663
To clarify you might say something like

str1 = Text1.Text
or
Text1.Text = str1

0
 
LVL 6

Expert Comment

by:marconovaro
ID: 7177682

You can access the text1 control using the "controls" collection. For instance, if you have a form and a textBox named Text1, you can use something like this:

Me.Controls("Text1").Text = "ABC"

to access the properties of the textbox named "Text1". If you have that name on a string, you can use:

Me.Controls(myStringName).<Property>

Hope this helps....
Marco
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 

Author Comment

by:irina_1973
ID: 7177781
thanks to everybody
0
 
LVL 1

Accepted Solution

by:
prakashbitra earned 140 total points
ID: 7178034
Me.Controls(str1).Text = <value>

will work try this..
0
 
LVL 2

Expert Comment

by:ventond
ID: 7178694
Prakashbitra,
   Yes, it will work. But why do all that extra typing?(And make the computer do the extra work?)

0
 
LVL 6

Expert Comment

by:marconovaro
ID: 7183720
My answer was correct, too :(
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses

971 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question