X   Site Message
(Message will auto close in 2 seconds)

Welcome to UtterAccess! Please ( Login   or   Register )

Custom Search
   Reply to this topicStart new topic
> Access Front End To MySQL Via ODBC Can't Open Word Doc Via VBA    
post Oct 22 2013, 10:17 PM

Posts: 1
Joined: 22-October 13

I am new here, and I hope I am posting this question in the correct place. Please forgive me if not.
I have an issue with an error that occurs when a VBA macro in an MS Access front-end to a MySQL database using ODBC tries to create/open a new Word document. I get a compile error "User-defined type not defined" when I run the macro. The error occurs on a simple declaration statement to declare a document object:
Dim objDoc As Word.Document
I have done some reading about this error, and found that, the typical fix for this error is to go to (in VBA IDE) Tools->References and enable reference to the Documents collection. However, in my IDE, the "References" selection under the Tools menu is not enabled. It is grayed out, and I cannot select it. I don't know if it is grayed out because of some setting somewhere that is set to make it disabled (I looked everywhere through the MS Access options and VBA options and couldn't find anything that looked like a setting that might enable this), or whether it is disabled because I am using an ODBC connection to my database, which was not the case in the situations where this fix to this error was described.
Does any one know if the VBA compile error is related to having an open ODBC connection? (Is it disabled by default when there is an open ODBC connection?) Or does anyone know how I can get the Tools->References menu option to be enabled so I can fix the compile error?
Thank you for your help,
Go to the top of the page
post Oct 22 2013, 11:10 PM

Dungeon Cleaner
Posts: 1,520
Joined: 16-June 07
From: Banana Republic

It may be disabled because you do not have sufficient privileges --- try running Access as the administrator and see if this resolves the issue.
Go to the top of the page
post May 20 2014, 11:40 AM

Posts: 241
Joined: 30-April 14

Try double clicking on the VBA project. (the bold word(s) to the left that has a plus sign).
eferences will be grayed out until a locked VBA project is unlocked.
Go to the top of the page

Custom Search

RSSSearch   Top   Lo-Fi    15th October 2019 - 04:15 PM