Report control doesn't display all the characters in a query field

P

Paul Ponzelli

I have a report control whose ControlSource property is a query field based
on a memo field in the underlying table.

When I set the Control Source directly to the memo field, it displays all
the characters in the field. (The "Can Grow" property of both the report
control and Detail section is set to "Yes").

The problem arises when I create a query field using an expression based on
that memo field in the table. Since I don't usually need to display all the
text in the Memo field in the report, I only want to display the first
couple of paragraphs from the Memo field in the report, and I use the tilde
character ("~") as a placemarker, along with the InStr() and Left()
functions in an expression to obtain all characters in the Memo field
preceding the tilde character.

Here's the expression I'm using:
Highlights:
CStr(IIf(InStr(1,[tblProject.Notes],"~")>0 And
Forms!frmRptProjectList!ckHighlights=-1,
Left([tblProject.Notes],InStr(1,[tblProject.Notes],"~")-1),""))

When I examine the result in the query datasheet view, the expression works
perfectly. In other words, all characters preceding the tilde character in
the memo field are displayed in the query field.

But when I run the report, the control (whose Control Source property is set
to the "Highlights" field in the query) doesn't always display all of the
text in the expression. I don't know if this is relevant, but I noticed
that the control only displays the first 235 to 250 characters from the
query field.

Why would this report control truncate the text from the query field when I
use the expression above, but display all of the text in the field when I
set the Control Source property to the memo field itself?

Thanks in advance,

Paul
 
P

Paul Ponzelli

Thank you for providing the reference source, Allen. It does address
several reasons why Access would truncate a segment of a memo field, as I
have described.

I tried a number of different approaches, but was not successful at
preventing the truncation when the number of characters exceeded 255. But
since it doesn't truncate any data as long as the number of characters is
255 or less, I am limiting my "Highlights" text to 255 characters. It's a
minor inconvenience, but it's one way to get my report to work right.

Again, thank you for the info.

Paul
 

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