Opening 2nd Database from Current Database

V

Vylent Fyre

I have scoured through here for days and all weekened I poured through
newsletters and forums hoping to find something that would work for what I am
trying to accomplish... If I missed it through here, please forgive my
duplicate entry....

I have one Database, Main Database - 1.0.2.mdb, that is current and "live".
I have an Archives Database - 2007.mdb that, obviously, has all my old
information in it. Keep in mind that they both have security in place and I
have the mdw files and the links to open the security files and the database
set up and everything. In other words, when I click on the links it opens up
the database and prompts you for the username and password. That's never
been an issue.

My issue is this - I cannot get this button on this form to call the
Archives Database through using the security file. I don't want it to close
the current one just yet. I may add that later, but I know how to do the
DoCmd.Quit....

Here's my current code...

Private Sub btn_Archives_Database_Click()
On Error GoTo Err_btn_Archives_Database_Click

Dim stAppName As String

stAppName = "C:\Program Files\Microsoft Office\Office10\MSACCESS.EXE"
Call Shell(stAppName, 1)

Exit_btn_Archives_Database_Click:
Exit Sub

Err_btn_Archives_Database_Click:
MsgBox Err.Description
Resume Exit_btn_Archives_Database_Click

End Sub



I've tried adding the "S:\Accounting\Houston Accounting
Database\Archives\Archive Database - S Drive" link but it won't work....
The above will obviously only call the msaccess from your local computer...

The drive name is \dc1-hou-tx-511\ - If I could get this instead of having
to have buttons for each drive letter, that would be awesome too....

I'm sure there's a very easy code to do this and I'm just not seeing it...
I'm sorry for bothering anyone and I definitely will appreciate any
assistance! :)

Thank you!

Vylent Fyre
 
D

david

Two answers:

1) You only do that if the other application has a form or
report that you need. Instead you can import the report,
then link to the tables.

2) You just put everything into stAppName.

stAppNam = stAppNam & " " & dbname"
stAppNam = stAppNam & " /wrkgrp fred.mdw"
stAppNam = stAppNam & " /pwd fred /user fred "

(david)
 

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