How to !!!! start different Db's from a switchboard

G

Guest

I use 10 to 15 different Db's and want to creat a switchboard or main page to
launch the db's from ??? Can this be done ??
 
G

Guest

you can use the application.followhyperlink to open which ever file you wish
including databases.

Set up your switchboard to call a function that passes along the path &
filename of the database you wish to open to the application.followhyperlink
statement.

Daniel
 
G

Guest

Hi Danie

The basic call shell on the OnClick of a button would look something like this

Private Sub ommand4_Click()
Call Shell("""C:\Documents and Settings\My Documents\DataBase1.mdb""", 1)
End Sub

Or you could create an unbound combo - or bind it so you can store the DB
table names and paths in a table. Then on the AfterUpdate event you could
use something like this

Private Sub ComboName_AfterUpdate()
If Me.ComboName = Database1 Then
Call Shell("""C:\Documents and Settings\My Documents\DataBase1.mdb""", 1)
End If
If Me.ComboName = Database2 Then
Call Shell("""C:\Documents and Settings\My Documents\DataBase2.mdb""", 1)
End If
If Me.ComboName = Database3 Then
Call Shell("""C:\Documents and Settings\My Documents\DataBase3.mdb""", 1)
End If
End Sub

Or you could use an option group - if case 1 then open DB1 if case 2 open
DB2, etc.

There are quite a few methods it just depends on what you feel is best for
your app.


Don't forget you can also use call shell to run a macro when you open a
specific DB (to open a form or whatever).

Hope this helps
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top