Solved

How to read the text in textbox in limit?

Posted on 2011-09-06
4
227 Views
Last Modified: 2012-06-21
Hi! I have a textbox name text1.text it has a word "Schedule" I want to read this using msgbox button only the first five letters. How?

Private Sub Command1_Click()
MsgBox Text1.Text ' here I want only the first five letters will read the msgbox
End Sub
0
Comment
Question by:Whing Dela Cruz
4 Comments
 
LVL 4

Accepted Solution

by:
yesthatbob earned 175 total points
ID: 36489784
MsgBox Left(Text1.Text, 5)

Open in new window

0
 
LVL 85

Assisted Solution

by:Mike Tomlinson
Mike Tomlinson earned 162 total points
ID: 36489787
Use the Left() function:
http://msdn.microsoft.com/en-us/library/aa445061(VS.60).aspx

    MsgBox Left(Text1.Text, 5)
0
 
LVL 14

Assisted Solution

by:Brook Braswell
Brook Braswell earned 163 total points
ID: 36489849
You could also use the Mid function and then should you need to change what you read, the second through sixth char this would work...

Private Sub Command1_Click()
    MsgBox Mid(Text1.Text,1,5)
End Sub
0
 

Author Closing Comment

by:Whing Dela Cruz
ID: 36490032
Thanks! All are working...
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

Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
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…

762 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

18 Experts available now in Live!

Get 1:1 Help Now