Im a novice at this but here is what Im trying to accomplish. My
office has hundreds of memos going out on a regular basis. All of
these memos go to a set group of people from a set group of people.
Those people change based on the sender and recipient. The body of the
memos is based on a set number of subjects. I have most of this
automated now but the problem is that in VBA using the Select Case
Method I have told access what to show for the body based on the
subject but the body contains information that needs to be a field from
a query. How do I reference that field? For example a memo to a car
dealer about new cars would have a set body, part of which is the
contact information from the person sending it. So the body would be
something like this:

Dear Mr. [Owner of Dealer]

My office is interested in purchasing 3 new vehicles from your
dealership. When you have time to discuss specifics please contact
Purchasing Officer [PO] at [Phone Number].


Sincerely,



[PO]

Keep in mind that the body of this memo needs to be calculated as well
based on the subject the user selects. I hope this makes sense. My
job has nothing to do with cars but I cant comment on what I do so the
example probably confuses things. Thanks in advance for any help you
can provide!

Rob

Re: How do I add query field values to text in VBA? by Cindy

Cindy
Sat Sep 02 05:06:01 CDT 2006

Hi Rob,

> I have most of this
> automated now but the problem is that in VBA using the Select Case
> Method I have told access what to show for the body based on the
> subject but the body contains information that needs to be a field from
> a query. How do I reference that field?
>
We're missing some pieces from the puzzle. I gather from the description
that you're creating documents from an Access database...

Based on what I can figure out from your message, I'd say put the
"boiler-plate" text in AutoText entries saved in the template you're
using (or should be using) to generate the letters/memos. Place BOOKMARKS
(as in insert/bookmark) where the variable information should appear.

After inserting the appropriate AutoText entry (boiler-plate) for the
type of memo, put the query field information into the matching bookmark.
You'll find sample code for using bookmarks at word.mvps.org

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 17 2005)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow question or
reply in the newsgroup and not by e-mail :-)


Re: How do I add query field values to text in VBA? by Rob

Rob
Tue Sep 05 12:39:26 CDT 2006

Hi Cindy. I initially planned to merge information with a word
template I created. However I am so close to being able to use an
access report for this Im leaning in that direction. Instead of having
to maintain word docs external to my database this would actually be a
report within access. I have everything working except for the
calculated fields within the body which is essentially "calculated" as
well. This will fix it so that instead of hundreds of memos there is
only one, which is created when the user runs the query.

Cindy M. wrote:
> Hi Rob,
>
> > I have most of this
> > automated now but the problem is that in VBA using the Select Case
> > Method I have told access what to show for the body based on the
> > subject but the body contains information that needs to be a field from
> > a query. How do I reference that field?
> >
> We're missing some pieces from the puzzle. I gather from the description
> that you're creating documents from an Access database...
>
> Based on what I can figure out from your message, I'd say put the
> "boiler-plate" text in AutoText entries saved in the template you're
> using (or should be using) to generate the letters/memos. Place BOOKMARKS
> (as in insert/bookmark) where the variable information should appear.
>
> After inserting the appropriate AutoText entry (boiler-plate) for the
> type of memo, put the query field information into the matching bookmark.
> You'll find sample code for using bookmarks at word.mvps.org
>
> Cindy Meister
> INTER-Solutions, Switzerland
> http://homepage.swissonline.ch/cindymeister (last update Jun 17 2005)
> http://www.word.mvps.org
>
> This reply is posted in the Newsgroup; please post any follow question or
> reply in the newsgroup and not by e-mail :-)


Re: How do I add query field values to text in VBA? by Cindy

Cindy
Wed Sep 06 07:55:32 CDT 2006

Hi Rob,

> However I am so close to being able to use an
> access report for this Im leaning in that direction.
>
Sounds good to me :-)

Cindy Meister