Hyperlink on command button

  • Thread starter Thread starter DP
  • Start date Start date
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!
 
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.
 
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
 
Back
Top