G
Guest
Hi,
I want to combine 2 memo inside a unique textbox and to display an empty
line between them. The textbox is part of a bound form and high enough to
display many lines. The form is based on a JOIN statement between tblAcademic
and tblClasses.
Here is the setting for the controlsource property in VBA:
txtReportTxt.ControlSource = "= IIF([tblClasses.ReportHd] Is Not Null AND
[tblAcademic.ReportHd] = Yes, [tblClasses.ReportHd] & Chr(13) & Chr(13),
"""") & [tblAcademic.ReportTxt]"
This code is run without errors. The IIF condition works fine. The problem
is that the Chr(13) has no effect in the textbox. Both memos are concatenated
one after the other as if the Chr function was not there. I have tried Chr(8)
and Chr(10) instead of Chr(13), but it does not change anything. The problem
also arises when I remove the IIF condition and write the concatenation
directly. When I try a random character using Chr, the character is well
placed as it should be, proving that Chr has a certain effect. I have also
tried String(2, 13), but the lack of effect is the same.
The only other possibility that I see is to add these backspaces at the end
of the first memo before saving it, but this would not be an elegant solution
as they should be constantly added and removed when the user edit the memo.
Any idea?
I want to combine 2 memo inside a unique textbox and to display an empty
line between them. The textbox is part of a bound form and high enough to
display many lines. The form is based on a JOIN statement between tblAcademic
and tblClasses.
Here is the setting for the controlsource property in VBA:
txtReportTxt.ControlSource = "= IIF([tblClasses.ReportHd] Is Not Null AND
[tblAcademic.ReportHd] = Yes, [tblClasses.ReportHd] & Chr(13) & Chr(13),
"""") & [tblAcademic.ReportTxt]"
This code is run without errors. The IIF condition works fine. The problem
is that the Chr(13) has no effect in the textbox. Both memos are concatenated
one after the other as if the Chr function was not there. I have tried Chr(8)
and Chr(10) instead of Chr(13), but it does not change anything. The problem
also arises when I remove the IIF condition and write the concatenation
directly. When I try a random character using Chr, the character is well
placed as it should be, proving that Chr has a certain effect. I have also
tried String(2, 13), but the lack of effect is the same.
The only other possibility that I see is to add these backspaces at the end
of the first memo before saving it, but this would not be an elegant solution
as they should be constantly added and removed when the user edit the memo.
Any idea?