Hi,
Please could you advise how i can open C:\MyFolder\Database1.accde (from cmdLaunchApp in the currently opened database).
C:\MyFolder\Database1.accde has the password:"password".
I have been trying the OpenDatabase method but realise that it does not launch the target database for end-user usage.
Your assistance would be greatly appreciated.
Kind Regards,
Mohamed
Launch Password Protected External Database for usage
-
- 3StarLounger
- Posts: 366
- Joined: 12 May 2010, 06:49
-
- Administrator
- Posts: 78625
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: Launch Password Protected External Database for usage
If you want to open Database1.accdb, replacing the currently open database, you can use:
Keep in mind that this will instantly close the current database, ending execution of the code in that database. If you want to open Database1.accde in another instance of Access, you can use
Code: Select all
Application.OpenCurrentDatabase "C:\MyFolder\Database1.accde", , "password"
Code: Select all
Dim app As Application
Set app = CreateObject("Access.Application")
app.UserControl = True
app.OpenCurrentDatabase "C:\MyFolder\Database1.accde", , "password"
Best wishes,
Hans
Hans
-
- 3StarLounger
- Posts: 366
- Joined: 12 May 2010, 06:49
Re: Launch Password Protected External Database for usage
Thanks Hans,
Greatly appreciated.
Kind Regards,
Mohamed
Greatly appreciated.
Kind Regards,
Mohamed
-
- 3StarLounger
- Posts: 366
- Joined: 12 May 2010, 06:49
Re: Launch Password Protected External Database for usage
Hi Hans,
For some strange reason the password protected file: Database1.accde opens in an Access window that is not maximised.
I tried this on my desktop and laptop, on the laptop it opens in an even smaller window.
Could you suggest a solution ?
Kind Regards,
Mohamed
For some strange reason the password protected file: Database1.accde opens in an Access window that is not maximised.
I tried this on my desktop and laptop, on the laptop it opens in an even smaller window.
Could you suggest a solution ?
Kind Regards,
Mohamed
-
- Administrator
- Posts: 78625
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: Launch Password Protected External Database for usage
Try this:
Code: Select all
Dim app As Application
Set app = CreateObject("Access.Application")
app.UserControl = True
' Maximize the Access window
app.RunCommand acCmdAppMaximize
app.OpenCurrentDatabase "C:\MyFolder\Database1.accde", , "password"
Best wishes,
Hans
Hans
-
- 3StarLounger
- Posts: 366
- Joined: 12 May 2010, 06:49
Re: Launch Password Protected External Database for usage
Excellent !
Many Thanks Hans.
Kind Regards,
Mohamed
Many Thanks Hans.
Kind Regards,
Mohamed