Open with one Access application another Access application

  • Thread starter DrAvi via AccessMonster.com
  • Start date
D

DrAvi via AccessMonster.com

Hello,

I'm using the following VBA code to open with one Access application another
Access application (Office 2003, Windows 2000) and it works great:

Dim acc As New Access.Application
'Open the database
acc.OpenCurrentDatabase "Path.mdb", False, "Password"
'Make the application visible
acc.Visible = True

I have another computer (Office 2007, Win XP) and for some reason that code
don't work. It seems it recognize the path (wrong path gives error message),
the password and even looks like it is about to be open (Windows procedure
manager is showing for a less than a sec two MSACCESS procedures) but nothing
happens.
Could you please advise me what could be the problem?

Kind regards,
Avi
 
A

Albert D. Kallal

Any possibility this is being done via runtime?

You can't use automation to launch another copy of access when your using
the runtime edition of access.

Other then the above, I not sure why this would not work.

Another "guess" would be to check if two different versions of access
installed on the machine and the wrong version is being launched?
 
D

DrAvi via AccessMonster.com

Hello Albert and thank you for the answer,

I'm using full versions of Ms Access, one on each computer. (Ms Access 2003
and Ms Access 2007)
The databeses are MDB's ver 2003.

I'm afraid the raised suggestions are not the case in my question.

Avi
 
M

Mike Painter

Is the 2007 version you are trying to open in a trusted folder?
There might be some additional problem opening an .mdb.
You might try converting a copy and see what happens, but my nickel will be
bet on the trusted site issue.
 
D

DrAvi via AccessMonster.com

Hi Mike,

I've minimized all the security issues to the possible minimum (allowing all
macros, addend the folders to the trusted zones) and still – the new
application appears for a sec and vanished.

Have any more suggestions?
It's my first steps with Office 2007 and perhaps I'm missing something with
the security issues (I believe the solution is hidden somewhere there).

Avi
 
D

DrAvi via AccessMonster.com

Some progress... I found that when I'm changing the following definition,
another Access application window does gets open: Access options-Advanced-
Open last user database when Access starts-true

But, instead of opening the new application as the VBA code ask, another
replica of the current Access application opens and error msg "You already
have the Database open"

When the above definition is set to false, you only get blink for a sec and
that’s all.

I'll appreciate any advice to solve that issue.

Avi
 
A

Albert D. Kallal

Perhaps you try removing the password for testing..

You can launch any application such as excel, word etc. by going


application.followhyperlink "path to mdb"

I assume on your machine you can click on that mdb being opened...and it
works just fine?

I would test try this on some other mdb file...since I have no problems
running some test code such as:

Dim ap As New Access.Application

ap.OpenCurrentDatabase "c:\tblanswers.mdb"

ap.Visible = True

The above works just fine. So,I would make a smaple mdb file without a
password, and try placing it in the same dir as the current mdb and see what
happens.
 
D

DrAvi via AccessMonster.com

Thank you Albert for the answer,

The both MDB's works fine separately when clicking on them.
I tried to remove the password, the files are both in the same directory -
and no success.
As I said, under Access 2003 it works great, with Access 2007 - nothing..

You have mentioned that the code works in your computer - what OS,Office?

I must find a solution for the problem because I'm using that code quite a
lot and I appreciate any advice.

Avi
 
D

DrAvi via AccessMonster.com

Thank you for the answe,

Same OS+Office here and it keeps with its stubborn not to work properly. I'm
almost desperate…

Is there other way to call from one Access application to other Access
application, beside that code?

Avi
 
A

Albert D. Kallal

application.followhyperlink "path to mdb"

Above assumes no password. So, try the above (for testing, remove the
passwords).

The above can launch any file...excel, pdf..word.....
 
D

DrAvi via AccessMonster.com

Hi Albert,

The solution you offered works fine, but I do need the password to be
provided.

In the meanwhile, and I can't explain why it works, I found that when I'm
using the following code, the problem I raised vanished:

Private Sub Go_Click()
On Error GoTo ErrGo_Click

Dim acc As New Access.Application
acc.OpenCurrentDatabase "NewMDBPath", False, "Password"
acc.OpenCurrentDatabase "CallingMDBPath", False
acc.Visible = True

ErrGo_Click:
Application.quit

End Sub

Thank you all for your help.

Avi
 

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