Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Nathan Franklin Nathan Franklin is offline
external usenet poster
 
Posts: 2
Default mailmerge with access

Hello Guys,

I am struggling with this. I am trying to mail merge using a query from ms
access. I am linking tables from another database on the server and then
setting the datsource mailmerge to this datbase.

The problem when i use the replace function in ms access in my sql query it
causes an error to come up in microsoft word. I have tested this over and
over and can reproduce or get rid the problem every time through use or no
use of the replace function

The error message is
"This operation cannot be completed because of dialog or database engine
failures.Please try again later."

My sql statement is
SELECT FirstName & ' ' & LastName AS Purchaser,
replace(PropertyAddress,Chr(13),'') AS Property_address, '#' &
right('000000000' & InvoiceID,5) AS Invoice, ReportFirstName & ' ' &
ReportLastName AS Requested_by, Address AS Address_1, PhoneNumber & ' ' &
MobileNumber AS Phone, DatePart('d',DateInspected) & '/' &
DatePart('m',DateInspected) & '/' & DatePart('yyyy',DateInspected) AS
Date_of_inspection, FaxNumber AS Fax, '' AS Vendor, '' AS Age, (Select
DatePart('d',DateCreated) & '/' & DatePart('m',DateCreated) & '/' &
DatePart('yyyy',DateCreated) From invoices Where ID = inspections.InvoiceID)
AS Invoice_date
FROM inspections;

special attention on replace(PropertyAddress,Chr(13),'') AS Property_address

I have even tried '' & replace(PropertyAddress,Chr(13),'') AS
Property_address to force a text field, but word still spits the dummy.

Could someone please help me solve this. Thanks!


  #2   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Peter Jamieson Peter Jamieson is offline
external usenet poster
 
Posts: 4,582
Default mailmerge with access

I think you're probably using OLEDB or ODBC to connect to your Access
database, and unfortunately when you do that, there are some functions that
you cannot use. Mostly they are the complex "series" financial functions,
but "replace" is also on the list - it isn't obvious why, but I saw an
explanation ages ago that sugests that for some reason it hasn't been added
to some list that's probably used by the Jet database engine or the OLEDB
provider.

I think you will have to do one of the following things to fix this:
a. create a view (or have someone create a view) in your server dataabse
that does the replace, then link to that view (probably the best way to go
if you can)
b. use DDE to get your data instead of OLEDB/ODBC. Unfortunately Word then
has to start Access, open the database, and so on, but to try it, check Word
Tools|Options|General|"Confirm conversion at Open", go through the process
of connecting to your data source again, and select the DDE option when it
is offered.

Peter Jamieson

"Nathan Franklin" wrote in message
...
Hello Guys,

I am struggling with this. I am trying to mail merge using a query from ms
access. I am linking tables from another database on the server and then
setting the datsource mailmerge to this datbase.

The problem when i use the replace function in ms access in my sql query
it causes an error to come up in microsoft word. I have tested this over
and over and can reproduce or get rid the problem every time through use
or no use of the replace function

The error message is
"This operation cannot be completed because of dialog or database engine
failures.Please try again later."

My sql statement is
SELECT FirstName & ' ' & LastName AS Purchaser,
replace(PropertyAddress,Chr(13),'') AS Property_address, '#' &
right('000000000' & InvoiceID,5) AS Invoice, ReportFirstName & ' ' &
ReportLastName AS Requested_by, Address AS Address_1, PhoneNumber & ' ' &
MobileNumber AS Phone, DatePart('d',DateInspected) & '/' &
DatePart('m',DateInspected) & '/' & DatePart('yyyy',DateInspected) AS
Date_of_inspection, FaxNumber AS Fax, '' AS Vendor, '' AS Age, (Select
DatePart('d',DateCreated) & '/' & DatePart('m',DateCreated) & '/' &
DatePart('yyyy',DateCreated) From invoices Where ID =
inspections.InvoiceID) AS Invoice_date
FROM inspections;

special attention on replace(PropertyAddress,Chr(13),'') AS
Property_address

I have even tried '' & replace(PropertyAddress,Chr(13),'') AS
Property_address to force a text field, but word still spits the dummy.

Could someone please help me solve this. Thanks!



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
Mailmerge and Access Steve P. Mailmerge 2 May 25th 06 05:02 PM
Mailmerge picture from an Access Database Rick Microsoft Word Help 1 April 4th 06 05:48 AM
Word Mailmerge with Access via DDE Jim Gilligan Mailmerge 0 November 22nd 05 01:21 PM
Mailmerge Query - Works in Access; fails in Word Gary Stark Mailmerge 4 October 6th 05 07:57 PM
How to use access query computed fields in Word mailmerge Rey Mailmerge 5 June 23rd 05 06:26 PM


All times are GMT +1. The time now is 09:27 AM.

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"