?
Solved

Retrieve Lines From Textbox

Posted on 2003-02-24
3
Medium Priority
?
138 Views
Last Modified: 2010-05-01
How can I write a function to retrieve lines from  a text box? I need a function to which I can pass line number from the bottom ( 1 = last line, 2= seconds last line etc) and it returns the appropriate line.
0
Comment
Question by:sambha03
[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
  • 2
3 Comments
 
LVL 26

Accepted Solution

by:
EDDYKT earned 200 total points
ID: 8010512
Try this


Private Function GetLine(ByVal LineNumber)
    Dim line

    line = Split(Text1.Text, vbCrLf)
    If (LineNumber <= UBound(line) + 1) Then
        GetLine = line(LineNumber - 1)
    End If
    erase line
End Function
0
 
LVL 26

Expert Comment

by:EDDYKT
ID: 8010521
OOhs

Private Function GetLine(ByVal LineNumber)
   Dim line

   line = Split(Text1.Text, vbCrLf)
   If (LineNumber <= UBound(line) + 1) Then
       GetLine = line(ubound(line) - LineNumber)
   End If
   erase line
End Function
0
 

Author Comment

by:sambha03
ID: 8018878
Thanks.
0

Featured Post

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!

Question has a verified solution.

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

If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
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…
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…
Suggested Courses

777 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