19735 Avoiding "Data Link" during Word merge
Sign Up |  Live StatsLive Stats    Articles 37,321| Comments 177,192| Members 19,408, Newest ssarabjeet61| Online 510
Home Contact
 (Forgotten?): 
    Sikhism
    For best SPN experience, use Firefox Internet Browser!


                                                                   Your Banner Here!    




Sikh Philosophy Network » Sikh Philosophy Network » Current News » Information Technology » Avoiding "Data Link" during Word merge

Avoiding "Data Link" during Word merge

Our Donation Goal : Why Donate? : Donate Today! : Donate Anonymously (ਗੁਪਤ) : Our Family of Supporters
Goal this month: 500 USD, Received: 115 USD (23%)
Please Donate...
     
Related Topics...
Thread Thread Starter Forum Replies Last Post
What does the word "Ghar" mean in Guru Granth Sahib Ji? jajab FAQs for Students 5 07-Oct-2011 21:32 PM
Database appears "hidden" upon using internet link. Brent Information Technology 1 28-Jul-2006 08:10 AM
RE: Database appears "hidden" upon using internet link. Tom Wickerath Information Technology 0 28-Jul-2006 08:09 AM
"replace" and "Find" function in Microsoft Office Word 2003 mleh Information Technology 1 28-Jul-2006 08:02 AM
I have a data type mismatch if I select "H", but "A" selects. Howard in Hammondsport Information Technology 4 07-Nov-2005 11:26 AM


Tags
avoiding, data link, during, linkquot, merge, quotdata, word
Reply Post New Topic In This Forum Stay Connected to Sikhism, Click Here to Register Now!
  #1 (permalink)  
Old 28-Jul-2006, 08:29 AM
cjg.groups@gmail.com's Avatar cjg.groups@gmail.com
Guest
 
Posts: n/a
   
   
Avoiding "Data Link" during Word merge

  Donate Today!   Email to Friend  Tell a Friend   Show Printable Version  Print   Contact sikhphilosophy.net Administraion for any Suggestions, Ideas, Feedback.  Feedback  

Register to Remove Advertisements
In Access 2003, I am using VB to build a complex MAKE TABLE query,
store it in a new Query Def, then execute it to make the table. I then
launch a Word mail merge using that new table as the data source. The
Word template is not bound to a data source.

When I run the code, Word shows the Data Link window asking for a data
source. Trying to cancel says the data source is already open, but the
merge runs anyway. This happens often, but not always, and I can't
tell what causes it.

Is the complex MAKE TABLE simply not finished creating when the merge
executes? The merge to Word in VB seems so flakey; it works, but often
throws generic errors. Below is a code excerpt. Any ideas? Thanks.


Set qdfMake = db.CreateQueryDef("", strSQL)
qdfMake.Parameters(0) = Eval(strCtlOID)
qdfMake.Execute

appWord.Visible = True
objWord.MailMerge.OpenDataSource Name:="E:\data.mdb",
LinkToSource:=True, Connection:="TABLE tbltempOutputReport",
SQLStatement:="SELECT * FROM [tbltempOutputReport]"
Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/information-technology/12420-avoiding-data-link-during-word-merge.html
objWord.MailMerge.Destination = wdSendToNewDocument
objWord.MailMerge.Execute
Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=12420



Got anything to share on This Topic? Why not share your immediate thoughts/reaction with us! Login Now! or Sign Up Today! to share your views... Gurfateh!
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 28-Jul-2006, 08:29 AM
cjg.groups@gmail.com's Avatar cjg.groups@gmail.com
Guest
 
Posts: n/a
   
   
Re: Avoiding "Data Link" during Word merge

Some brainstorms that I'll look into:

Is there a WaitUntil or PauseUntil statement that won't advance until a
condition is met?
Or maybe pause with a Do While loop until the condition is met?

Does qdf.Execute have a return value for the above pause statements?

Does the database's Tables collection send a signal when a new table is
Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=12420
added, which could be watched for by a pause statement?

Could a pause statement check that the table exists AND is populated
before going on?

Show a dialog box after table creation but before merge, making the
user click OK to do the merge? That's one more step than I'd like,
though.


The other error that I sometimes get during the merge is maybe from
Word, saying the data source is empty or has no records. Sure, because
the query is not done creating the table when it tries to do the merge.
Is there a standard solution to this? Thanks.
Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=12420


