Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Open database via button

Status
Not open for further replies.

MvP14

Technical User
Joined
Apr 14, 2003
Messages
13
Location
BE
I've been trying to create a button to open a database, but it doesn't work. Does anyone know how I can do that?

Thank you for any useful response!
 
When you say "button", do you mean a command button on an Access form, or a shortcut icon on your desktop?

To open another Access database, you can do several things. Perhaps the most straightforward is to simply fire off another instance of Access and load the other database:


Public Sub MyButton_Click()
dim x as double
x = Shell("..path to ms/access and your database..."), e.g.

Shell("C:\program files\Microsoft office\office\msaccess.exe C:\my stuff\my otherdb.mdb")

There may be a quote or two missing there, but this should give you the general idea.

JMH



Me? Ambivalent? Well, yes and no....
Another free Access forum:
More Access stuff at
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top