Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.word.mailmerge.fields
magicdds-[_2_] magicdds-[_2_] is offline
external usenet poster
 
Posts: 9
Default Albert Kallal Mail Merge from a query

I am using Albert Kallal's mail merge to merge data from my database to
letters in Word. The problem is that when I click on a button on my form to
open the mail merge form, the mail merge form uses the table that the form is
based on to get mergefields.

If I click on a button on the form which opens a second form, If form #2 is
based on the query that I want to use to merge, I can have a button on form#2
that opens the mail merge form. The the mail merge form uses the query that
form#2 uses as the record source as the source for the merge fields.

I would like to use the query that form #2 has as the record source, as the
source for the merge fields. I was wondering if there was a way to click on a
button on form #1 (which uses a table as it's record source) to open the mail
merge form and use the query as the source for the mergefields, without
opening form #2?

Thanks
Mark

  #2   Report Post  
Posted to microsoft.public.access.formscoding,microsoft.public.word.mailmerge.fields
Doug Robbins - Word MVP Doug Robbins - Word MVP is offline
external usenet poster
 
Posts: 8,832
Default Albert Kallal Mail Merge from a query

This is really an Access coding issue so I have cross posted it for you to
microsoft.public.access.formscoding.

I would suggest however that you provide a link to the page of Albert's
website from which you got the information to make it easy for someone to
take a look at the code that you are using.

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP

"magicdds-" wrote in message
...
I am using Albert Kallal's mail merge to merge data from my database to
letters in Word. The problem is that when I click on a button on my form
to
open the mail merge form, the mail merge form uses the table that the form
is
based on to get mergefields.

If I click on a button on the form which opens a second form, If form #2
is
based on the query that I want to use to merge, I can have a button on
form#2
that opens the mail merge form. The the mail merge form uses the query
that
form#2 uses as the record source as the source for the merge fields.

I would like to use the query that form #2 has as the record source, as
the
source for the merge fields. I was wondering if there was a way to click
on a
button on form #1 (which uses a table as it's record source) to open the
mail
merge form and use the query as the source for the mergefields, without
opening form #2?

Thanks
Mark



  #3   Report Post  
Posted to microsoft.public.access.formscoding,microsoft.public.word.mailmerge.fields
Rick A.B. Rick A.B. is offline
external usenet poster
 
Posts: 1
Default Albert Kallal Mail Merge from a query

I am using Albert Kallal's mail merge to merge data from my database to
letters in Word. The problem is that when I click on a button on my form
to
open the mail merge form, the mail merge form uses the table that the form
is
based on to get mergefields.


If I click on a button on the form which opens a second form, If form #2
is
based on the query that I want to use to merge, I can have a button on
form#2
that opens the mail merge form. The the mail merge form uses the query
that
form#2 uses as the record source as the source for the merge fields.


I would like to use the query that form #2 has as the record source, as
the
source for the merge fields. I was wondering if there was a way to click
on a
button on form #1 (which uses a table as it's record source) to open the
mail
merge form and use the query as the source for the mergefields, without
opening form #2?


Thanks
Mark- Hide quoted text -

Mark,

I normally make the query the recordsourse of the mail merge form and
not a table but you can just code the button something like the
following and it should work.

MergeNoPrompts "NameOfDocument.Doc", "DriveLetter:\PathOfDocument",
True, , ("select * from NameOfQuery")

Hope that helps.

Rick
  #4   Report Post  
Posted to microsoft.public.access.formscoding,microsoft.public.word.mailmerge.fields
magicdds-[_2_] magicdds-[_2_] is offline
external usenet poster
 
Posts: 9
Default Albert Kallal Mail Merge from a query

This works well.
Thanks for your help.

I was wondering if you had a solution to this next kink in the puzzle.

The first field in the query is called LETTERNAME.
Each record has all the Merge Fields but the first field is LETTERNAME.
When clicking on the button on the form, the following code runs:

Dim strSQL As String
strSQL = "select * from DayFile"
MergeNoPrompts DLookup("LetterName", "Dayfile"), "C:\Documents and _ &
Settings\Mark\Desktop\NewGen\Word\", True, , strSQL

With that, a letter is created in Word for each record in the table DAYFILE.
However, the letter is the same for each record. That is, the letter that is
merged is the LETTERNAME specified in the first record.

Is there a way to get the letter to be the letter specified in the field
LETTERNAME for each record?

Thanks,
Mark



"Rick A.B." wrote:

I am using Albert Kallal's mail merge to merge data from my database to
letters in Word. The problem is that when I click on a button on my form
to
open the mail merge form, the mail merge form uses the table that the form
is
based on to get mergefields.


If I click on a button on the form which opens a second form, If form #2
is
based on the query that I want to use to merge, I can have a button on
form#2
that opens the mail merge form. The the mail merge form uses the query
that
form#2 uses as the record source as the source for the merge fields.


I would like to use the query that form #2 has as the record source, as
the
source for the merge fields. I was wondering if there was a way to click
on a
button on form #1 (which uses a table as it's record source) to open the
mail
merge form and use the query as the source for the mergefields, without
opening form #2?


Thanks
Mark- Hide quoted text -

Mark,

I normally make the query the recordsourse of the mail merge form and
not a table but you can just code the button something like the
following and it should work.

MergeNoPrompts "NameOfDocument.Doc", "DriveLetter:\PathOfDocument",
True, , ("select * from NameOfQuery")

Hope that helps.

Rick

Reply
Thread Tools
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Mail Merge and MS Query Roger0x1 Microsoft Word Help 1 April 11th 07 04:53 PM
Mail Merge Query minignaz Mailmerge 2 August 1st 06 08:56 AM
Albert Kallal - Merge to Word PMK Microsoft Word Help 3 October 27th 05 09:45 PM
mail merge query jimmy Mailmerge 1 May 17th 05 12:28 PM
how do I set up a query for my mail merge Laura Mailmerge 1 March 22nd 05 09:31 PM


All times are GMT +1. The time now is 05:11 PM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"