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.
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