Results 1 to 2 of 2
  1. #1
    Join Date
    Feb 2004
    Posts
    533

    Unanswered: Cancel HyperLink Default Action

    Does anyone know a way to do this. I want to use a hyperlink control on a form, but cancel the default hyperlink action and run a procedure or function on the click event.

    I did this before but can't remember where I found the answer

    Used 'none' as the href address and tried using 'Cancel As Boolean' in the event arguments but this caused a procedure error.

    Any ideas?
    Last edited by savbill; 11-02-04 at 14:12.
    ~

    Bill

  2. #2
    Join Date
    Feb 2004
    Posts
    533
    I did some additional testing with the hyperlink feature to open a form and run code. It appears if you use 'None', #, ' ' in the defined hyperlink to simulate a hyperlink you'll get an Access error and code will not run. If you use 'None', #, ' ' or non-conformed form or URL as the HyperlinkSubAddress format it will not produce the error and will run your code. So that seems to be the answer.

    I know for a fact I had another answer to this that canceled the hyperlink action somehow, but don't have access to that code any longer... aggravating. but this seems to work fine for this purpose, so problem is solved.

    In case your wondering why I even want to do this... With the hyperlink set on a label it enables the internet hand to show on a mouseover. You can use much smaller text labels as links rather than buttons for a cleaner look. Being able to run code off a link allows any functionality you need to program on the control events.


    /
    ~

    Bill

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •