+ Reply to Thread
Results 1 to 4 of 4

opening access database using macro

  1. #1
    Registered User
    Join Date
    10-14-2005
    Posts
    1

    Wink 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

  2. #2
    Zack Barresse
    Guest

    Re: opening access database using macro

    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" <[email protected]> wrote
    in message news:[email protected]...
    >
    > 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. #3
    code_hungry
    Guest

    Re: 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" <[email protected]> wrote
    > in message news:[email protected]...
    > >
    > > 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. #4
    Zack Barresse
    Guest

    Re: 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" <[email protected]> wrote in message
    news:[email protected]...
    >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" <[email protected]>
    >> wrote
    >> in message news:[email protected]...
    >> >
    >> > 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 to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1