Gasman
Enthusiastic Amateur
- Local time
- Today, 23:05
- Joined
- Sep 21, 2011
- Messages
- 16,597
Hi all,
In this Letter Project I am now trying a mailmerge.
I created a function to determine whether the name in the letter would be
Mr Joe Blogs
or
Mr Joe Blogs & Mrs July Blogs
Works fine in the query qryMergeFields.
When I go to open the Word document that uses Select * from qryMergFields it complains about my function Covernames? Pic attached.
I would have thought that all Word wanted was data, and not concerned of how it was created?
Is there a workaround other than IIF is possible?
My SQL is
as Titles are in a lookup table and the ID in the client table.
TIA
In this Letter Project I am now trying a mailmerge.
I created a function to determine whether the name in the letter would be
Mr Joe Blogs
or
Mr Joe Blogs & Mrs July Blogs
Works fine in the query qryMergeFields.
When I go to open the Word document that uses Select * from qryMergFields it complains about my function Covernames? Pic attached.
I would have thought that all Word wanted was data, and not concerned of how it was created?
Is there a workaround other than IIF is possible?
My SQL is
Code:
SELECT tblLookup.LookUpValue AS Title, tblClient.ForeName, tblClient.MiddleNames, tblClient.Surname, tblClient.Address1, tblClient.Address2, tblClient.Address3, tblClient.Address4, tblClient.Address5, tblClient.PostCode, tblProvider.ProviderName, Format([SumAssured],"Currency") AS CSumAssured, tblLookup_1.LookUpValue AS CoverType, tblClientProduct.CoverTerm, Format([Premium],"Currency") AS CPremium, tblClientProduct.OldCover, tblClientProduct.OldProvider, Format([Disposable],"Currency") AS CDisposable, tblClientProduct.SurvivePeriod, tblClientProduct.Event, CoverNames([tblClient].[ClientID]) AS ClientCover
FROM tblProvider INNER JOIN (tblProduct INNER JOIN ((tblClient INNER JOIN tblLookup ON tblClient.Title = tblLookup.ID) INNER JOIN (tblClientProduct INNER JOIN tblLookup AS tblLookup_1 ON tblClientProduct.CoverType = tblLookup_1.ID) ON tblClient.ClientID = tblClientProduct.ClientID) ON tblProduct.ID = tblClientProduct.ProductID) ON tblProvider.ID = tblProduct.ProviderName;
as Titles are in a lookup table and the ID in the client table.
TIA