Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Mailmerge and Fax / August 2004

Tip: Looking for answers? Try searching our database.

Why do I lose datasource in Word VBA when I execute this code?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
ImOkYoureNot - 04 Aug 2004 19:27 GMT
>>    xsql = "SELECT * FROM `spec` where cuniqcode ='    3008'"
>>    ActiveDocument.MailMerge.DataSource.QueryString = xsql

If I set my datasource from the menu everything works. I can step
through all records and view them in the mailmerge document one at a
time.

Once I execute the query string, it displays the record found, and
then save the document, when I open again I get the Find Data Source
cannot be found message.

How can I execute automatically a macro to position to display the
correct record in my database without getting this message.

Thanks
Cindy M  -WordMVP- - 21 Aug 2004 12:12 GMT
Hi ImOkYoureNot,

Which version of Word are we discussing, here? And what connection
method has been used to link it in?

> >>    xsql = "SELECT * FROM `spec` where cuniqcode ='    3008'"
> >>    ActiveDocument.MailMerge.DataSource.QueryString = xsql
[quoted text clipped - 9 lines]
> How can I execute automatically a macro to position to display the
> correct record in my database without getting this message.

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 8 2004)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow question
or reply in the newsgroup and not by e-mail :-)
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.