cjg.groups@gmail.com wrote:
> In Access 2003, I am using VB to build a complex MAKE TABLE query,
> store it in a new Query Def, then execute it to make the table. I then
> launch a Word mail merge using that new table as the data source. The
> Word template is not bound to a data source.
>
> When I run the code, Word shows the Data Link window asking for a data
> source. Trying to cancel says the data source is already open, but the
> merge runs anyway. This happens often, but not always, and I can't
> tell what causes it.
>
> Is the complex MAKE TABLE simply not finished creating when the merge
> executes? The merge to Word in VB seems so flakey; it works, but often
> throws generic errors. Below is a code excerpt. Any ideas? Thanks.
>
>
> Set qdfMake = db.CreateQueryDef("", strSQL)
> qdfMake.Parameters(0) = Eval(strCtlOID)
> qdfMake.Execute
>
> appWord.Visible = True
> objWord.MailMerge.OpenDataSource Name:="E:\data.mdb",
> LinkToSource:=True, Connection:="TABLE tbltempOutputReport",
> SQLStatement:="SELECT * FROM [tbltempOutputReport]"
> objWord.MailMerge.Destination = wdSendToNewDocument
> objWord.MailMerge.Execute


Reply With Quote
  #3 (permalink)  
Old 28-Jul-2006, 08:29 AM
Albert D.Kallal's Avatar Albert D.Kallal
Guest
 
Posts: n/a
   
   
Re: Avoiding "Data Link" during Word merge

Try my word merge sample here:

http://www.members.shaw.ca/AlbertKal.../msaccess.html

You can run your code to create the new data, and then run my merge code.
(you can pass my code a query that is based on your temp table).

Don't forget to read the usage stuff here:

http://www.members.shaw.ca/AlbertKal...rge/page2.html

--
Albert D. Kallal (Access MVP)
Edmonton, Alberta Canada
pleaseNOOSpamKallal@msn.com
Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=12420
Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=12420
http://www.members.shaw.ca/AlbertKallal


Reply With Quote
  #4 (permalink)  
Old 28-Jul-2006, 08:29 AM
LJG's Avatar LJG
Guest
 
Posts: n/a
   
   
Re: Avoiding "Data Link" during Word merge

Hi Albert,

I have downloaded your word merge and when testing the add template I keep
Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=12420
getting an error:

Run-time error 5174

This file could not be found

And suggests a file path C:\database\development\word\merge.888

from your notes I assumed that the folder would be added? and that merge.888
is used locate the folder and create a temp file name for the path.

A folder 'word'has been created.

Any help would be appreciated.

TIA
Les




"Albert D.Kallal" wrote in message
news:%23M$imXZnGHA.4328@TK2MSFTNGP04.phx.gbl...
> Try my word merge sample here:
>
> http://www.members.shaw.ca/AlbertKal.../msaccess.html
>
> You can run your code to create the new data, and then run my merge code.
> (you can pass my code a query that is based on your temp table).
>
> Don't forget to read the usage stuff here:
>
> http://www.members.shaw.ca/AlbertKal...rge/page2.html
>
> --
> Albert D. Kallal (Access MVP)
> Edmonton, Alberta Canada
> pleaseNOOSpamKallal@msn.com
> http://www.members.shaw.ca/AlbertKallal
Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=12420
>



Reply With Quote
  #5 (permalink)  
Old 28-Jul-2006, 08:29 AM
Albert D.Kallal's Avatar Albert D.Kallal
Guest
 
Posts: n/a
   
   
Re: Avoiding "Data Link" during Word merge

For some reason, often the word directly does not get created correctly.
Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=12420
Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=12420

Try creating a dir called "word", and then try my example.....

However, since you were able to create a template, then likely the dir did
get created.

Were you able to create a template, and add a few fields using my example?


--
Albert D. Kallal (Access MVP)
Edmonton, Alberta Canada
pleaseNOOSpamKallal@msn.com
http://www.members.shaw.ca/AlbertKallal


Reply With Quote
  #6 (permalink)  
Old 28-Jul-2006, 08:29 AM
LJG's Avatar LJG
Guest
 
Posts: n/a
   
   
Re: Avoiding "Data Link" during Word merge

Hi Albert,

All is working fine now. It appears word started on one occasion and
stalled, so each time I tried it again it thought word was open.

Simply cleared the temp file word created and that sorted it.

Great little tool, many thanks

