views:

48

answers:

1

In Microsoft Access 2007 the Textbox can be set to display a cut-down version of HTML as richtext.
However, there does not seem to be an easy way to detect what has been clicked within the box itself.

For instance, you can display a classic HTML <a> tag that appears as a link but clicking it doesn't generate any event.

I'd like to know what has been clicked, somehow.

Any idea?

+1  A: 

I don't have A2007 to test this, but if clicking the link sets the cursor position, you could check the rich text control's .SelStart property (while it has the focus), but I don't know what event you'd use to trap this. OnEnter and OnGotFocus seem to be too early, and OnChange won't fire just for clicking a link, but the control's OnClick event might do the trick.

If so, you'd have to parse forward and back from the selection point to figure out if you're in a hyperlink, and I'm not sure exactly how that works in the A2007 richtext control.

Sorry I can't be of more help, .OnClick combined with .SelText might work if the click on a hyperlink sets the cursor position within the clicked hyperlink.

David-W-Fenton