Discussion Locked

Access97 - VBA question on RunCommand

0 helpful
3 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

I'm trying to create a button on a form that will basically duplicate the
Insert/Hyperlink menu command and let the user browse for a file path, but
I would like the "use relative path for hyperlink" check box to be
cleared, since the users often forget to do that, and it seems to be
checked by default.

The code I have so far works fine, but is there an argument or parameter
that will let me specify that I want the check box cleared? Here is what I
have so far:
Me!Shortcut.SetFocus
DoCmd.RunCommand acCmdInsertHyperlink

("Shortcut" is the name of the field that will hold the hyperlink.)

Thanks for your help!
Craig

3 replies

by mark.thomson

DoCmd.RunCommand only takes 1 parameter unfortunately. Reading between the lines of the Access Help file (and after some experimentation), the "use relative path for hyperlink" checkbox when checked seems to mean "do not enforce absolute paths" rather than "enforce relative paths" so you can allow your users to ignore the checkbox and then use some validation code to check the format of the hyperlink, getting the user to re-enter hyperlinks that do not fit your application's requirements.

This discussion is closed to new replies.