Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 12-22-2012, 12:18 AM
WayneCusack WayneCusack is offline importing Access data to a Word document Windows 7 32bit importing Access data to a Word document Office 2010 32bit
Novice
importing Access data to a Word document
 
Join Date: Dec 2012
Posts: 4
WayneCusack is on a distinguished road
Default importing Access data to a Word document

In the past I have created document templates that drew data from an MS Access database. Now, using Word 2010 and Access 2010, I cannot open the database to draw out the data. I get error messages - either the database cannot be found or the file format is invalid.



The old templates connected to an "mdb" database using code like this:

var1 = "SELECT * FROM Lawyer WHERE [LawyerName] = Wayne Cusack" & Chr(34) & var1 & Chr(34) & "ORDER BY Ordernumber;"
Set db = OpenDatabase(Name:="C:\Work Matters\Databases\Lawyer.mdb")
Set rs = db.OpenRecordset(var1)

I understand that the default Access file type has changed from "mdb" to "accdb". When I save the new database with an "accdb" extension I get the message saying it is invalid - if I leave off the extension or use "mdb" I get a message saying the file cannot be found. I have tried using "Save As" under the "Save And Publish menu to store the database in an older format, but that does not solve the problem.

How can I connect to the database to draw out data to be used in a Word template?
Reply With Quote
  #2  
Old 12-22-2012, 07:59 AM
gmaxey gmaxey is offline importing Access data to a Word document Windows 7 32bit importing Access data to a Word document Office 2010 (Version 14.0)
Expert
 
Join Date: May 2010
Location: Brasstown, NC
Posts: 1,429
gmaxey is a jewel in the roughgmaxey is a jewel in the roughgmaxey is a jewel in the roughgmaxey is a jewel in the rough
Default

Wayne,

I've got an Access example here: http://gregmaxey.com/word_tip_pages/..._combobox.html
__________________
Greg Maxey
Please visit my web site at http://www.gregmaxey.com/
Reply With Quote
  #3  
Old 12-24-2012, 12:26 AM
WayneCusack WayneCusack is offline importing Access data to a Word document Windows 7 32bit importing Access data to a Word document Office 2010 32bit
Novice
importing Access data to a Word document
 
Join Date: Dec 2012
Posts: 4
WayneCusack is on a distinguished road
Default

Thank you Greg. You've helped me to solve the problem.
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
importing Access data to a Word document Importing paragraph from another Word document using VBA mawallace Word VBA 2 06-05-2012 05:32 AM
Importing data in PDF into Powerpoint HowardC PowerPoint 2 03-14-2012 11:21 AM
Importing Selected Text Into Word Document Mooseman60 Word 1 10-06-2011 03:18 AM
Protecting Word Document by restricting access permissions! user Word 0 11-20-2008 01:21 PM
Can I fill in Word document from Access table and/or query? slim_jim_56 Word Tables 0 10-03-2007 01:59 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 06:05 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft