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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

opening a db from another db

Status
Not open for further replies.

benwah

Technical User
Jun 27, 2001
97
GB
Hi

I have created a new db that has just a form. On the form there will be command buttons that will open up applications the employees here use. At the moment I am trying to open another database but keep getting the error "Invalid procedure call or argument". Here is my code for the command button:

Private Sub OpenDPPF_Click()
On Error GoTo Err_OpenDPPF_Click

Dim stAppName As String

stAppName = "G:\Transport\Access\DPPF\DPPF.MDE"
Call Shell(stAppName, 1)

Exit_OpenDPPF_Click:
Exit Sub

Err_OpenDPPF_Click:
MsgBox Err.Description
Resume Exit_OpenDPPF_Click

End Sub

The calling database is located in G:\Transport\Access\Parking Service - Main Menu\main menu.mdb if that helps...

I would be greatful for any suggestions!

wah
 
Sorry fellas i worked it out. I changed the target file to

stAppName = "MSACCESS.EXE G:\Transport\Access\DPPF\DPPF.MDE"

But doing that opens up a new access window. Is there any way I can get around that and open the new database in the same window?

Thanks in advance
wah
 
Dim DBS as database
Set dbs = opendatabase("G:\Transport\Access\DPPF\DPPF.MDE")

You can now access all of the objects from the other DB.


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top