473,386 Members | 1,785 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Word Table saved as ActiveX in Access, how to display in Word

3
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!

Expand|Select|Wrap|Line Numbers
  1. Sub Foto()
  2.     ActiveDocument.MailMerge.OpenDataSource Name:= _
  3.         "\\vmware-host\Shared Folders\My Documents\Mina datakällor\Foto.accdb" _
  4.         , ConfirmConversions:=False, ReadOnly:=False, LinkToSource:=True, _
  5.         AddToRecentFiles:=False, PasswordDocument:="", PasswordTemplate:="", _
  6.         WritePasswordDocument:="", WritePasswordTemplate:="", Revert:=False, _
  7.         Format:=wdOpenFormatAuto, Connection:= _
  8.         "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" _
  9.         , SQLStatement:="SELECT * FROM `FR_Kopplat_Till_Word_25`", SQLStatement1 _
  10.         :="", SubType:=wdMergeSubTypeAccess
  11. End Sub
Jan 24 '10 #1
7 1941
nico5038
3,080 Expert 2GB
I have my doubts about the quotes in the SQL statement:
Expand|Select|Wrap|Line Numbers
  1. SQLStatement:="SELECT * FROM `FR_Kopplat_Till_Word_25`"
  2.      try:
  3. SQLStatement:="SELECT * FROM 'FR_Kopplat_Till_Word_25'"
Nic;o)
Jan 24 '10 #2
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.
Jan 24 '10 #3
Pejo
3
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.
Jan 26 '10 #4
NeoPa
32,556 Expert Mod 16PB
Expand|Select|Wrap|Line Numbers
  1. 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.
Jan 26 '10 #5
Pejo
3
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?
Jan 26 '10 #6
nico5038
3,080 Expert 2GB
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)
Jan 26 '10 #7
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?
Jan 27 '10 #8

Sign in to post your reply or Sign up for a free account.

Similar topics

2
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...
2
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...
3
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....
0
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...
7
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...
1
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...
2
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...
1
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...
2
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...
4
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...
0
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,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
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$) { } ...
0
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...
0
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...
0
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
0
BarryA
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...
0
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...
0
jinu1996
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...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.