Cancel navigation of hyperlink

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have hyperlinks as my navigation on a form. When the user clicks a link to
a report, I am checking for .HasData and if the report pulls no data, I close
it. The problem is that after all of these events take place, the hyperlink
is then followed. How can I keep that from happening? I don't mind having a
command button instead of a label, but I want the cursor to change to the
pointing hand when over the text.

Any help would be greatly appreciated.

Thanks,
Emily
 
epowell74 said:
I have hyperlinks as my navigation on a form. When the user clicks a
link to a report, I am checking for .HasData and if the report pulls
no data, I close it. The problem is that after all of these events
take place, the hyperlink is then followed. How can I keep that from
happening? I don't mind having a command button instead of a label,
but I want the cursor to change to the pointing hand when over the
text.

Don't use the hyperlink to open the report. Just use the OnClick event to
open it just as you would with a command button and add error trapping for
error 2501 for the NoData events. Setting the HyperlinkSubAddress to a
single space will still allow you to get the "Hand" when you hover over the
label.
 
Thanks so much for your help! You're awesome.

Rick Brandt said:
Don't use the hyperlink to open the report. Just use the OnClick event to
open it just as you would with a command button and add error trapping for
error 2501 for the NoData events. Setting the HyperlinkSubAddress to a
single space will still allow you to get the "Hand" when you hover over the
label.
 
Back
Top