Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need Pagination - Subreport - Rich Text Format

Status
Not open for further replies.

lameid

Programmer
Jan 31, 2001
4,208
US
I have been working on enhancing a system that sends letters.

There is enough customization between tasks that each project is implemented as it's own split application.

Some business rules are common about what headers and footers to use. So I implemented these as a common main report.

Then the letter body is on a sub report.

My issue is that I need to get page breaks in the sub report...

A thought would be to group on a key and use force new page. The problem I have here is that many of the the controls have rich text format. So when any grouping is used it fundamentally is running a group query behind the scenes and truncates values to 255 characters. This is a non starter.

My other thought was to use page break controls in the subreport. Apparently these do not work properly in subreports.

Please tell me there is a simple ingenious solution to this problem?

Right now I have two thoughts, neither of which seems good... Break the subreport into multiple subreports and place page break controls between them on the main report. I'd rather not have to deal with the same query running even more times for multiple subreports.

The other would be to have a way to store and recreate all the controls with maybe a particular tag, or not a particular tag, sections etc. So they can be stripped out to store the common business object report (Main Reprot) and polled for updates. I am already doing this for subreports which have few key properties and comparatively easier.

Neither of these feel like a good solution. I'm really hoping for a better idea...
Ultimately I may need the flexibility of the second option if that is it and that is the more cumbersome solution as I'd have to identify which properties to set if I logged them... Not to mention dealing with sections in vba... My brain hurts.

 
Good luck ;-)
With all of the customization and rich text, I would consider automation with MS Word.

Duane
Minnesota
Hook'D on Access
MS Access MVP 2001-2016
 
In the end I fixed my recordsource...

Apparently Access is confused by all manner of things surrounding Long text and Rich text format. The only way to force it to know a value in a query is long text rich text format is for that to be the datatype and text format applied to the field directly selected from the table. A workaround then is to select all the values with calculated fields in a query and select base values in another query that is the first select with a Union All...


So if I had...


Code:
SELECT Replace(table1.Paragraph1, "[First_Name]", table2.[First_Name])
FROM table1.MatchKey = Table2.MatchKey
WHERE ID = 1

The workaround looks like...

Code:
SELECT table1.Paragraph1 
FROM table1.MatchKey = Table2.MatchKey
WHERE False

UNION ALL

SELECT Replace(table1.Paragraph1, "[First_Name]", table2.[First_Name]) as Pargraph1 
FROM table1.MatchKey = Table2.MatchKey
WHERE ID = 1


Clearly I have over simplified the query example for one field only but that demonstrates it.

Forcing the text format and datatype, I am able to group and display fine despite the fact that a query with the starting field looks right.

Similarly if you open the base query in a recordset, it gets weird... It displays the first 255 characters correctly but picks up other values for the remaining length. It would seem it is a memory overrun of some sort in that case. The same Union fixes it.

I tried opening the recordsource in a recordset in the aubreport's open event... This executed and gave me the above behavior and I found that specific issue elsewhere. Fixing the query made it work... but I tried again with bound controls in grouping sections and all worked with Union so here we are. Simply weird, MS needs to provide a way for this stuff to work easily. A CLongRichText function or something.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top