Opening Access App 
Author Message
 Opening Access App

Anyone know how to open another Access file from within an
Access database?  I would like to be able to do this from
a click event on a command button.  I'm guessing that the
click event would first close the current database, then
open the new file??? I don't know.

I don't think the OpenDatabase method accomplishes what I
want to do.

Thanks.

C



Mon, 19 Jan 2004 12:57:47 GMT  
 Opening Access App
Craig,

There are a few ways...

Probably the easiest is to use send keys...

Function fOpenDB(strDBName As String)
    'On Error Resume Next
    SendKeys "%FO" & strDBName & "~"
End Function

Or

Sub OpenDB()
Dim appAccess As Access.Application

Set appAccess = New Access.Application

With appAccess
    .OpenCurrentDatabase "c:\Access\Templates.mdb"
    .Visible = True
End With

Set appAccess = Nothing
End Sub

Otherwise look at CreateObject and GetObject in help for examples.

Hope this helps,

James

Quote:

> Anyone know how to open another Access file from within an
> Access database?  I would like to be able to do this from
> a click event on a command button.  I'm guessing that the
> click event would first close the current database, then
> open the new file??? I don't know.

> I don't think the OpenDatabase method accomplishes what I
> want to do.

> Thanks.

> C



Mon, 19 Jan 2004 18:21:06 GMT  
 Opening Access App
A better way is the [free] TSI SOON (Shut One, Open New) Database add-in,
fom the utilities page at:

    http://www.trigeminal.com/

--
MichKa

the only book on internationalization in VB at
http://www.i18nWithVB.com/


Quote:
> Craig,

> There are a few ways...

> Probably the easiest is to use send keys...

> Function fOpenDB(strDBName As String)
>     'On Error Resume Next
>     SendKeys "%FO" & strDBName & "~"
> End Function

> Or

> Sub OpenDB()
> Dim appAccess As Access.Application

> Set appAccess = New Access.Application

> With appAccess
>     .OpenCurrentDatabase "c:\Access\Templates.mdb"
>     .Visible = True
> End With

> Set appAccess = Nothing
> End Sub

> Otherwise look at CreateObject and GetObject in help for examples.

> Hope this helps,

> James


> > Anyone know how to open another Access file from within an
> > Access database?  I would like to be able to do this from
> > a click event on a command button.  I'm guessing that the
> > click event would first close the current database, then
> > open the new file??? I don't know.

> > I don't think the OpenDatabase method accomplishes what I
> > want to do.

> > Thanks.

> > C



Mon, 19 Jan 2004 20:45:32 GMT  
 Opening Access App
Thanks to both of you for your help!

Quote:
>-----Original Message-----
>A better way is the [free] TSI SOON (Shut One, Open New)
Database add-in,
>fom the utilities page at:

>    http://www.trigeminal.com/

>--
>MichKa

>the only book on internationalization in VB at
>http://www.i18nWithVB.com/



>> Craig,

>> There are a few ways...

>> Probably the easiest is to use send keys...

>> Function fOpenDB(strDBName As String)
>>     'On Error Resume Next
>>     SendKeys "%FO" & strDBName & "~"
>> End Function

>> Or

>> Sub OpenDB()
>> Dim appAccess As Access.Application

>> Set appAccess = New Access.Application

>> With appAccess
>>     .OpenCurrentDatabase "c:\Access\Templates.mdb"
>>     .Visible = True
>> End With

>> Set appAccess = Nothing
>> End Sub

>> Otherwise look at CreateObject and GetObject in help
for examples.

>> Hope this helps,

>> James


>> > Anyone know how to open another Access file from
within an
>> > Access database?  I would like to be able to do this
from
>> > a click event on a command button.  I'm guessing that
the
>> > click event would first close the current database,
then
>> > open the new file??? I don't know.

>> > I don't think the OpenDatabase method accomplishes
what I
>> > want to do.

>> > Thanks.

>> > C

>.



Tue, 20 Jan 2004 01:17:32 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Delay opening Access app from VB

2. Open Access App

3. Open Access App from VB Without Login Box

4. How to open Windows Apps from Access

5. VB4 app opening Secure 2.0 and 7.0 Access Databases concurently

6. App tries to open DB as MS Access 1.1 fmt instead of 2.0

7. Can VB3.0 App Open Access 7.0 database?

8. Opening Lotus Notes App from Visual Basic App?

9. Trigger Routine in VB App from Access App

10. Converting Access Apps to VB Apps

11. **************** Is there any form to convert Access APP to VB APP

12. Accessing Another App's Controls from My App

 

 
Powered by phpBB® Forum Software