Number of lines in Memo?

G

Guest

Hello,

Anyone know a method to count the number of lines in a memo field?
Unfortunately, using an algorithm with the len( ) function does not help
because the number of characters contained in a line of text can be quite
variable.
 
J

John Nurick

Hi Steve,

You'll need something like Stephen's solution if you need to take
account of font size and word wrapping. If you have a linebreak at the
end of each line, however, all you need is something like this, which
will work in a query or a code module:
(Len([XXX])-Len(Replace([XXX], Chr(13) & Chr(10), "")))/2
where [XXX] is the field or variable.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top