Solved

Printing Rich Text from Access 2010

Posted on 2013-10-31
4
371 Views
Last Modified: 2014-07-31
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
0
Comment
Question by:ref-IT
  • 2
4 Comments
 
LVL 31

Accepted Solution

by:
Helen_Feddema earned 250 total points
Comment Utility
You would have to make a report with the appropriate fields from the form's record source, then filter the report's data source by the appropriate ID field from the selected records.  This would be much easier to do with a multi-select listbox, which would allow you to use the ItemsSelected collection.  Actually, this might be required, because you can't select multiple rows in a CF form.  If you have to work with the CF subform, you could perhaps write the ID from each selected row in turn to another table, and use that for filtering the report.  Or you could create a concatenated filter string, saving it to a public variable or a custom database property, for filtering the report.

Some of my Access Archon articles might be helpful here:

Fancy Filters:  http://www.helenfeddema.com/Files/accarch129.zip

Filtering by Multiple Selections:  http://www.helenfeddema.com/Files/accarch197.zip

Rich Text in Access 2007:  http://www.helenfeddema.com/Files/accarch157.zip
0
 
LVL 74

Assisted Solution

by:Jeffrey Coachman
Jeffrey Coachman earned 250 total points
Comment Utility
Please only use reports to print.
Then this is easy to control.

<The client wants to be able to select a number of rows >
Select multiple rows how?
Do you need non-contiguous selections?
..In any even you can print reports from multiple listbox selections with something like this attached file:
Access-BasicMultiSelectListBoxRe.accdb
0
 
LVL 2

Author Comment

by:ref-IT
Comment Utility
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
0
 
LVL 2

Author Closing Comment

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

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

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Overview: This article:       (a) explains one principle method to cross-reference invoice items in Quickbooks®       (b) explores the reasons one might need to cross-reference invoice items       (c) provides a sample process for creating a M…
A simple tool to export all objects of two Access files as text and compare it with Meld, a free diff tool.
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

728 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

11 Experts available now in Live!

Get 1:1 Help Now