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
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