[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 350
  • Last Modified:

Detecting the line within a text box

I have an Access database containing a text box object linked to a memo field.  I need to be able to know what line the user is on (within this field).  If they are editing on line 1 - great.  If they are editing line 2 onwards, then it will do something else.

Any suggestions?
Andy Brown
Andy Brown
1 Solution
How are you defining a 'line'?

Does the text contain embedded newline characters?  
Andy BrownAuthor Commented:
Hi Pete.

Line = Verticle position of cursor (for instance line 1 of paragraph 1)

Yes, I was just thinking about determining the cursors position and was that before a carriage return.
Dale FyeCommented:
The problem with memo fields and text for that matter is that when viewed in a textbox, they wrap based on the width of the textbox.  You can easily determine what position within the textbox the cursor is located at using the textboxes selStart property.  But determining what "line" that is on in the textbox depends on the font, fontsize, and width of the textbox.
Good morning. This page may help you


I'll try to implement an example and post soon if it works
Andy BrownAuthor Commented:
Great stuff - thanks guys for your help

Featured Post

[Webinar] Cloud and Mobile-First Strategy

Maybe you’ve fully adopted the cloud since the beginning. Or maybe you started with on-prem resources but are pursuing a “cloud and mobile first” strategy. Getting to that end state has its challenges. Discover how to build out a 100% cloud and mobile IT strategy in this webinar.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now