Dialog Box Pops Up After Canceling Hyperlinks Warning Message

M

Mr. Smiley

Please let me know if any of you have had this happen before.

I have a command button on a form that is supposed to follow a hyperlink
when pressed. After the button is pressed, a warning box pops up
automatically telling of the potential hazards of hyperlinks. This is
obviously something that Microsoft has built into access. (By the way, if
anyone knows how to get rid of this box, PLEASE let me know.) If the user
presses OK, the hyperlink warning box closes and the hyperlink is followed,
opening up another program. However, if the user clicks Cancel, a separate
box pops up saying "Program Does Not Exist". The problem I have with this is
that sometimes programs DO exist for some of the hyperlinks, and I believe
that this will confuse my users. Is there any way to make it so that no box
pops up after clicking Cancel within this hyperlink warning box? I truly
appreaciate any light that can be shed on this issue. Thank you :)

P.S. Here is my code:

Private Sub Command5_Click()
On Error GoTo Err_Command5_Click
Dim stDocName As String

If Dir(stDocName) = "" Then
MsgBox "File doesnt exist"

Else

If Form_frm_LoadDiagrams!DEPARTMENT = "S" Then

stDocName = "\\us271fp00\data\gapBurg\Micro_vu\(1) Completed
Programs\Stamping\" & Form_frm_LoadDiagrams!PARTNUM & " " & "(Print Rev. " &
Form_frm_LoadDiagrams!REV & ")" & "\" & Form_frm_LoadDiagrams!PARTNUM & " " &
"(Print Rev. " & Form_frm_LoadDiagrams!REV & ")" & ".iwp"

Else

If Form_frm_LoadDiagrams!DEPARTMENT = "A" Then

stDocName = "\\us271fp00\data\gapBurg\Micro_vu\(1) Completed
Programs\Assembly\" & Form_frm_LoadDiagrams!PARTNUM & " " & "(Print Rev. " &
Form_frm_LoadDiagrams!REV & ")" & "\" & Form_frm_LoadDiagrams!PARTNUM & " " &
"(Print Rev. " & Form_frm_LoadDiagrams!REV & ")" & ".iwp"

End If
End If
End If

Application.FollowHyperlink stDocName
DoCmd.Quit

Exit_Command5_Click:
Exit Sub

Err_Command5_Click:
MsgBox "Program Does Not Exist", vbOKOnly
Resume Exit_Command5_Click

End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top