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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Location of Access 2

Status
Not open for further replies.

ajs1952

Programmer
Jul 2, 2007
15
0
0
GB
I need to be able to read the registry and find the location of Access. I know this is possible in VBA but I don't know which key to read. If anyone out there has got a code fragment to do this I would be very grateful.

Thanks

Tony
 
Tony,

This code works on my PC, ymmv:

Code:
Public Function Access_Path() As String
    Access_Path = Path(Access.References(2).FullPath) & "MSAccess.exe"
End Function


Private Function Path(ByVal strFilePath As String) As String
    Dim intLastSlash As Integer
    Dim pntr As Integer: pntr = 1
    
    intLastSlash = InStrRev(strFilePath, "\")
    
    Path = Left(strFilePath, Len(strFilePath) - (Len(strFilePath) - intLastSlash))
End Function

Ed Metcalfe.

Please do not feed the trolls.....
 
You can also use:

Application.SysCmd(acSysCmdAccessDir)
 
Remou,

I thought there'd be any easier way! Have a star.

Ed Metcalfe.

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

Part and Inventory Search

Sponsor

Back
Top