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 / August 2005

Tip: Looking for answers? Try searching our database.

Open a Microsoft Access file from within Word

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Mark64 - 25 Aug 2005 22:49 GMT
I don't know if this is even possible or if this is just a stupid question.  
But does anyone know if it is possible to create a macro that I can add to
the toolbar that I can just press to open an existing Microsoft Access file.

Thank you
Jezebel - 25 Aug 2005 23:09 GMT
Yes, you can do that.

>I don't know if this is even possible or if this is just a stupid question.
> But does anyone know if it is possible to create a macro that I can add to
> the toolbar that I can just press to open an existing Microsoft Access
> file.
>
> Thank you
Mark64 - 26 Aug 2005 02:30 GMT
Is there a function within Word or do I need to input an open statement using
Visual Basic.  I am new to Visual Basic and I haven't really learned the
language.

> Yes, you can do that.
>
[quoted text clipped - 4 lines]
> >
> > Thank you
Jezebel - 26 Aug 2005 02:34 GMT
Are you opening the Access file as an Access application, or simply opening
the database? (The methods you use are completely different.) Either way,
there's a more to it than you can expect to get answered in a posting. Trawl
the VB/VBA websites: there are any number of examples.

> Is there a function within Word or do I need to input an open statement
> using
[quoted text clipped - 11 lines]
>> >
>> > Thank you
Mark64 - 26 Aug 2005 03:18 GMT
I would like for it to open Access with the database as its own window and
switch to it as well.  Basically after I am finished writing a report I have
to go fill the log in the database.  Which means I have to go to the folder
where it is located and then open it up, which usually takes awhile.  So I
would like just a button on Word that I can press to fill out the information
that way I don't forget to fill in the database.  Lets assume the access file
name is: test.mdb

> Are you opening the Access file as an Access application, or simply opening
> the database? (The methods you use are completely different.) Either way,
[quoted text clipped - 16 lines]
> >> >
> >> > Thank you
Jezebel - 26 Aug 2005 03:27 GMT
Read help on GetObject() and CreateObject().

As an alternative, you could create a UserForm in Word to collect the
information; then use an SQL statement to insert the data directly into the
database.

Or simpler still, just add a destop shortcut to the database.

>I would like for it to open Access with the database as its own window and
> switch to it as well.  Basically after I am finished writing a report I
[quoted text clipped - 33 lines]
>> >> >
>> >> > Thank you
Mark64 - 26 Aug 2005 04:53 GMT
Jezebel,

Okay, I used the GetObject function like the help says and I don't get any
errors, but the access file does not open (I also tried it with an Excel file
and that wouldn't open either).  I am not for sure if I was clear on this but
when I wanted to open Access I just wanted a button in Word basically to
remind me to fill in the information in Access and it would be a quick key to
get there, the information in the Access database has nothing to do with the
Word document, I am not inputting data from the Word document into the Access
document.  Sorry if I have been sort of vague, I am trying to understand the
VBA.  Anyways here is what I put in Visual Basic:

Sub Macro1()

Dim Object1 As Object
Set Object1 = GetObject("C:\Documents and Settings\My Documents\test.mdb")

End Sub

Do you have any suggestions?  Thank you for all your help!

> Read help on GetObject() and CreateObject().
>
[quoted text clipped - 41 lines]
> >> >> >
> >> >> > Thank you
Jezebel - 26 Aug 2005 05:05 GMT
I suggest you actually READ the help file and look at the examples.
GetObject returns a reference to the object -- Excel file, Access db,
whatever. It doesn't DO anything with the object -- YOU have to call the
object's methods to make something happen (ie make it visible, activate it,
etc).

> Jezebel,
>
[quoted text clipped - 75 lines]
>> >> >> >
>> >> >> > Thank you
 
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.