Macro to 'InsertHyperlink'

Patm

New member
Local time
Today, 06:26
Joined
Oct 10, 2001
Messages
7
I am trying to create a command button on a form that will open the Insert Hyperlink dialogue box with a single click. The event 'On Click' is set to Hyperlink.

I created a macro and named it Hyperlink.
I made the action of the macro, RunCommand; and made the command, InsertHyperlink.

The text box next to the command button has no format since it will be displaying the hyperlink.

The problem: When I click the command button I get a message box stating "The command or action 'InsertHyperlink' isn't available now." And then more below that.
After I click OK the Action Failed box comes up and I get:
Macro Name: Hyperlink
Condition: True
Action Name: Run Command
Arguments: 259

How do I make the command button work properly? Thanks
 
Where are you trying to insert the hyperlink? The insert hyperlink menu item is only available to forms and report opened in design view. The dialog works fine if you set the focus on a form opened in design view and then run the code:

DoCmd.RunCommand acCmdInsertHyperlink
 
ott, you are correct that Insert Hyperlink is not available through the menu bar in the form view. I have seen a form before that when you 2x clicked in the text box it did bring up the dialog box so you could browse and select.

To answer your question; I am trying to insert the hyperlink in the text box next to the command button, so that, if anyone refers back to that record they can click on the hyper links in the text box and it will launch the pictures that pertain to that record.

I did try your suggested code but it brought up an error message in form view.
 

Users who are viewing this thread

Back
Top Bottom