How to do a user defined letter based on query

  • Thread starter Thread starter Max Moor
  • Start date Start date
M

Max Moor

Hi All,
I want to give users the ability to write a letter that will go out
to contacts returned by a query. I'm not sure how to begin. My first
inclination was to have a form with a huge text box, where they could type
the letter, including bracket enclosed field names. I'd save the contents
as a file when they're done. Then, when printing time comes, I'd have to
open it, parse it, and create a report on the fly, based on the query,
using the file as a template.

Without bringing MS Word into the mix, is there an easier way???

- Max
 
Max said:
I want to give users the ability to write a letter that will go out
to contacts returned by a query. I'm not sure how to begin. My first
inclination was to have a form with a huge text box, where they could type
the letter, including bracket enclosed field names. I'd save the contents
as a file when they're done. Then, when printing time comes, I'd have to
open it, parse it, and create a report on the fly, based on the query,
using the file as a template.

Without bringing MS Word into the mix, is there an easier way???


Word's Mail Merge really is the best way to do that kind of
thing.

You can, however, replace the bracketed field names in the
text by using the Replace function:

strBigText = Replace(strBigText,"[fieldname]",Me.fieldname)
 
Word's Mail Merge really is the best way to do that kind of
thing.

You can, however, replace the bracketed field names in the
text by using the Replace function:

strBigText = Replace(strBigText,"[fieldname]",Me.fieldname)

Hi Marsh,
Yeah, I'd love to go that route. Unfortunately, I don't know that
all my users would have Word. I wish I could.
 
I'm picking away at a solution at the moment. I will post back when I have a
working solution. So far I have the ability to select records and fields to
include and a form for editing the body of the letter with pressing F3 for a
pop-up list of fields to insert.

I had done this once before in Access 2.0 but I can't find any copy of the
file.

--
Duane Hookom
MS Access MVP


Max Moor said:
Word's Mail Merge really is the best way to do that kind of
thing.

You can, however, replace the bracketed field names in the
text by using the Replace function:

strBigText = Replace(strBigText,"[fieldname]",Me.fieldname)

Hi Marsh,
Yeah, I'd love to go that route. Unfortunately, I don't know that
all my users would have Word. I wish I could.
 
I have temporarily place a zip file at
www.access.hookom.net/files/dh_qbf.zip that combines a query by form where
the user can select a data source, choose fields, set criteria and sort
order etc. The results are displayed in a datasheet subform on a main form.
The main form has buttons to send the results to print, html, CSV, Excel,
Word table, Word Merge, Graph, or an Access report of a letter style. Users
can create as many letters as they want since they are stored in a memo
field in a table. When editing the body of a letter, the users presses F3 to
pick a field from the list to insert into the letter. When the letter is
output, the fields are grabbed from the datasource and inserted into the
letter/report.

I will probably get this file hosted at Roger Carlson's site
www.RogersAccessLibrary.com where you can find several other of my demos as
well as lots of others. There is an older version of this file (without the
merge report) available
http://www.rogersaccesslibrary.com/Otherdownload.asp?SampleName='DH Query By Form'

I would appreciate feedback from any users. The report uses a standard text
box so it doesn't support RTF. Perhaps some day I will look at Stephen
Leban's control http://www.lebans.com/richtext.htm

--
Duane Hookom
MS Access MVP


Duane Hookom said:
I'm picking away at a solution at the moment. I will post back when I have a
working solution. So far I have the ability to select records and fields to
include and a form for editing the body of the letter with pressing F3 for a
pop-up list of fields to insert.

I had done this once before in Access 2.0 but I can't find any copy of the
file.

--
Duane Hookom
MS Access MVP


Max Moor said:
Word's Mail Merge really is the best way to do that kind of
thing.

You can, however, replace the bracketed field names in the
text by using the Replace function:

strBigText = Replace(strBigText,"[fieldname]",Me.fieldname)

Hi Marsh,
Yeah, I'd love to go that route. Unfortunately, I don't know that
all my users would have Word. I wish I could.
 
Back
Top