problem with FollowHyperlink ExtraInfo

Bogzla

Registered User.
Local time
Today, 13:35
Joined
May 30, 2006
Messages
55
So the below code is supposed to open an html file and pass some extra info to it which is then used by JavaScript to display the correct photos (pictures of cameras before or after 'drop test')

Using Firefox the page opens OK, but the extra info is not passed (I know it is in the correct variable as the debug.print shows the correct path, which has the desired effect when copy-pasted into firefox)

Any ideas?
Code:
Private Sub cmdView_Photos_Click()
On Error GoTo Err_cmdView_Photos_Click
Dim strPathName As String
Dim strBeforeAfter As String
Dim strCamNum As String
Dim strExtraInfo As String

Select Case Forms!frmJigBuildEnterData!opgBefore_After
    Case 1 '(before)
        strBeforeAfter = "Pre_Drop"
    Case 2 '(after)
        strBeforeAfter = "Post_Drop"
End Select

strCamNum = Me.txtCamID.Value

strPathName = "file://///Major/camera/Smia85/Drop_Test_Photos/Jpegs/viewphotos.html"
strExtraInfo = "camera=" & strCamNum & "&beforeAfter=" & strBeforeAfter

Debug.Print strPathName & "?" & strExtraInfo

Application.FollowHyperlink strPathName, , , , strExtraInfo

Exit_cmdView_Photos_Click:
    Exit Sub
Err_cmdView_Photos_Click:
    MsgBox "Error # " & Err.Number & " - " & Err.Description
    Resume Exit_cmdView_Photos_Click
End Sub

thanks in advance,
Bogzla
 
Yeah it just sends everything before the ? to the browser (so basically no change)

this is really bugging me, I just can't see what is wrong with it.

maybe it's a security thing, I'll talk to IT (although I can use html forms to pass variables in the url...)

Edit: IT don't seem to think it's a security thing. Have now also tried with IE6 but having the same problems. grrr.
Edit2: Even tried using Hyperlink.Follow method with exactly the same results. maybe it's a some random setting blocking this but I'm buggered if I can figure out what's going on
 
Last edited:
Thats strange cause it worked for me in access 2002. I your code above in the debug.print line your putting the "?" in but your not below on the Application.Hyperlink
 
the help file says that the '?' is not required if using ExtraInfo. I have tried using a single string for the Address as you suggested (including the '?') but that didn't help matters. I'm half tempted to use an intermediary batch file...
 
well, just in case anyone is still interested I resolved this using the shell function instead:

Code:
Private Sub cmdView_Photos_Click()
On Error GoTo Err_cmdView_Photos_Click
Dim strPathName As String
Dim strBeforeAfter As String
Dim strCamNum As String
Dim lngTaskID As Long

Select Case Forms!frmJigBuildEnterData!opgBefore_After
    Case 1 '(before)
        strBeforeAfter = "Pre_Drop"
    Case 2 '(after)
        strBeforeAfter = "Post_Drop"
End Select

strCamNum = Me.txtCamNum.Value
strPathName = "C:\Program Files\Mozilla Firefox\firefox.exe file:///M:/Smia85/Drop_Test_Photos/Jpegs/viewphotos.html?camera=" & strCamNum & "&beforeAfter=" & strBeforeAfter

lngTaskID = Shell(strPathName, vbNormalFocus)

Exit_cmdView_Photos_Click:
    Exit Sub
Err_cmdView_Photos_Click:
    MsgBox "Error # " & Err.Number & " - " & Err.Description
    Resume Exit_cmdView_Photos_Click
End Sub
 

Users who are viewing this thread

Back
Top Bottom