Solved

How to read the text in textbox in limit?

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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

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…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
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…

828 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