Results 1 to 5 of 5
  1. #1
    nichmeg is offline Advanced Beginner
    Windows 7 64bit Access 2007
    Join Date
    Oct 2011
    Posts
    31

    Security/Error prompt

    I am getting the following pop up (see error.jpg). I am using the following code to open files on the server, and want to know how to keep it from asking.prompting this every time. Is there a better way to code it to prevent this, or is it unavoidable?



    Code:
    Private Sub pfp1button_Click()
        Dim strLinkUrl As String
        Dim strPath As String
        Dim strAddr() As String
            strPath = "G:/Fire/Private/PDF PFP/"
            strLinkUrl = [Pre-Plan #] & ".pdf"
            
            strAddr = Split(strLinkUrl, "", , vbTextCompare)
            strLinkUrl = ""
                For i = LBound(strAddr()) To UBound(strAddr())
                strLinkUrl = strLinkUrl & strAddr(i) & "+"
                Next i
            
            strLinkUrl = strPath & Left(strLinkUrl, Len(strLinkUrl) - 1)
                Debug.Print strLinkUrl
                    Me.pfp1button.HyperlinkAddress = strLinkUrl
    End Sub
    The files are in G:/Fire/Private/PDF PFP/ and every file is named after the Pre-Plan # (ie. A01.pdf, A02.pdf, A03.pdf, etc)

  2. #2
    ajetrumpet is offline VIP
    Windows Vista Access 2007
    Join Date
    Mar 2010
    Location
    N/A
    Posts
    2,694
    I don't see the code that actually opens the file. The button is doing it?

    I bet you wouldn't see that popup if you shell'd to adobe reader and spec'd the file name from it.

    have you tried that method?

  3. #3
    nichmeg is offline Advanced Beginner
    Windows 7 64bit Access 2007
    Join Date
    Oct 2011
    Posts
    31
    How would I go about doing that?

  4. #4
    ajetrumpet is offline VIP
    Windows Vista Access 2007
    Join Date
    Mar 2010
    Location
    N/A
    Posts
    2,694
    Quote Originally Posted by nichmeg View Post
    How would I go about doing that?
    you use SHELL in visual basic to call windows applications that are installed with windows by default. so for instance, if you want to open a text file on the c drive, you would type:

    Code:
    shell "notepad c:\path"
    or for the calculator, for instance:

    Code:
    shell "calc.exe"
    but I guess Adobe isn't a windows program. So how about using "application.followhyperlink"?

  5. #5
    nichmeg is offline Advanced Beginner
    Windows 7 64bit Access 2007
    Join Date
    Oct 2011
    Posts
    31
    I am really stumped by this, I can get it to open the files, but it uses internet explorer (however Adobe is the default for pdfs if you double click the file). I was hoping there was a generic way of doing this as it will be put on a few computers and I dont know if the install directory is the same for telling it to use c:/program files/...../acrobat.exe to open the file.
    Ill attach the file, but I dont how anyone could test it as the link is on the server.
    I dont know if part of the problem is me telling it to go to "G:/Fire/Private/PDF PFP/" + the pre-plan # + ".pdf"
    I tested to see if it would work and had a msgbox pop up with the output file and it is telling it the right file name. I put that in the run box of the start menu and it opens the file fine in adobe. tell it to open via access and it opens in internet explorer.
    I was using the same basis as the aerial map (which works fine) but keep getting this security box. Ive tried it on 3 computers too to make sure it wasnt some extra security feature that was on the computer.
    Hopefully that is a little clearer than mud.
    Thanks

    PS - Ive also tried the application.followhyperlink with no success either.
    Last edited by nichmeg; 11-06-2011 at 07:13 PM. Reason: forgot data

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

Similar Threads

  1. prompt for orderby in report
    By nkuebelbeck in forum Access
    Replies: 2
    Last Post: 08-18-2011, 12:57 PM
  2. Save changes to layout prompt
    By HunterEngineeringCoop in forum Access
    Replies: 2
    Last Post: 07-07-2011, 08:35 AM
  3. Query prompt issue
    By zbug in forum Queries
    Replies: 1
    Last Post: 07-31-2010, 04:43 PM
  4. Password Prompt
    By thestappa in forum Security
    Replies: 1
    Last Post: 01-28-2010, 09:19 PM
  5. Removing the delete prompt.
    By botts121 in forum Programming
    Replies: 4
    Last Post: 06-26-2009, 11:45 AM

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