Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
rtphilips
 
Posts: n/a
Default opening access database using macro


Hi

I have a access database "test.mdf"

While running a macro I want to open this database

Please provide some solution

Thanks


--
rtphilips
------------------------------------------------------------------------
rtphilips's Profile: http://www.excelforum.com/member.php...o&userid=28114
View this thread: http://www.excelforum.com/showthread...hreadid=476234

  #2   Report Post  
Zack Barresse
 
Posts: n/a
Default

Hi there,

You can use the FollowHyperlink method, it will work for almost any program.
An example would look like ...


Option Explicit
Sub testingAccess()
Dim strPath As String, strName As String

'Change as desired..
strPath = "C:\YourFullPathNameHere\"
strName = "test.mdb"

On Error GoTo ExitSpot
ActiveWorkbook.FollowHyperlink strPath & strName, NewWindow:=True
Exit Sub

ExitSpot:
MsgBox Err.Description
End Sub


HTH

--
Regards,
Zack Barresse, aka firefytr, (GT = TFS FF Zack)



"rtphilips" wrote
in message ...

Hi

I have a access database "test.mdf"

While running a macro I want to open this database

Please provide some solution

Thanks


--
rtphilips
------------------------------------------------------------------------
rtphilips's Profile:
http://www.excelforum.com/member.php...o&userid=28114
View this thread: http://www.excelforum.com/showthread...hreadid=476234



  #3   Report Post  
code_hungry
 
Posts: n/a
Default opening access database using macro

I have been looking for a "fit all" solution to opening files. I work in a
place where drive letters change depending on the department, so I have to
code for server paths. So far I have only been able to get huge amounts of
code to open an Office app within a diferent Office path. Yours was the
simpliest and the best.

Thanks. High Rating for you dude!!!
--



"Zack Barresse" wrote:

Hi there,

You can use the FollowHyperlink method, it will work for almost any program.
An example would look like ...


Option Explicit
Sub testingAccess()
Dim strPath As String, strName As String

'Change as desired..
strPath = "C:\YourFullPathNameHere\"
strName = "test.mdb"

On Error GoTo ExitSpot
ActiveWorkbook.FollowHyperlink strPath & strName, NewWindow:=True
Exit Sub

ExitSpot:
MsgBox Err.Description
End Sub


HTH

--
Regards,
Zack Barresse, aka firefytr, (GT = TFS FF Zack)



"rtphilips" wrote
in message ...

Hi

I have a access database "test.mdf"

While running a macro I want to open this database

Please provide some solution

Thanks


--
rtphilips
------------------------------------------------------------------------
rtphilips's Profile:
http://www.excelforum.com/member.php...o&userid=28114
View this thread: http://www.excelforum.com/showthread...hreadid=476234




  #4   Report Post  
Zack Barresse
 
Posts: n/a
Default opening access database using macro

Glad I could help you there. :)

Thanks for the note.

--
Regards,
Zack Barresse, aka firefytr, (GT = TFS FF Zack)



"code_hungry" wrote in message
...
I have been looking for a "fit all" solution to opening files. I work in a
place where drive letters change depending on the department, so I have to
code for server paths. So far I have only been able to get huge amounts of
code to open an Office app within a diferent Office path. Yours was the
simpliest and the best.

Thanks. High Rating for you dude!!!
--



"Zack Barresse" wrote:

Hi there,

You can use the FollowHyperlink method, it will work for almost any
program.
An example would look like ...


Option Explicit
Sub testingAccess()
Dim strPath As String, strName As String

'Change as desired..
strPath = "C:\YourFullPathNameHere\"
strName = "test.mdb"

On Error GoTo ExitSpot
ActiveWorkbook.FollowHyperlink strPath & strName, NewWindow:=True
Exit Sub

ExitSpot:
MsgBox Err.Description
End Sub


HTH

--
Regards,
Zack Barresse, aka firefytr, (GT = TFS FF Zack)



"rtphilips"
wrote
in message ...

Hi

I have a access database "test.mdf"

While running a macro I want to open this database

Please provide some solution

Thanks


--
rtphilips
------------------------------------------------------------------------
rtphilips's Profile:
http://www.excelforum.com/member.php...o&userid=28114
View this thread:
http://www.excelforum.com/showthread...hreadid=476234






Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Microsoft Access database Tracy Excel Discussion (Misc queries) 2 August 6th 05 05:22 AM
Open Access Database with VBA Bubba Excel Discussion (Misc queries) 1 July 19th 05 10:53 PM
Problems Importing from Access davey Excel Discussion (Misc queries) 1 July 8th 05 05:47 PM
Macro warning (upon opening) Richard Excel Discussion (Misc queries) 4 February 18th 05 10:43 PM
record an excel macro, save on network so that everyone can access Conajo Excel Discussion (Misc queries) 5 February 10th 05 11:50 PM


All times are GMT +1. The time now is 11:49 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"