Results 1 to 5 of 5
  1. #1
    BernardKane is offline Novice
    Windows XP Access 2010 (version 14.0)
    Join Date
    Jun 2006
    Location
    Lincolnshire
    Posts
    12

    Changing the cursor

    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?

  2. #2
    pkstormy's Avatar
    pkstormy is offline Access/SQL Server Expert
    Windows XP Access 2003
    Join Date
    Mar 2010
    Location
    Madison
    Posts
    682
    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.

  3. #3
    BernardKane is offline Novice
    Windows XP Access 2010 (version 14.0)
    Join Date
    Jun 2006
    Location
    Lincolnshire
    Posts
    12
    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

  4. #4
    PaulSassya is offline Novice
    Windows 10 Access 2003
    Join Date
    Oct 2022
    Posts
    1

    Thumbs up

    Thank you pkstormy. It works like magic with Access 2003.
    Last edited by PaulSassya; 10-24-2022 at 02:32 AM. Reason: typo

  5. #5
    Micron is offline Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,801
    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.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Please Help With Changing Heading
    By angelln in forum Access
    Replies: 3
    Last Post: 08-05-2010, 09:01 AM
  2. Changing value of a field after an event.
    By mikethebass in forum Access
    Replies: 1
    Last Post: 06-16-2010, 04:42 PM
  3. Cursor issue when no records
    By shenry16 in forum Forms
    Replies: 4
    Last Post: 01-20-2010, 01:22 PM
  4. Changing Query on the Fly
    By pdouglas in forum Programming
    Replies: 0
    Last Post: 06-25-2009, 10:58 AM
  5. Replies: 0
    Last Post: 03-26-2007, 12:24 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums