I use Word and Access 2007 with a mail-merge OLE DB connection
that works well with the linking of text fields, etc. (type customer and contact information)
My problem is that I need to link into a formatted Word table stored in data type, ActiveX, Access to my Word document.
When I try it says only "151C2E00" in the field, where the table would appear
Someone who has solution! -
Sub Foto()
-
ActiveDocument.MailMerge.OpenDataSource Name:= _
-
"\\vmware-host\Shared Folders\My Documents\Mina datakällor\Foto.accdb" _
-
, ConfirmConversions:=False, ReadOnly:=False, LinkToSource:=True, _
-
AddToRecentFiles:=False, PasswordDocument:="", PasswordTemplate:="", _
-
WritePasswordDocument:="", WritePasswordTemplate:="", Revert:=False, _
-
Format:=wdOpenFormatAuto, Connection:= _
-
"Provider=Microsoft.ACE.OLEDB.12.0;User ID=Admin;Data Source=\\vmware-host\Shared Folders\My Documents\Mina datakällor\Foto.accdb;Mode=Read;Extended Properties="""";Jet OLEDB:System database="""";Jet OLEDB:Registry Path="""";Jet OLEDB:Engine Type=6;Jet OLED" _
-
, SQLStatement:="SELECT * FROM `FR_Kopplat_Till_Word_25`", SQLStatement1 _
-
:="", SubType:=wdMergeSubTypeAccess
-
End Sub
7 1941
I have my doubts about the quotes in the SQL statement: -
SQLStatement:="SELECT * FROM `FR_Kopplat_Till_Word_25`"
-
try:
-
SQLStatement:="SELECT * FROM 'FR_Kopplat_Till_Word_25'"
Nic;o)
NeoPa 32,556
Expert Mod 16PB
As Nico has said, it seem that you have worked on this within a document editor (like Word or Write) rather than in a text editor (EG. Notepad). Document editors often switch quote characters on you, for reasons that make sense in a document - but not in SQL. Never edit SQL in anything but a text editor.
Further info - Quotes (') and Double-Quotes (") - Where and When to use them.
I've tried to change the quotes to " ' " instead but the only difference that the code "151C2E00" In the field, where the "word table" would appear, is empty.
NeoPa 32,556
Expert Mod 16PB - It's not the (")s you should worry about here. It's the (`)s.
I put that in the [code] tags to illustrate the characters more clearly.
Ok that was how I was doing, would not use " ' " but ( ' ) instead,
I am learning all the time.
Have you tried to do the same kind of access and have it work?
It's hard to try for us, not having the same database and merge document.
As the code has disappeared gives the impression that the statement is correct so the next step is to check or the query does return data.
I would also check or the used ActiveX control is the only one in the document and that the fields are inline with the fields from the SELECT.
It's always to be advised to use field names instead of the "*", as an addition of a field to the table could cause havoc...
Nic;o)
NeoPa 32,556
Expert Mod 16PB @Pejo
I don't follow you. The code as posted has (`) embedded within the SQL where there should be ('). Are you saying you've changed those now and it uses just the (')s?
Sign in to post your reply or Sign up for a free account.
Similar topics
by: David Horowitz |
last post by:
Hi folks,
I want to be able to store and retrieve UNSAVED Word documents as BLOBs. I
got all the info for storing them if they're already saved on the file
system. But what if they're not...
|
by: Lee |
last post by:
I have a Word template that is set to merge with our client database. After
I run the merge, I merge to a new document, and then save the new document.
When I reopen this saved document, it prompts...
|
by: svdh2 |
last post by:
I have been looking at a problem the entire week in access, I have
still not been able to find a solution. Hope that you could maybe tell
where to look
Concerns the link between Access and Word....
|
by: Linda Cacina |
last post by:
Hello all you fine folks,
Here is some code I am using to merge data from a single record Access
2K3 table into a NEW word document based on a pre-defined Word merge
template doc. All I want to...
|
by: Dave |
last post by:
Apologies for the newbie question. I have created a vb.net program for
my company that is designed to work with Word Templates (about forty of
them that we commonly use) that are selected by the...
|
by: Jako |
last post by:
Hi guys...
Well once again I'm in a dilemma. Currently I have a RTF2 object in
Access that is linked to a memo field in a table, the reason for this
is so that I can have bullets and numbers in...
|
by: reb0101 |
last post by:
hey all,
I would very much appreciate any help or ideas on how to do this as I am stumped.
I need to develop an access database to track documents but also link to them.
I’ll explain what it...
|
by: rlntemp-gns |
last post by:
Re: Access 2003/Word 2003
I have about 100 motivational documents that I am wanting to import
into a small database and put a front end on it that would allow the
user to select one, read it and...
|
by: Mo |
last post by:
I am trying to produce an Access report which behaves like a two
column table in Word. In other words each cell in column 1 contains a
label and each cell in column 2 contains data from a...
|
by: acc2ess |
last post by:
Hello,
My problem is that I receive different Word Documents as attachments
and I need to get its data into the corresponding tables in access.
I have used Text Form Fields in Word...
|
by: taylorcarr |
last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: aa123db |
last post by:
Variable and constants
Use var or let for variables and const fror constants.
Var foo ='bar';
Let foo ='bar';const baz ='bar';
Functions
function $name$ ($parameters$) {
}
...
|
by: ryjfgjl |
last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
| | |