How does Access count characters?

R

roccogrand

When I copy text into Word and view the character count, the number is
different than what I get with Len(Trim[fieldname]).

How does Access count characters?

Thanks.

David
 
J

Jeff Boyce

Could you give us a hint? Are the counts off by just one or two, or by a
lot?

Do you have an example of something that Word counted and Access counted,
but came up with different counts?

More info, please...

Regards

Jeff Boyce
Microsoft Access MVP

--
Disclaimer: This author may have received products and services mentioned
in this post. Mention and/or description of a product or service herein
does not constitute endorsement thereof.

Any code or pseudocode included in this post is offered "as is", with no
guarantee as to suitability.

You can thank the FTC of the USA for making this disclaimer
possible/necessary.
 
K

KARL DEWEY

I expect that you find Word as being short as I dought that it counts
carriage returns and line feeds like Access does.
 
R

roccogrand

Thanks for responding.

The field is a Memo field. The counter is in an unbound text box.

I just entered "1" and the length is 33.
Then I entered "1234567890123456789012345678901234567890" and the count is 72.

"1234567890 1234567890 1234567890 1234567890" also gives 72.

What am I doing wrong?

David

Jeff Boyce said:
Could you give us a hint? Are the counts off by just one or two, or by a
lot?

Do you have an example of something that Word counted and Access counted,
but came up with different counts?

More info, please...

Regards

Jeff Boyce
Microsoft Access MVP

--
Disclaimer: This author may have received products and services mentioned
in this post. Mention and/or description of a product or service herein
does not constitute endorsement thereof.

Any code or pseudocode included in this post is offered "as is", with no
guarantee as to suitability.

You can thank the FTC of the USA for making this disclaimer
possible/necessary.

roccogrand said:
When I copy text into Word and view the character count, the number is
different than what I get with Len(Trim[fieldname]).

How does Access count characters?

Thanks.

David


.
 
D

Dirk Goldgar

roccogrand said:
Thanks for responding.

The field is a Memo field. The counter is in an unbound text box.

I just entered "1" and the length is 33.
Then I entered "1234567890123456789012345678901234567890" and the count is
72.

"1234567890 1234567890 1234567890 1234567890" also gives 72.

What am I doing wrong?


So you "counter" text box has a controlsource like:

=Len(Trim([YourMemoFieldName]))

?

My guess is that your memo field has another line of text above what you
see, with a line break in between. Click in the control and press Shift+F2
to open a zoom box on it, and see what's there.
 
R

roccogrand

Thanks Dirk,

There is no other text in the field, as viewed in the Zoom window.

Could it be that RTF adds characters to memo fields?

In one case, Word calculated 1779 with no spaces and 2098 with spaces.
Access calculated 2329 for the same block of text.

If the culprit is RTF then I need to count and sum all RTF formatting
elements individually. Can I do that in Access?

David

Dirk Goldgar said:
roccogrand said:
Thanks for responding.

The field is a Memo field. The counter is in an unbound text box.

I just entered "1" and the length is 33.
Then I entered "1234567890123456789012345678901234567890" and the count is
72.

"1234567890 1234567890 1234567890 1234567890" also gives 72.

What am I doing wrong?


So you "counter" text box has a controlsource like:

=Len(Trim([YourMemoFieldName]))

?

My guess is that your memo field has another line of text above what you
see, with a line break in between. Click in the control and press Shift+F2
to open a zoom box on it, and see what's there.

--
Dirk Goldgar, MS Access MVP
Access tips: www.datagnostics.com/tips.html

(please reply to the newsgroup)
 
R

roccogrand

Part of the problem does appear to be related RTF. I have added a counter to
another Memo field and copied the same text into it. This memo field is set
to Plain Text and the count is much closer to Word's but still not exactly
the same (e.g., Access RTF field = 2565, Access Plain Text = 2097, Word =
2043).

David

Dirk Goldgar said:
roccogrand said:
Thanks for responding.

The field is a Memo field. The counter is in an unbound text box.

I just entered "1" and the length is 33.
Then I entered "1234567890123456789012345678901234567890" and the count is
72.

"1234567890 1234567890 1234567890 1234567890" also gives 72.

What am I doing wrong?


So you "counter" text box has a controlsource like:

=Len(Trim([YourMemoFieldName]))

?

My guess is that your memo field has another line of text above what you
see, with a line break in between. Click in the control and press Shift+F2
to open a zoom box on it, and see what's there.

--
Dirk Goldgar, MS Access MVP
Access tips: www.datagnostics.com/tips.html

(please reply to the newsgroup)
 
J

John W. Vinson

Could it be that RTF adds characters to memo fields?

Absolutely. The formatting "tags" are all characters as far as Access is
concerned, but are "pushed to the background" as just formatting in Word.

I can't think of any builtin - or even easily programmed - way to strip them
out.
 
J

John W. Vinson

Part of the problem does appear to be related RTF. I have added a counter to
another Memo field and copied the same text into it. This memo field is set
to Plain Text and the count is much closer to Word's but still not exactly
the same (e.g., Access RTF field = 2565, Access Plain Text = 2097, Word =
2043).

That's probably carriage-return line-feed pairs; they'd be seen as characters
in Access but as "whitespace" or formatting in Word and ignored.

Could you perhaps explain the purpose of this count? What will you do with the
number when you've calculated it?
 
R

roccogrand

Thanks John.

I have been building a proposal database in Access and I have a side-by-side
screen in the resumes module. For each person's professional experience
statement I need to limit the number of characters sent to a PDF/Word
document to an amount that will fit on one page of text with other
information. This limitation is usually made by the client. That is,
resumes cannot be more than one page.

In addition to the prof experience statement, I may have three or four job
descriptions. In the past I have dealt with this interactively, printing and
looking to see if the text is out of bounds. If I can display the number of
characters then I can hopefully eliminate the interactive step.

You may ask, "Why not use MS Word for resumes?" The reason is that I have
hundreds of resumes and I need to format them in multiple ways--assembling
the parsed fields as required by the customer. I currently have ten
templates built into the module that I use individually or I click one button
and generate all of them.

David
 
J

John W. Vinson

Thanks John.

I have been building a proposal database in Access and I have a side-by-side
screen in the resumes module. For each person's professional experience
statement I need to limit the number of characters sent to a PDF/Word
document to an amount that will fit on one page of text with other
information. This limitation is usually made by the client. That is,
resumes cannot be more than one page.

In addition to the prof experience statement, I may have three or four job
descriptions. In the past I have dealt with this interactively, printing and
looking to see if the text is out of bounds. If I can display the number of
characters then I can hopefully eliminate the interactive step.

You may ask, "Why not use MS Word for resumes?" The reason is that I have
hundreds of resumes and I need to format them in multiple ways--assembling
the parsed fields as required by the customer. I currently have ten
templates built into the module that I use individually or I click one button
and generate all of them.

I really think that you'll need to intertwine Access and Word to accomplish
this, then. The number of characters does not necessarily dictate the size on
the page - fonts, paragraph marks, doublespacing, margins, etc. etc.!

You may have more luck using Word automation, to insert the text from your
memo fields into a Word doc. That would take care of a lot of the differences.
But it's not an area in which I have any experience!
 
R

roccogrand

Thanks again guys.

I am pretty sure now that the problem is due to RTF. I'll remove the tags
and that should work.

Have a great day.

David
 

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