By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,505 Members | 1,549 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,505 IT Pros & Developers. It's quick & easy.

Count number of lines in a text box for a report

P: n/a
Is there a way to count how many lines are in a text box on a Access
97 report? I have a report that has a text box and sometimes the box
will be 2 lines long and sometimes 3 lines long. I need some other
text boxes to adjust depending on how many lines are in the text box.

Below is some code I found in this forum but does not work. It does
not matter if I use a CR (Carriage return) Chr$(13) or LF (Linefeed)
Chr$(10) or both.

Dim n As Long
Dim pos As Long
n = 0
pos = 0
Do
pos = InStr(pos + 1, text1, Chr$(13))
n = n + 1
Loop Until pos = 0
text2 = n

Thanks in Advance
Gary

Feb 23 '07 #1
Share this Question
Share on Google+
1 Reply


P: n/a
"BEETHOVEN" <gr*****@sbcglobal.netwrote in
news:11**********************@m58g2000cwm.googlegr oups.com:
Is there a way to count how many lines are in a text box on a
Access 97 report? I have a report that has a text box and
sometimes the box will be 2 lines long and sometimes 3 lines
long. I need some other text boxes to adjust depending on how
many lines are in the text box.

Below is some code I found in this forum but does not work. It
does not matter if I use a CR (Carriage return) Chr$(13) or
LF (Linefeed) Chr$(10) or both.

Dim n As Long
Dim pos As Long
n = 0
pos = 0
Do
pos = InStr(pos + 1, text1, Chr$(13))
n = n + 1
Loop Until pos = 0
text2 = n

Thanks in Advance
Gary
One way to get your boxes to line up is to get the textbox
height property for each box, choose the tallest, and set the
height of the other textboxes in the same row to that value, in
the On_Format event of your section. Remember to set the can
grow and can shrink properties of the section to yes.

--
Bob Quintal

PA is y I've altered my email address.

--
Posted via a free Usenet account from http://www.teranews.com

Feb 24 '07 #2

This discussion thread is closed

Replies have been disabled for this discussion.