Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Opening an access database within access VBA

Status
Not open for further replies.

anonymous26

Programmer
Aug 25, 2006
6
US
Hi, i've searched the web for awhile looking for help and nothing seems to work so i thought i would ask her although i'm not sure anyone would understand me (newbie). I created a form in access with a command button and i want the button to open another access database in another folder. I tried the following code and did not work. I also tried dbengine.opendatabase and it did nothing. there was no error message. please help

'Dim appAccess As Access.Application
'Const strpath = "database name"

'Set appAccess = CreateObject("Access.Application")
'appAccess.OpenCurrentDatabase (strpath)
'appAccess.Visible = True
 
Hello

The OpenDatabase command will let you access (pardon the pun) data from an external database table. If you need to be able to run a database, complete with forms, reports etc, you need to simulate the effect of running it from Windows Explorer. Details of how to do this are in faq705-1971.

John
 
You could also look at:
check form label in another database
thread705-1270893
 
Hi thanks for the tips. I pasted the code in but am wondering how to call an application since there is not example listed. please help


Open a folder:
fHandleFile("C:\TEMP\",WIN_NORMAL)

Call Email app:
fHandleFile("mailto:bpo@yahoo.com",WIN_NORMAL)

Open URL:
fHandleFile(" WIN_NORMAL)

Handle Unknown extensions:
fHandleFile("C:\TEMP\TestThis",Win_Normal)
 
Have a look at the "Shell" function. Something like this:

Shell "C:\Program Files\Microsoft Office\OFFICE11\MSAccess.exe" C:\AccessApp\MyFrontEnd.mdb /WrkGrp C:\AccessApp\Secured.mdw /User Ed /pwd MyPassWord

Ed Metcalfe.

Please do not feed the trolls.....
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top