473,387 Members | 1,789 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Count number of lines in a text box for a report

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
1 5587
"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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

22
by: Ling Lee | last post by:
Hi all. I'm trying to write a program that: 1) Ask me what file I want to count number of lines in, and then counts the lines and writes the answear out. 2) I made the first part like this: ...
1
by: Irfan | last post by:
Hello, I am having some problem with count function. I have a report in which has grouping by a person wise and sub grouping in invoied status e.g.. the output will be Irfan Records (First...
5
by: Cro | last post by:
Hello Access Developers, I'd like to know if it is possible to perform a count in an expression that defines a control source. My report is based on a query. In my report, I want a text box to...
2
by: SJM | last post by:
I have a report that displays records of real estate properties. It is possible for each property to appear a number of times for various reasons. Each record however is unique. What I would like...
3
by: Rabun | last post by:
Heres one that is giving me fits ( = = Access newbie), more than likely something simple that I blew right over . . . any help is appreciated - I have a report based on a query, with several...
23
by: Paul Mars | last post by:
I need to limit multiline textbox to 3 lines of text and if there are less then 3 lines when leaving, add empty line holders. How can I do this?? Thanks, paul
68
by: Martin Joergensen | last post by:
Hi, I have some files which has the following content: 0 0 0 0 0 0 0 1 1 1 1 0 0 1 1 1 1 0 0 1 1 1 1 0 0 1 1 1 1 0 0 0 0 0 0 0
3
by: waynejr25 | last post by:
can anyone help me add a function that will count the occurance of each word in an input file. here's the code i have so far it counts the number of characters, words, and lines but i need the...
14
by: zufie | last post by:
I have to create a QA report regarding callers calling into a phone hotline. The report consists of many checkboxes such as: Did the IBCCP agency contact you? Yes/NO How many days passed...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.