By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,701 Members | 1,970 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,701 IT Pros & Developers. It's quick & easy.

Changing mouse cursor

P: 64
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
Share this Question
Share on Google+
16 Replies


dima69
Expert 100+
P: 181
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

P: 64
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
Expert 2.5K+
P: 2,653
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

P: 28
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

P: 28
It's OK, found it!

15 = Hand

:)
Jun 26 '07 #6

P: 28
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
Expert 2.5K+
P: 3,532
In Access it's not called Mouse Over it's called Mouse Move!
Jun 26 '07 #8

P: 28
cough cough, oh yeah, thanks.
Jun 26 '07 #9

missinglinq
Expert 2.5K+
P: 3,532
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, 8734 views)
Jun 26 '07 #10

P: 28
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

P: 28
I've got it, if you just put a space into the Hyperlink address the hand is displayed! ;-)
Jun 26 '07 #12

P: 1
Thanks it's working fine.

Dom
Jul 5 '07 #13

P: 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
Expert 100+
P: 234
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

P: 1
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

P: 5
@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.