Results 1 to 5 of 5
  1. #1
    jobbie is offline Advanced Beginner
    Windows 7 64bit Access 2007
    Join Date
    Apr 2014
    Posts
    46

    How to hide paths of hyperlinks?


    I have created a db that stores the paths of some docs on a shared drive. And these are presented to the user through forms in the form of hyperlinks. So if a user wants to access these docs he has to click the link in the form which opens that particular doc. The problem is the links that the user clicks on shows the entire path of the file. And since I have to give full rights to the users to the folder which stores the files it's possible they could locate the folder through the file paths and play some mischief with the files on the shared drive. So how do I prevent Access from displaying the paths while at the same time provide a link to the users to click on?

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,524
    Even if you hide the path in access, it will show anyway when the document opens, in the address bar of the web page.

  3. #3
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,524
    You could show a button, but the code will open the link

    Paste this code into a module, and it will open ANY file in its native application.

    usage:
    OpenNativeApp txtBoxLink

    OpenNativeApp "c:\folder\file.pdf" 'will open it in acrobat
    and
    OpenNativeApp "c:\folder\file.doc" 'will open the doc in Word, etc.


    Code:
    'Attribute VB_Name = "modNativeApp"
    'Option Compare Database
    Option Explicit
    
    Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hwnd As Long, ByVal lpszOp As String, ByVal lpszFile As String, ByVal lpszParams As String, ByVal lpszDir As String, ByVal FsShowCmd As Long) As Long
    Private Declare Function GetDesktopWindow Lib "user32" () As Long
    Const SW_SHOWNORMAL = 1
    Const SE_ERR_FNF = 2&
    Const SE_ERR_PNF = 3&
    Const SE_ERR_ACCESSDENIED = 5&
    Const SE_ERR_OOM = 8&
    Const SE_ERR_DLLNOTFOUND = 32&
    Const SE_ERR_SHARE = 26&
    Const SE_ERR_ASSOCINCOMPLETE = 27&
    Const SE_ERR_DDETIMEOUT = 28&
    Const SE_ERR_DDEFAIL = 29&
    Const SE_ERR_DDEBUSY = 30&
    Const SE_ERR_NOASSOC = 31&
    Const ERROR_BAD_FORMAT = 11&
    
    
    Public Sub OpenNativeApp(ByVal psDocName As String)
    Dim r As Long, msg As String
    
    r = StartDoc(psDocName)
    If r <= 32 Then
        'There was an error
        Select Case r
            Case SE_ERR_FNF
                msg = "File not found"
            Case SE_ERR_PNF
                msg = "Path not found"
            Case SE_ERR_ACCESSDENIED
                msg = "Access denied"
            Case SE_ERR_OOM
                msg = "Out of memory"
            Case SE_ERR_DLLNOTFOUND
                msg = "DLL not found"
            Case SE_ERR_SHARE
                msg = "A sharing violation occurred"
            Case SE_ERR_ASSOCINCOMPLETE
                msg = "Incomplete or invalid file association"
            Case SE_ERR_DDETIMEOUT
                msg = "DDE Time out"
            Case SE_ERR_DDEFAIL
                msg = "DDE transaction failed"
            Case SE_ERR_DDEBUSY
                msg = "DDE busy"
            Case SE_ERR_NOASSOC
                msg = "No association for file extension"
            Case ERROR_BAD_FORMAT
                msg = "Invalid EXE file or error in EXE image"
            Case Else
                msg = "Unknown error"
        End Select
    '    MsgBox msg
    End If
    End Sub

  4. #4
    jobbie is offline Advanced Beginner
    Windows 7 64bit Access 2007
    Join Date
    Apr 2014
    Posts
    46
    Quote Originally Posted by ranman256 View Post
    Even if you hide the path in access, it will show anyway when the document opens, in the address bar of the web page.
    yes but these are not webpages. these are pdf files saved on a shared drive. So will they still be able to see the path?

  5. #5
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,524
    If you use the code above it will open in Adobe, but the path will be in there if they want to find it.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Alternate Form Navigation Paths
    By acannon in forum Forms
    Replies: 4
    Last Post: 04-30-2015, 08:09 AM
  2. image paths in access 2010
    By oldtiredjeffro in forum Access
    Replies: 2
    Last Post: 08-27-2014, 01:51 PM
  3. Query Critera w/ two Paths
    By Mike4172 in forum Queries
    Replies: 6
    Last Post: 04-10-2013, 08:47 PM
  4. Access 2010 - Launch DB from 2 different paths
    By sunnie_joe in forum Programming
    Replies: 1
    Last Post: 04-19-2012, 06:11 AM
  5. Setting paths different for each form
    By sailinxtc in forum Programming
    Replies: 9
    Last Post: 04-04-2010, 09:03 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums