RTF textbox - report gets stuck on "formatting page" (1 Viewer)

MvJ

New member
Local time
Tomorrow, 00:50
Joined
Mar 6, 2023
Messages
10
Hello everyone,

I am trying to remove a dependency on Stephen Lebans RTF2 addon in a legacy Access application.
In order to achieve this I need to replace all the ActiveX-controls in reports and forms with regular Access textboxes instead.
However, when I do this in a report and Access tries to load the text the program gets stuck on "formatting page - press ctrl+break to cancel" (or something similar in English). The properties for the textbox is as similar as possible to the old ActiveX-control; so record source and filtering is the same, as well as size.
I tried creating a new, identical report, with the same resulting issue.

I'm at my wits end here, so any ideas and suggestions will be highly appreciated!

Thanks!
 

CJ_London

Super Moderator
Staff member
Local time
Today, 23:50
Joined
Feb 19, 2013
Messages
16,616
I would look at the code you are using in the report. It may be there is redundant code still running, or trying to run.

Not sure what you mean by 'load the text'
 
  • Like
Reactions: MvJ

MvJ

New member
Local time
Tomorrow, 00:50
Joined
Mar 6, 2023
Messages
10
The report did use to have a module with some code related to the old ActiveX-control, but I removed it completely.

No, me neither. 😅 When I tried to remove the different components of the report one by one and opening the report it seemed like it was the formatting of the RTF text that causes the error, so that's what I tried to convey. When removing the page numbering it does load the report without getting stuck, but without any text in the textbox and the report becomes several pages long...
 

CJ_London

Super Moderator
Staff member
Local time
Today, 23:50
Joined
Feb 19, 2013
Messages
16,616
you say it is a legacy system - so presumably was a .mdb. Is it still a .mdb or have you upgraded to .accdb? And what version of Access are you running?

If there is no code in the report then sounds more like a data problem - have you run the recordsource to confirm it returns the correct data in the correct format?

RTF in mdb's is different to RTF in .accdb's so if you have upgraded, you may have some legacy formatting code in there somewhere
 
  • Like
Reactions: MvJ

MvJ

New member
Local time
Tomorrow, 00:50
Joined
Mar 6, 2023
Messages
10
Yep, I've recently upgraded to .accdb and I'm running Access 365 32-bit.

Looking at the raw data in the db the old RTF looks like this:
RTF "{\rtf1\ansi\ansicpg1252\deff0\nouicompat\deflang1033{\fonttbl{\f0\fnil\fcharset0 Times New Roman;} ...
And the raw RTF from when I've experimented with Access' built in textbox looks like this:
<div align=center><font face="Times New Roman">&nbsp;&nbsp;&nbsp;<strong> ...
Just like you said, that's quite a difference..!

Do you know of any workaround for this?
 

CJ_London

Super Moderator
Staff member
Local time
Today, 23:50
Joined
Feb 19, 2013
Messages
16,616
Not off the top of my head. Obvious one is to turn off richtext, see what you are left with and see how your report runs

how big are your fields? - typically how many characters? Just wondering if it’s too much.for the cangrow property if set
 
  • Like
Reactions: MvJ

MvJ

New member
Local time
Tomorrow, 00:50
Joined
Mar 6, 2023
Messages
10
They aren't very big at all, at most about 15kB I believe. After turning off richtext I can open the report for an old entry without Access getting stuck at least. There isn't any formatting, of course, and every other page is blank but it opens at least.
 

CJ_London

Super Moderator
Staff member
Local time
Today, 23:50
Joined
Feb 19, 2013
Messages
16,616
every other page is blank implies your report is too wide by a small margin. Reduce the width a bit, or perhaps reduce the margins in page setup.

I presume
After turning off richtext I can open the report for an old entry without Access getting stuck at least

means in your 365 app, not your old app?

With regards the formatting, Although a long text field can hold around 1Gb of data, controls are limited to around 64,000 characters. I'm not sure whether the richtext codes (which are characters after all) count towards this number but suggest do a character count to understand whether this might be an issue

I suspect there is something in the old rtf style (perhaps modified by RTF2 addon) which is not compatible with rich text. Converting to plain text removed the problem. But now convert the plain text back to rich text and see if that works - it won't have the original formatting so will still look like plaintext but should indicate my suspicion is correct. If so it may be a case of undoing whatever RTF2 is doing before upgrading to 365
 
  • Like
Reactions: MvJ

MvJ

New member
Local time
Tomorrow, 00:50
Joined
Mar 6, 2023
Messages
10
Reduce the width a bit
Yep, that removed the blank pages!


means in your 365 app, not your old app?
Yes, I changed the text format property for the textbox back to plain text in the .accdb version.

I suspect there is something in the old rtf style (perhaps modified by RTF2 addon) which is not compatible with rich text.
I agree. There are a few entries in the db I created without the RTF2 addon, with just a regular RTF textbox and they show up in the report just fine.
Trouble is there are some 86000+ entries in the SQL db created with the RTF2 addon that won't be compatible if there is no clever way to work around this issue... 😅
 

ebs17

Well-known member
Local time
Tomorrow, 00:50
Joined
Feb 7, 2020
Messages
1,946
RichText, which was introduced with Access 2007 and is HTML-based, has practically nothing to do with the old RTF format (What is Rich Text Format (RTF)?).

So you would have to take care of a conversion and replace the old control characters with the new HTML tags.

It may be faster if you use an existing converter, search for RTF2HTML
 
  • Like
Reactions: MvJ

MvJ

New member
Local time
Tomorrow, 00:50
Joined
Mar 6, 2023
Messages
10
Thanks so much for the help!

I think I'm going to have to shelve the idea of replacing the ActiveX-stuff for some time.
 

Users who are viewing this thread

Top Bottom