Hi. I've searched a couple places, and have been unsuccessful, in
finding code that will change the mouse pointer going over a label
as it does going over a hyperlink.
Thanks,
James
Igor - 15 Oct 2005 02:26 GMT
Just define OnMouseClick property, and the cursor will turn into a hadn with
a finger. You do not need MouseMove
- Igor
> Hi. I've searched a couple places, and have been unsuccessful, in
> finding code that will change the mouse pointer going over a label
> as it does going over a hyperlink.
>
> Thanks,
> James
JamesJ - 15 Oct 2005 02:43 GMT
For one thing the label doesn't appear to have a OnMouseClick property.
It has an OnClick property but the pointer doesn't change. I put the
following
code in the form's module:
Private Sub lblClose_OnMouseClick()
DoCmd.Close
End Sub
The popinter doesn't change and the DoCnd.Close doesn't fire.
No errors, nothing.
James
> Just define OnMouseClick property, and the cursor will turn into a hadn
> with
[quoted text clipped - 8 lines]
>> Thanks,
>> James
Igor - 15 Oct 2005 22:38 GMT
Maek sure this is a stand-along label. Ie. thsi label is not assosiated with
a control.
> For one thing the label doesn't appear to have a OnMouseClick property.
> It has an OnClick property but the pointer doesn't change. I put the
[quoted text clipped - 24 lines]
> >> Thanks,
> >> James
JamesJ - 15 Oct 2005 22:59 GMT
This label is not associated with a control. I inserted it from the toolbox.
James
> Maek sure this is a stand-along label. Ie. thsi label is not assosiated
> with
[quoted text clipped - 28 lines]
>> >> Thanks,
>> >> James
Igor - 17 Oct 2005 05:36 GMT
Sorry. You are right.
I copied my laebl from some sample database by MS and forgot about it. I
remember that unassociated labels (unlike associated labels) get their own
MouseMove events. I confused the two.
The other person's reply was correct.
- Igor
> This label is not associated with a control. I inserted it from the toolbox.
>
[quoted text clipped - 32 lines]
> >> >> Thanks,
> >> >> James
Dirk Goldgar - 15 Oct 2005 23:51 GMT
> Hi. I've searched a couple places, and have been unsuccessful, in
> finding code that will change the mouse pointer going over a label
> as it does going over a hyperlink.
You can use the code from
http://www.mvps.org/access/api/api0044.htm
API: Displaying a custom Mouse icon
to change the mouse pointer in the label's MouseMove event. If you copy
and paste that code into a new standard module, you can then call the
MouseCursor function from your event procedure like this:
'----- start of example event procedure -----
Private Sub Label0_MouseMove(Button As Integer, Shift As Integer, X As
Single, Y As Single)
MouseCursor IDC_HAND
End Sub
'----- end of example event procedure -----
Or else just set the OnMouseMove event property to
=MouseCursor(32649)

Signature
Dirk Goldgar, MS Access MVP
www.datagnostics.com
(please reply to the newsgroup)
JamesJ - 16 Oct 2005 00:10 GMT
Works fine. Thanks much.
James
>> Hi. I've searched a couple places, and have been unsuccessful, in
>> finding code that will change the mouse pointer going over a label
[quoted text clipped - 22 lines]
>
> =MouseCursor(32649)
Igor - 17 Oct 2005 07:37 GMT
Here is an alternative (now I'ev played with Access a bit and know more):
Just define an unattached label. Then, in properties, enter a single spaec
in "Hyperlink sub-address" field. That's all!
WARNING (just had been bitten by this): If you plan to add an event to the
label (why else would you need this behavior?), make sure that the label is
NOT in a sub-form! Othwerwise, the value of the controls that belong to that
sub-form you reference in the handler for the event will have undefined
values (ok, edfined but certainly not in the way you'd expect).
SOLUTION for sub-forms:
Use a text box instead of the label and format it to look like label
(transparent background, no borders, correct size, etc). You can designate a
text box to be a "Hyperlink". THE CATCH: You must have it a bound tetx box!
(unbound one will not do). So the in form data source, just define an extra
column to contain the text you want the "label" to have and bind the "label"
textbox to that column.
> Hi. I've searched a couple places, and have been unsuccessful, in
> finding code that will change the mouse pointer going over a label
> as it does going over a hyperlink.
>
> Thanks,
> James