Hyperlink on command button

D

DP

Would anyone know how to *programmatically* attach a hyperlink address to a
custom commandbar button?

This is what works fine on a reguarly command button:

Me.Commandbutton.Hyperlink.Address = "http://www.xxx.xxx.xxx"

Click the button, and IE opens fine.

I set the address programmatically from record to record as I move through
the database.

But how can I do the same on a custom commandbar button? Since the hyperlink
addresses changes with every record (and the hyperlink is NOT stored, nor
can it be stored for me my purposes in an Access table), there is not way to
go into the Commandbar with "custom" and manually set the hyperlink under
the properties menu.

There must be simple way to do this!

Help is always appreciated!
 
J

John Nurick

Hi DP,

If your address is in a variable (e.g. strHyperlink), all you need do is
use
Application.FollowHyperlink strHyperlink
in a VBA procedure, and then set the name of the procedure in the
commandbar button's OnAction property.
 
D

DP

Well, I will try this, and it's simple enough! It's amazing to me how often
it is that there are simple solutions (that I can't find).

Thanks! David Pike
 

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