Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Another Newbie question about word VBA

Status
Not open for further replies.

Y2KCobra

IS-IT--Management
Mar 11, 2003
15
GB
Good Afternoon to all,

I am looking for an example where I create a form in Word 2000 and perform queries to an access database in order to populate list boxes. Does anyone know where I can locat an example and what references do I need enabled in my Word application in order to instantiate an Database object?

Any help would be greatly appreciated
 
Assuming you are in Word VBA and want to instantiate an Access instance, try the following:

Dim objAccessApp As Access.Application
Set objAccessApp = GetObject("YourPathAndAccessFile")
objAccessApp. <== TO get methods and properties

etc

objAccessApp.Quit
Set objAccessApp = Nothing

Good Luck!

 
SBendBuckeye,

Thank you for the rapid response. I tried to test at least the instantiation of the access object but could not get VBA to recognize the calls.

Do you know what libaries should be loaded for this to work?

Thanking you in advance,

Steve
 
Sorry, in the VB Project editor, open a module and then click Tools, References and then scroll down looking for Microsoft Access x.x Objects, etc.

Sorry I forgot that piece.

Good Luck!

 
Works Great

Im hitting MS Sql now

Thank you =)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top