Solved

How can I force a new page within a RTF Text Box in Access

Posted on 2011-09-08
9
400 Views
Last Modified: 2012-05-12
Hello Experts,

In an Access application, I try to force a page break within a Rich Text Text Box.
In VisualBasic, when I fill a memo field with <div>Text</div>, I can control the line return. Is there an equivalent for page break ?
I know how to force a page break between two field in an Access Report but I really need to force a page break in the middle of a large memo field.

Thank you for your answers.
0
Comment
Question by:Galadorn
  • 4
  • 4
9 Comments
 
LVL 77

Expert Comment

by:peter57r
ID: 36503994
I doubt whether you can do this at all, but can you just explain how you would work out where the page break was to fall, if it were possible.
0
 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 36504488
A Textbox is just that, a "Text"Box, it is not a "Document"Box..

Even if you used an OLE field, the document gets opened in the native application.
So the Page break would still be displayed there.
Perhaps this would be a better option for you...

Besides, even if this were possible in a Textbox, I have no knowledge of any interface tool that could "navigate" through the "Pages" of a document in this textbox.

So perhaps you could *first* explain your ultimate goal here....


JeffCoachman
0
 

Author Comment

by:Galadorn
ID: 36504839
It's an application for a very demanding customer.
A big database of options is used to create a contract for building or modifying a house.
The secretary choose/pick the different options in the DB thru a form according to the need/demand of the client. And a PDF is then generated thru a report.
Each options are made of an ID, a price and a long description made of bold and underline text, paragraph etc.. And each option is editable by the user. So I choose memo type field for the description of the options. Everything works well except that, depending on the length (number of lines) of one option, page break creates white spaces at the bottom of the page.
So now, my customer ask me to be able to page break one option at the line he chooses to achieve a better presentation and avoid too wide blank at the bottom of pages.

Another solution would be to split the memo field in two in VB, depending on where the secretary has placed a special tag in the memo field but I just wanted to ask you for a quicker/simpler/better solution.
0
 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 36505615
...But again, as I stated, ...a textbox/rich textbox cannot really display "Page breaks".
So can you state what your reference for this functionality is?

AFAIK, a textbox/richtextbox has no way of dealing with a "Page break".
In other words, what are you expecting to see as a "Page Break"
(why not just use a line break or CRLF, ...etc, ... or even <Div>?)

Finally, lets be clear on the terminology.
RTF stands for "Rich Text Format"
This is similar to, ...but not the same as HTML.
In Access 2003 and older, this was true RTF.
In Access 2007 and newer format databases "Rich Text" is really HTML


So we need to also clarify:
What *version* of Access you are using
What Access "Format" the DB is in (This is not the same as the "Version")
If you are generating HTML or true Rich Text

0
U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

 

Author Comment

by:Galadorn
ID: 36505946
This is full Access 2007 and I simply use built in memo type field.
By the way, I'm confused with what it uses : HTML or RTF ? It seems to be more HTML than RTF even if it names it RTF.
I already use <div></div>, <em><strong>... And when you edit a memo text box and you press CTRL-ENTER, it generates <div></div> automaticaly. Same thing with bold (gives <strong>) ...
Not sure how to answer to your "Format" question, sorry. I edit memo field thru a form and when I browse it thru table view, I see tags like <div>, <em>, <strong>...
But if it is HTML, I should be able to force new page with a single tag, am I right ?
0
 
LVL 74

Accepted Solution

by:
Jeffrey Coachman earned 500 total points
ID: 36507270
<I'm confused with what it uses : HTML or RTF ?>
An Access 2007 "Format" database (.accdb) really uses HTML.
(Access 2003 format databases (.mdb) use true Rich Text
I think MS left the name "Rich Text" so as not to "Shock" previous users into thinking that they now had to learn HTML.  
Basically the coded text was always transparent to the user.
All Rich text (and now HTML) formatting allows you to do is format the text easily.


<But if it is HTML, I should be able to force new page with a single tag, am I right ?>
One more time...
A textbox/richtextbox, (or whatever) has no concept of a "Page break".
Line break, ...yes
CR/LF, ...yes
...but not really a "Page break"
I am still unclear of what you are expecting to see with this page break... or what you are trying to accomplish...

Remember that this HTML provides "Basic formatting" only (no css, no xml, ...etc)
Also not that in basic html there is no distinct "Page Break" tag, so again, I am confused as to what you are expecting to see with this "Page Break"

Perhaps I am misunderstanding something, can you post a graphical example of *exactly* what you are expecting to see in your control with text before and after this "page break"...?

(You can see here if you are interested in doing this manually, but this is another topic entirely...)

If you are looking for a direct answer here, ...that answer would seem to be:
    No, this is not possible with Access 2007 (accdb) Rich text/html/memo fields.  

JeffCoachman
0
 

Author Comment

by:Galadorn
ID: 36508822
I'm not surprised by your answer, I was beginning to think the same way.
In fact, the user want that page breaks occurs exactly where he wants according to the meaning of the text. Which is programmatically impossible. I'm almost sure that I won't be able to find rules for this kind of problem because each case will be particuliar.

And if the user can't insert a tag within the memo field that force a page break neither, I think I have no other choice to output the report in a Word document (have seen that before in Access). From Word, the user can do everything to arrange the page and dynamically (now he has to go in the form and generate a pdf to see the result of his changes).
I don't know if there's PDF modifiers that can insert page break or add lines and not costing 500$, I'm not very familiar with this kind of programs.
Because converting my reports to Word documents is not my favorite solution neither because it will cost lot of times. It's a complex report and using the automatic export process to Word gives awful results.
0
 

Author Closing Comment

by:Galadorn
ID: 36534450
Thanks for your explanations.
0
 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 36536919
ok
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
Familiarize people with the process of utilizing SQL Server views from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Access…
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…

914 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now