Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Need Pagination - Subreport - Rich Text Format

Need Pagination - Subreport - Rich Text Format

Need Pagination - Subreport - Rich Text Format

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.

RE: Need Pagination - Subreport - Rich Text Format

Good luck winky smile
With all of the customization and rich text, I would consider automation with MS Word.

Hook'D on Access
MS Access MVP 2001-2016

RE: Need Pagination - Subreport - Rich Text Format

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


SELECT Replace(table1.Paragraph1, "[First_Name]", table2.[First_Name])
FROM table1.MatchKey = Table2.MatchKey

The workaround looks like...


SELECT table1.Paragraph1 
FROM table1.MatchKey = Table2.MatchKey


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

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.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close