?
Solved

How I append texts in a text box?

Posted on 2001-09-10
12
Medium Priority
?
239 Views
Last Modified: 2008-02-01
Suppose, I have a text box, say Text1 and whose 'MULTILINE' property is set 'TRUE'. Is there any method in the Text Box class which can be used to append texts in the Text Box object Text1.

Subhasis.
0
Comment
Question by:mitra_subhasis
[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
  • 5
  • 2
  • 2
  • +3
12 Comments
 
LVL 1

Expert Comment

by:sanjeevjain1973
ID: 6473238
For append use like this

Text1.Text = Text1.Text & "Apended Text"

Means u can concate & old value of text the aggain assign.

Sanjeev
0
 
LVL 75

Accepted Solution

by:
Anthony Perkins earned 30 total points
ID: 6473254
If you want the appended text to go on separate lines than try something like this:

Text1.Text = Text1.Text & vbCR & "New text"
0
 
LVL 1

Expert Comment

by:sanjeevjain1973
ID: 6473269
vbCrLf is combination carrige return & Linefeed
means Chr(13) + Chr(10) . SO If you want appended text start by next line then Use VbCrLf constant or chr13)& char(10).

Sanjeev
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 75

Expert Comment

by:Anthony Perkins
ID: 6473295
sanjeevjain1973, trust me, vbCr works as advertised:
Text1.Text = Text1.Text & vbCr & "New text"
0
 
LVL 1

Expert Comment

by:harsh008_k
ID: 6473315
To append some text into textbox

1)U can use &
   a)Text1.Text=Text1.Text & "your text"
   b)with space
      Text1.Text=Text1.Text & ""  & "Your text"
2) a)Text1.Text=Text1.Text+"Your Text"
   b)Text1.Text=Text1.Text + "" + "Your Text"    
0
 
LVL 9

Expert Comment

by:Valliappan AN
ID: 6473790
Try this:

Text1.SelStart = Len(Text1.Text)
Text1.SelText = "Your Text"
0
 
LVL 12

Expert Comment

by:jgv
ID: 6474287
acperkins,

Text1.Text = Text1.Text & vbCr & "New text"

Textbox with MultiLine=True will visibly print the carrige return character using the above method. To move to a new line I've always used vbCrLf. What are you doing to get the vbCr to work?
0
 
LVL 75

Expert Comment

by:Anthony Perkins
ID: 6474415
jgv,

I must have been doing drugs or imagined it! So much for arrogance.

Curiously with a VB5 IDE I get the same (except 2 visible symbols) with:

Text1.Text = Text1.Text & vbCrLf & "New Text"

Who knows,

Anthony
0
 
LVL 75

Expert Comment

by:Anthony Perkins
ID: 6474426
jgv,

Never mind the last post. You are right, I had not set the MultiLine property on. duh!

Anthony
0
 

Author Comment

by:mitra_subhasis
ID: 6481518
Your answer is acceptable.
Subhasis.
0
 

Author Comment

by:mitra_subhasis
ID: 6481521
Your answer is acceptable.
Subhasis.
0
 
LVL 75

Expert Comment

by:Anthony Perkins
ID: 6482486
Totally un-deserved. Anthony
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
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…
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 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…
Suggested Courses
Course of the Month10 days, 3 hours left to enroll

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