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 / Programming / May 2004

Tip: Looking for answers? Try searching our database.

retrieve Access form from Word

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
demyan - 27 May 2004 01:46 GMT
Hi,
I am trying to open an Access form from Word, using the following code:

Sub OpenAccessFormFromWord()
   'Open the source database
   Dim ac As Object
   Set ac = CreateObject("Access.Application")
   Dim db As Database
   Set db = OpenDatabase("myDb")
   ac.DoCmd.OpenForm "myForm"
End Sub

and receive error message smth like 'Form myForm cannot be opened at this time'. (As an aside, I am not sure if the Access.Application object is activated correctly..I do have DAO library checked). If someone could point me to a bit code successfully performing this task, I would be extremely grateful.
Thank you.
Cindy M  -WordMVP- - 29 May 2004 16:57 GMT
Hi =?Utf-8?B?ZGVteWFu?=,

Go to the Access VBA Help and look carefully at the second example for the Application
Object.
   - you need to use OpenCurrentDatabase (because you're manipulating the UI, not the
data; you're not using DAO)

> I am trying to open an Access form from Word, using the following code:
>  
[quoted text clipped - 8 lines]
>  
> and receive error message smth like 'Form myForm cannot be opened at this time'. (As an aside, I am not sure if the Access.Application object is activated correctly..I do
have DAO library checked). If someone could point me to a bit code successfully
performing this task, I would be extremely grateful.

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Sep 30 2003)
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 :-)
demyan - 30 May 2004 04:31 GMT
Thank you very much, Cindy
 
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.