Les
"Albert D.Kallal" wrote in message
news:uLxAEsjnGHA.2364@TK2MSFTNGP02.phx.gbl...
> For some reason, often the word directly does not get created correctly.
Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=12420
>
> Try creating a dir called "word", and then try my example.....
Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=12420
>
> However, since you were able to create a template, then likely the dir did
> get created.
>
> Were you able to create a template, and add a few fields using my example?
>
>
> --
> Albert D. Kallal (Access MVP)
> Edmonton, Alberta Canada
> pleaseNOOSpamKallal@msn.com
> http://www.members.shaw.ca/AlbertKallal
>



Reply With Quote
  #7 (permalink)  
Old 28-Jul-2006, 08:30 AM
cjg.groups@gmail.com's Avatar cjg.groups@gmail.com
Guest
 
Posts: n/a
   
   
Re: Avoiding "Data Link" during Word merge

  Donate Today!  
Albert,

I first saw MergeSingleWord a month ago and was confused. Is it a full
"application", creating a merge template in Word and doing the merge?
Since I have a template and a data table, which functions from your
module do I need to do the merge? The code is more advanced than I am.
Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=12420

You have been a big help already in my project. Your printer code is
in my database, and your search page is bookmarked for later use.
Thank you!


Albert D.Kallal wrote:
> Try my word merge sample here:
>
> http://www.members.shaw.ca/AlbertKal.../msaccess.html
>
> You can run your code to create the new data, and then run my merge code.
> (you can pass my code a query that is based on your temp table).
>
> Don't forget to read the usage stuff here:
>
> http://www.members.shaw.ca/AlbertKal...rge/page2.html
>
> --
> Albert D. Kallal (Access MVP)
> Edmonton, Alberta Canada
> pleaseNOOSpamKallal@msn.com
> http://www.members.shaw.ca/AlbertKallal

Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=12420

Reply With Quote
   Click Here to Donate Now!

Support Us!
Become a Promoter!
Gurfateh ji, you can become a SPN Promoter by Donating as little as $10 each month. With limited resources & high operational costs, your donations make it possible for us to deliver a quality website and spread the teachings of the Sri Guru Granth Sahib Ji, to serve & uplift humanity. Every contribution counts. Donate Generously. Gurfateh!
ReplyPost New Topic In This Forum Stay Connected to Sikhism, Click Here to Register Now!

Bookmarks


(View-All Members who have read this thread : 0
There are no names to display.

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Tools Search
Search:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On
Trackbacks are On
Pingbacks are On
Refbacks are On

» Active Discussions
SSGS with English...
Today 07:52 AM
7 Replies, 73 Views
Losing My Religion: Why...
By Ishna
Today 04:40 AM
10 Replies, 210 Views
Keeping Amrit Vela
By Alisa
Today 02:39 AM
5 Replies, 784 Views
Rozana Reports (ਪੰਜਾਬੀ...
Today 01:44 AM
310 Replies, 7,517 Views
Sikh Spokesman (ਪੰਜਾਬੀ...
Today 01:30 AM
174 Replies, 4,434 Views
Dalai Lama’s Lessons for...
Today 00:11 AM
0 Replies, 38 Views
30 Day Amrit Vela -...
Yesterday 23:49 PM
45 Replies, 643 Views
How does Sikhi help you...
Yesterday 22:59 PM
19 Replies, 818 Views
What Do You Think of...
Yesterday 22:56 PM
39 Replies, 705 Views
How Religions Change...
Yesterday 19:33 PM
0 Replies, 73 Views
Do you believe in...
Yesterday 12:00 PM
184 Replies, 3,900 Views
Thought of the Moment!
Yesterday 10:07 AM
109 Replies, 5,152 Views
Amrit
Yesterday 09:17 AM
5 Replies, 364 Views
What I believe Hukam to...
Yesterday 03:15 AM
13 Replies, 185 Views
Should SPN Keep the...
Yesterday 02:02 AM
19 Replies, 680 Views
» Books You Should Read...
Powered by vBadvanced CMPS v3.2.3
All times are GMT +6.5. The time now is 09:56 AM.
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2013, vBulletin Solutions, Inc.
Search Engine Optimization by vBSEO 3.6.0 PL2 Copyright © 2004-12, All Rights Reserved. Sikh Philosophy Network


Page generated in 0.48818 seconds with 32 queries
0