Solved

How to read the text in textbox in limit?

Posted on 2011-09-06
4
239 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
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…

911 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