File Open Query

Smeg77

New member
Local time
Today, 00:37
Joined
Jan 13, 2006
Messages
5
I've need to be able to open up another db while in the current db.

Atm I have to start the db, then goto file open, goto the t: and then select the correct .mdb file, as I have no control over the db, this is the solution we were provided.

Now what I would like to do is ammend the main menu screen on the first Db so that it has a button that will automatically open the newer .mdb, but I can't work out the correct scripting I need.

Can someone possibly help me please.
 
Add this line to the Visual Basic code for the button you wish to perform this function:
Code:
Shell SysCmd(acSysCmdAccessDir) _
    & "msaccess.exe [b]C:\MyFolder\MyDatabase.mdb[/b]", vbMaximizedFocus
(NOTE: change the text in boldface in the above line to the actual path of the database you wish to open)

See if this works for you.
 
That's absolutley perfect, many thanks.


Small follow up, is it possible to get it to open in the taget window, rather than opening up another window?
 
Last edited:
I've managed to get this bit of poor coding to work:

SendKeys "%f", True
SendKeys "{down}", True
SendKeys "o"
SendKeys "T:\dir\mydb"
SendKeys "{enter}"

The reason I say poor, is because I know sendkeys is not the ideal way of doing anything, but it in this case does do what I need.

Does anyone know of a better piece of code ro functions that will do this in the same manner. Reason I say this, is although the shell command method works, it doesn't quite open the .mdb in the same way as going to file-->open and so the .mdb doesn't work quite the way it should.
 

Users who are viewing this thread

Back
Top Bottom