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!

Hyperlink Warnings

Status
Not open for further replies.

Dibblet

Technical User
Jul 14, 2005
20
0
0
GB
Hi I have the following code for a button in my database -

Application.FollowHyperlink "R:/File Cabinet/", , True

When I click the button I am presented with two warning that the page I am about to open may contain viruses.

I don't want these warnings to come up.

I have tried turning docmd.setwarnings false to try and stop them popping up but i have been un sucessful.
The new code is-

Private Sub Command146_Click()
DoCmd.SetWarnings False
Application.FollowHyperlink "R:/File Cabinet/", , True
DoCmd.SetWarnings True
End Sub

Can anyone help?
 
A couple of thoughts:

1) Instead of using [tt]Application.FollowHyperlink[/tt] method, have you tried assigning the file to the [tt]Hyperlink Address[/tt] property of the Command Button using the control's property page?

2) If you are changing the file link at run time you can change the [tt]Hyperlink Address[/tt] in code:
Code:
Me.Command146.HyperlinkAddress = "R:/File Cabinet/"

3) If you are opening a specific type(s) of documents you could use [tt]CreateObject()[/tt] to spawn a new instance of the parent application.

Hope this helps,
CMP

Not sure if this works, I only skimmed the book that came with the software.
 
Hi Dibblet,
I use the following code in the on Click Event of a command button to reach out to external files with out any warnings comming up. I believe the fact that it is not a wizard created hyperlink prevents the warning generated by windows. The original suggestion was supplied by PHV.
********
Private Sub Command94_Click()
On Error GoTo Err_Command94_Click
'Thanks PHV
'HyperLink to open file without warning

Application.FollowHyperlink "\\Andy\shareddocs\AS9100\AS9100 Active\External\SAS-9100 rev B.pdf"

Exit_Command94_Click:
Exit Sub

Err_Command94_Click:
MsgBox Err.Description
Resume Exit_Command94_Click
End Sub
*****
Good Luck,
UncleG
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top