Move To Another Database

jaydwest

JayW
Local time
Today, 06:36
Joined
Apr 22, 2003
Messages
340
I give up. In earlier versions of Access I used

SendKeys "%FO" & strDatbasePathName &"~", False

to move to another database. Now we all know that Sendkeys is now a No! No! and that Microsoft has created the RunCommand to replace it, but I cannot figure out how to move to another database.

Dur ... I must be thick today.

Anyone know the answer?

Thanks:confused:
 
You may be able to do it with the OpenCurrentDatabase command although I've never tried it.

Here's a link,

though.
 
Thanks for your reply. I was hoping to hear from you. It looks like your the expert on this based on your previous responses.

I have tried using the OpenCurrentDatabase method but I get an error message that a Database is already open. When I try to use the CloseCurrentDatabase first, the database shuts down and the code stops dead.

This is a lot more work than the SendKeys that automatically shuts down the current database.

Any suggestions.
 
I can't think, to be honest.

Out of interest what are you trying to do - why are you wanting to send keys to another database? Maybe there is an easier solution.
 
Our Applications include 3 databases - User, Data, and Utility. The Utility Database is used for (1) Repairing and Compacting the User and Data Dbs, (2) Backing Up the User and Data DBs. (we have a pretty sophisticated backup routine that provides daily, weekly, or other backups, and (3) User entered Help messages. It is also used for automatically reattaching tables when we install updates at user site.

I know there are alternate ways to do the repair and compact, but the UtilDB handles all other functions great.

It seems ludicrous that a the sendkeys or domenuitem in versions pre 2000 worked so well, and MS didn't bring this capabilty into 2000, and 2002.
 
So, what are you wanting to do? Run a sub, run a macro, etc
 
I have a button on the Menu. I want to click on the button and move to the Utility Database.

This capability has been working for 10 years now with SendKeys but I have a new Client with MS Access 2002 and the SendKeys do not work. I assume I can load the necessary Reference Library to get it to work, but I would like to update the code to work with default Access 2002 libraries.
 
The problem with creating a new application is that the new database requests the username and password again. Password is an option in the OpenCurrentDatabase method.

Is there any way to pass the password?
 
As I've said, I've never tried but what about creating a string with the password and then:

appAccess.Forms!frmYourLogin.txtLogin = strPassword


Never know, it might work... :confused:
 
I'd love to pass the password but I have not found anyway to get it. For obvious reasons MS Access won't let a programmer get access to the password.

I think I'm stuck with SendKeys. We have used it for more than 10 years and until MS figures out how to replace it, I will use it.
 

Users who are viewing this thread

Back
Top Bottom