Solved

Text Box

Posted on 2002-07-25
7
164 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
Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

 

Author Comment

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

Accepted Solution

by:
prakashbitra earned 35 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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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…

758 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

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now