Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Mailmerge and Fax / April 2008

Tip: Looking for answers? Try searching our database.

Albert Kallal Mail Merge from a query

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
magicdds- - 25 Apr 2008 05:33 GMT
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
Doug Robbins - Word MVP - 25 Apr 2008 07:39 GMT
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.

Signature

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

>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
[quoted text clipped - 22 lines]
> Thanks
> Mark
Rick A.B. - 25 Apr 2008 14:09 GMT
> >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
[quoted text clipped - 22 lines]
> > 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
magicdds- - 27 Apr 2008 06:52 GMT
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

> > >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
[quoted text clipped - 34 lines]
>
> Rick

Rate this thread:






 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.