I have just installed Office 2010 with Access 2010. I used to be able to change the cursor to a hand using the OnMouseMove property by using this code:Call MouseCursor(32649)This does no longer seem to work. Has anyone got a solution please?
I have just installed Office 2010 with Access 2010. I used to be able to change the cursor to a hand using the OnMouseMove property by using this code:Call MouseCursor(32649)This does no longer seem to work. Has anyone got a solution please?
I use a function (in a module) that has code like this:
Option Compare Database
Option Explicit
Private Declare Function LoadCursorBynum Lib "User32" Alias "LoadCursorA" _
(ByVal hInstance As Long, ByVal lpCursorName As Long) As Long
Private Declare Function SetCursor Lib "User32" _
(ByVal hCursor As Long) As Long
Public Function ShowHandOnly()
'Set the mouse pointer.
Dim lngRet As Long
lngRet = LoadCursorBynum(0&, 32649&)
lngRet = SetCursor(lngRet)
End Function
and then use code in the OnMouseMove event:
Call ShowHandOnly
Not sure about 2010 though. I know it works ok for 2007.
Thank you PKStormy. In the end I used:
Option Explicit
' Declarations for setting the cursor icon when called
Public Const IDC_HAND = 32649&
Public Const IDC_ARROW = 32512&
Public Declare Function LoadCursor Lib "user32" Alias "LoadCursorA" (ByVal hInstance As Long, ByVal lpCursorName As Long) As Long
Public Declare Function SetCursor Lib "user32" (ByVal hCursor As Long) As Long
This was called on the MouseMove command with:
ModLoadCursorHand.SetCursor LoadCursor(0, IDC_HAND)
I appreciate your help
Thank you pkstormy. It works like magic with Access 2003.
Last edited by PaulSassya; 10-24-2022 at 02:32 AM. Reason: typo
You responded to a 12 year old thread. Maybe he'll see your thanks anyway.
The more we hear silence, the more we begin to think about our value in this universe.
Paraphrase of Professor Brian Cox.