Solved

How to read the text in textbox in limit?

Posted on 2011-09-06
4
272 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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 86

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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
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 process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
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
Course of the Month8 days, 23 hours left to enroll

615 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