open another access file

meenctg

Learn24bd
Local time
Tomorrow, 05:05
Joined
May 8, 2012
Messages
133
I have a form here with a button i wanna when user will click on button another access file will open.

or current file will close and another file will open.
Is it possible with vb for access? please help me
 
Something along the lines of:
shell("MSACCESS.EXE ""D:\Yourfolder\YourDatabase.accdb"" ")
 
Something along the lines of:
shell("MSACCESS.EXE ""D:\Yourfolder\YourDatabase.accdb"" ")

I have a function for get the current db path,,, I wanna open another mdb file which is also in current directory it's name Backup.mdb
 
I have a function for get the current db path,,, I wanna open another mdb file which is also in current directory it's name Backup.mdb
So what seems to be the problem now?
 
I thought I already gave you the link to Shell function..
Code:
Shell("MSACCESS.EXE " & GetDBPath() & "[COLOR=Red][B]backup.mdb[/B][/COLOR]")
 
Last edited:
I thought I already gave you the link to Shell function..
Code:
Shell("MSACCESS.EXE " & GetDBPath() & "")

GetDBPath() just face the current db path like when i open my main database file in c:\ GetDBPath() just give the c:\ but i wanna open another mdb file name is backup.mdb in current directory of my main database file
 
Ah ! Sorry check the updated code in Post#7
 
Try the, Application.CurrentProject.Path.
Code:
Shell("MSACCESS.EXE " & Application.CurrentProject.Path & "\BackUp.mdb")
 
dont forget to "" the filename, I believe that is still needed in case there are spaces in the filepath/name.
 

Users who are viewing this thread

Back
Top Bottom