469,270 Members | 1,626 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,270 developers. It's quick & easy.

Changing mouse cursor

Hi there,

Is there any way I can change mouse cursor in ms access form using code.

If i get get some code which will change mouse cursor with some text that will be great.

Thanks,
Yogesh
Jun 13 '07 #1
16 93975
dima69
181 Expert 100+
Hi there,

Is there any way I can change mouse cursor in ms access form using code.

If i get get some code which will change mouse cursor with some text that will be great.

Thanks,
Yogesh
The simple way to change mouse pointer in Access is to make it a hourglass:
Expand|Select|Wrap|Line Numbers
  1. docmd.Hourglass True/False
Jun 13 '07 #2
The simple way to change mouse pointer in Access is to make it a hourglass:
Expand|Select|Wrap|Line Numbers
  1. docmd.Hourglass True/False

Great

Thank you so much
Jun 13 '07 #3
FishVal
2,653 Expert 2GB
Hi there,

Is there any way I can change mouse cursor in ms access form using code.

If i get get some code which will change mouse cursor with some text that will be great.

Thanks,
Yogesh
You can use Screen.MousePointer property. The following code changes mouse cursor to I-beam shape.

Expand|Select|Wrap|Line Numbers
  1. Screen.MousePointer = 3
  2.  
Read Access help topic named MousePointer property.
Jun 13 '07 #4
Hi,
That's very helpful for me also, I have noticed though that there doesn't seem to be an option for the little hand/ finger?!
I'd like to be able to set the onmouse over property to display the hand, any suggestions?
I realise this is an automatic thing for hyperlinks, but I'd like it to appear on buttons/ labels too.

Thanks
Jun 26 '07 #5
It's OK, found it!

15 = Hand

:)
Jun 26 '07 #6
There would appear NOT to be a on mouse over property for button and labels...back to the drawing board then.
Jun 26 '07 #7
missinglinq
3,532 Expert 2GB
In Access it's not called Mouse Over it's called Mouse Move!
Jun 26 '07 #8
cough cough, oh yeah, thanks.
Jun 26 '07 #9
missinglinq
3,532 Expert 2GB
BTW, Screen.MousePointer = 15 does not change the cursor to a hand! The valid arguments are as follows:

Screen.MousePointer = 1 'Standard Cursor
Screen.MousePointer = 3 ' I Beam
Screen.MousePointer = 7 'Double Arrow Vertical
Screen.MousePointer = 9 'Double Arrow Horizontal
Screen.MousePointer = 11 'Hour Glass

The attached file contains a function that will change the pointer when the cursor hovers over a control. One of the pointers included is the hand with the Fickle Finger of Fate!
Attached Files
File Type: zip CursorHack.zip (3.8 KB, 9204 views)
Jun 26 '07 #10
Thanks for that I just noticed that 15 did nothing. I wonder why the options are so limited?!
The hand is displayed when you have a hyperlink on the page! Grrr
Jun 26 '07 #11
I've got it, if you just put a space into the Hyperlink address the hand is displayed! ;-)
Jun 26 '07 #12
Thanks it's working fine.

Dom
Jul 5 '07 #13
bluray
14
oh nice find on the space in the hyperlink address option! now all of my pretty image buttons act somewhat like a real button :) now if only i could figure out how to get access to allow seperate images to display during mouse move and down to give it that much more of a real button feel.
Jul 5 '07 #14
topher23
234 Expert 100+
It's been a few years, but for anyone stumbling upon this post: Don't forget to set
Expand|Select|Wrap|Line Numbers
  1. Screen.MousePointer = 0 'Access default
after you're done with whatever required the explicit pointer. So if you have Access change the pointer in an image's MouseOver event in the Detail section, put the code for returning to default in the Detail section's MouseOver event.

Also, relating to bluray's comment, if buttons in the 2007+ versions of Access are still too vanilla for you, you can create web-like MouseOver effects using a transparent command button placed over 3 stacked images. Have the "Default" image change to visible in the Detail OnMouseMove event, the "Hover" change to visible in the command button's OnMouseMove event, and the "Selected" change to visible in the button's OnMouseDown event (all while setting each of the respective other two images back to Visible = False). You get a really spectacular result for something many consider "impossible" in Access.
Mar 5 '14 #15
This CursorHack code works perfectly. By the way, I've read a lot of posts on this and other forums and I have to say that your comments and solutions (Mr.MissingLink or Linq) were always correct, professional and expert. Thank you for making our programmers life a little easier.
Jan 17 '16 #16
Hoopla3000
6 Nibble
@missinglinq
Thank you missinglinq for the code. I was able to use this to work around another issue. If you have a textbox that is set to show the value as a hyperlink, so that the user sees the hand/finger cursor. I was using the OnClick event of the textbox to launch a form but nothing I would do would get the hand cursor to change to an hourglass. I suspect this is a bug in Access with the hyperlink feature.

Using the API code that you provided I am now able to change the cursor immediately.

I am adding to this old thread in case someone else is struggling with the cursor after clicking a hyperlink.
Feb 4 '19 #17

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

1 post views Thread by netquest | last post: by
3 posts views Thread by Tim | last post: by
3 posts views Thread by larry mckay | last post: by
1 post views Thread by .NetHelpWanted | last post: by
1 post views Thread by gregarican | last post: by
2 posts views Thread by Jim Frazer | last post: by
2 posts views Thread by =?Utf-8?B?cmF1bGF2aQ==?= | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by suresh191 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.