Google Answers Logo
View Question
 
Q: a button in access 97 that will open another access 2000 database ( Answered 4 out of 5 stars,   0 Comments )
Question  
Subject: a button in access 97 that will open another access 2000 database
Category: Computers > Programming
Asked by: futurebird-ga
List Price: $7.00
Posted: 01 Nov 2002 10:51 PST
Expires: 01 Dec 2002 10:51 PST
Question ID: 95623
I’m in access 97. I’d like to make a button that will open another
database (as a new instance of access) in access 2000. I have no idea
how to go about this, or if it's even possible but I was hoping that
someone here could give me a few leads.
Answer  
Subject: Re: a button in access 97 that will open another access 2000 database
Answered By: hammer-ga on 01 Nov 2002 12:05 PST
Rated:4 out of 5 stars
 
The Shell command allows you to run external programs. You will need
to know the path for the Access 2000 executable. It is called
msaccess.exe. If you have more than one version installed, you will
find more than one file by this name. One way to make sure you have
the right one is to look for the one with Access2000 logo (purple key
in a box) rather than the Access97 logo (yellow key).

Once you have this path, you can use Shell to open your database.

Public Sub StartAccess2000()

    Shell "C:\Program Files\Microsoft Office\Office\msaccess.exe"

End Sub

Shell simply runs a command line, so you have access to the same
command line arguments and switches as you have from anywhere else.
For example, by passing the name of your database on the command line,
you can have Access automatically open that database.

Public Sub StartAccess2000WithDb()

    Shell "C:\Program Files\Microsoft Office\Office\msaccess.exe
c:\mydb.mdb"

End Sub

Shell also takes an optional argument for windowstyle. To
automatically set the focus to the new window, use vbNormalFocus.

Public Sub StartAccess2000WithDbAndFocus()

    Shell "C:\Program Files\Microsoft Office\Office\msaccess.exe
c:\mydb.mdb", vbNormalFocus

End Sub

A full description of Shell and its arguments can be found in the Help
for Access 97.

Good luck with your database!

Hammer

Request for Answer Clarification by futurebird-ga on 01 Nov 2002 13:16 PST
Great, this looks like it will work only I can't seem to put a line
break in a string as you have.

Clarification of Answer by hammer-ga on 01 Nov 2002 13:47 PST
Those aren't deliberate line breaks. The web page is just wrapping.
The Shell statement and following arguments should all be on one line.
If I shorten the path so it fits:

Shell "c:\my_programs\msaccess.exe c:\mydb.mdb"
futurebird-ga rated this answer:4 out of 5 stars
Oh okay! It worked!

Comments  
There are no comments at this time.

Important Disclaimer: Answers and comments provided on Google Answers are general information, and are not intended to substitute for informed professional medical, psychiatric, psychological, tax, legal, investment, accounting, or other professional advice. Google does not endorse, and expressly disclaims liability for any product, manufacturer, distributor, service or service provider mentioned or any opinion expressed in answers or comments. Please read carefully the Google Answers Terms of Service.

If you feel that you have found inappropriate content, please let us know by emailing us at answers-support@google.com with the question ID listed above. Thank you.
Search Google Answers for
Google Answers  


Google Home - Answers FAQ - Terms of Service - Privacy Policy