Link to home
Start Free TrialLog in
Avatar of Mudasir Noorani
Mudasir NooraniFlag for United Kingdom of Great Britain and Northern Ireland

asked on

Printing Rich Text from Access 2010

Hello Experts,

In an application that I designed for a client using MS Access, I have a Form that has a Sub Form with multiple records linked to the parent form. This Sub Form is a Continuous Form that has a field with Rich Text.

The client wants to be able to select a number of rows and when he clicks a 'Print' button, the Rich Text in the selected rows should be printed.

Any ideas how this can be achieved ?!!?

Thanks you all in advance.

ref-IT
ASKER CERTIFIED SOLUTION
Avatar of Helen Feddema
Helen Feddema
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Mudasir Noorani

ASKER

Hey Experts,

Firstly, I apologise for the delay in response. I got held up with some other projects that I was working on.

Secondly, I truly appreciate your time and assistance in helping me resolve this issue.

I have gone through both your suggestions and they are very helpful, however, let me describe the situation more clearly:

I have put Check Boxes next to the Rich Text Box, to allow the user to select whatever rows that need to be selected (remember this is a Continuous Form). When the user clicks the 'Print' Button, using VBA Code, the application can either:

Method 1:

- Select all the records from the underlying table that the user has checked and have the same ID as the parent record (the Continuous Form is also a Sub Form)
- Using a record-set, output all the data to a word document and send it to a printer

OR

Method 2:

- Simply filter a report based on what the user has checked and has the same ID as the Parent forms ID

Method 1 is longer, but I do not know of any variable in VBA that can hold Rich Text data. Is there any variable in VBA that can hold Rich Text Data? The string variable would only strip the Rich Text of all its formatting and output it as normal text.

Method 2 is a better way of resolving this issue and it is what both of you suggested and I like this way better. However, there is only one problem I'm facing with it.

The text in the Rich Text Box in the report is not always large enough to show all text (as there can be paragraphs upon paragraphs in it). And sometimes, it's too large for the text in it (as there can only be one sentence).

Is there anyway I could increase the height of the Rich Text Box in the report if there was a lot of data in it and decrease the height in the report to fit the amount of text in it ?

Hope it's a bit more clear now.

Thanks,

ref-IT
It's been quite some time before I could award points to this question.

Anyway, thanks to Helen and Boag2000 for all their help.