SetWarnings

R

Ray

I am trying to have a button open a custom help file. I have simply set a
hyperlink to the file. I have used the code

Private Sub Command124_Click()
DoCmd.SetWarnings False
FollowHyperlink "c:\member management 4\mm4help.chm"
End Sub

But I still get the message to the effect "opening some files can be harmful
to your computer. Do you want to continue"

How do I shut this message off?

Thanks for your help.
 
A

Allen Browne

In some cases, you can avoid this message if you add the file:/// prevfix to
the fully formed hyperlink.

This kind of thing:

Dim strLink as string
strLink = "c:\member management 4\mm4help.chm"
strlink = replace(strlink, " ", "%20")
strlink = replace("\", "/")
strlink = replace("#", "%23")
strlink = "file:///" & strlink & "#" & strlink
FollowHyperlink strLink
 
B

boblarson

And just to expand upon Allen Browne's answer, the warning message that you
are getting is a WINDOWS message not an Access one. So, trying to supress
the message in Access will be futile.

You should try Allen's suggestion and failing that you should check this out:
http://support.microsoft.com/kb/829072
--
Bob Larson
Access World Forums Super Moderator
Utter Access VIP
Tutorials at http://www.btabdevelopment.com
__________________________________
If my post was helpful to you, please rate the post.
 
L

Linq Adams via AccessMonster.com

And one last note: You've violated the Cardinal Rule for using SetWarnings!


Private Sub Command124_Click()
DoCmd.SetWarnings False
FollowHyperlink "c:\member management 4\mm4help.chm"
End Sub

You've left off the

DoCmd.SetWarnings True

command to reset the warnings! Which means you run the very real chance of
missing error messages you need to see!
 
B

boblarson

And almost as important is to have an error handler with DoCmd.SetWarnings
True as the first line of the error handler so that it will reset if it
errors out before it gets to the reset in the main code.
--
Bob Larson
Access World Forums Super Moderator
Utter Access VIP
Tutorials at http://www.btabdevelopment.com
__________________________________
If my post was helpful to you, please rate the post.
 
L

Linq Adams via AccessMonster.com

I deliberately left that out, Bob, 'cause I knew you'd come back and add it!
Surprised to see you wandering off the AW reservation!
 

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