Mouse Pointer Question

acepayne

Registered User.
Local time
Today, 11:52
Joined
Jul 26, 2001
Messages
44
Hello,

Is it possible to change the mouse pointer on an Access form to something other than the 5 or 6 choices documented by Microsoft? (Hourglass, I-Beam, etc.)

I want to make a label behave like a hyperlink, and have the mouse pointer turn to the hand on the on_mouse_move event. (and of course back to normal on the mouse_move event for the form)

Is it possible??

Thanks!
 
Just place a set of quotation marks ("") in the labels Hyperlink Address properly. You may also want to code it's On Click property with:

DoCmd.ShowToolbar "Web", acToolbarNo

to prevent the web toolbar from opening when the label is clicked. Good enough?

~Abby
 
The problem I am trying to get around involves using the hyperlink properties.

These labels are used to open some reports, which contain code that will display a messagebox and cancel the opening of the report if there is no data.

When this occurs, another messagebox occurs, saying that Access can't open the file specified in the hyperlink. (In this case, "")

If I could somehow suppress this error, that would be great. I could then just simply enter the report name in the hyperlink sub address property.

So, I thought I could emulate a hyperlink with a label, but the nice hand pointer didn't seem to be available.

Any other ideas?
 
Ah. Now I see. Though I'm not sure why you're getting that error message. As a test I created a report based on a query that returns no data. I coded the reports No Data event with the following:

Cancel = True
MsgBox "No data is available."

I then created a label on a form with its Hyperlink SubAddress linked to my report. Clicking the link gave me the message from my message box and canceled the opening of the report. But, it didn't give me a second message about being unable to open the specified file. I admit, I’m confused.

~Abby
 
Yikes, I am confused as well!

You pretty much did exactly as I have done with my project. No_data brings a message box, and setting cancel = true. Identical to what I have done.

I went ahead and tried a new one, in a blank database, as you probably did, doing the same thing, but still received the second error. The exact error message is:

Microsoft Access can't follow the hyperlink to 'Report rptSummary'. Please verify the destination.

The title bar of the error mesage reads 'Microsoft Access' if that helps at all. Is there an option somewhere to turn such messages off?

Thanks for your efforts on duplicating this scenario, Abby!! I have a feeling this will be one of those "just check this checkbox" things :-)

Thanks again,
Gord
 
I'm no closer to figuring out why you're getting the error and I'm not. Your probably right about it being some simple setting. But I can't seem to find it. What version of Access are you using?

I'll keep working on this. In the mean time, here's a link to an API that claims it will change the mouse pointer. I say 'claims' because I haven't tried it myself yet. But the site I found it on is very reliable.
http://www.mvps.org/access/api/api0044.htm

Hope this helps.

~Abby
 
I am using Access 2000 SR-1

I tried the API code with no success, but it is quite possible I am doing it incorrectly.

I put the given code into a module, and then tried setting the mouse pointer with something like this:

Screen.Mousepointer = PointM("my Path to a cursor file")

I'm not quite sure how it supposed to be used!

Anyway, it won't be the end of the world if I can't get this going. It would just be a nice touch. Still perplexed as to why I get the error you don't, though. I went home and did the same thing with the same result.

If I didn't mention it already, thanks for the help!!

Ciao for now,
Gord
 
Ok. I replicated your error and found a solution! (When something like this comes up it drives me nuts, like an itch on the back of my eyes. So, I’m rather happy to have solved it. Or at least to have found an acceptable workaround.) Here is what I did. First, I created a new form and coded its On Open event thusly:

On Error Resume Next
Me.Visible = False
DoCmd.OpenReport "ReportName", acViewPreview

Then I coded its Timer event with:

DoCmd.Close

and set the timer to 1. I then went back to the original form and set the Hyperlink SubAddress to the new form. That’s it. The hyperlink is happy because it can open the form and we’re able to trap the no data/no open error with the invisible form.

Oh, and I checked on the pointer API I gave you earlier. It does work. The proper syntax is:

PointerM(“PathToIcon”)

Anyway, I’m glad I could help. Happy coding!

~Abby
 
Doh! I just thought of a better way of doing this. Forget everything I said in my last post. I'm leaving it up in case this doesn't work for some reason. But, there should be no need for a second form. Code your original form's On Error property with:

If DataErr = 7971 Then Response = 0

and link the SubAddress to the report. That should do it.

~Abby

[This message has been edited by Abby N (edited 08-22-2001).]
 
Woo Hooo!! That does the job!!!!!!!

Thanks for this, Abby. Drinks are on me. Hahaha, Sorry I caused your eye to itch. I know how irritating that can get.

Cheers,
Gord
 
Abby,
how does the PointerM(PathToIcon)

Can it be used as it is in MS products where you press the "?"(help) button and the mouse changes to a pointer...then changes back when you click on a field.

I want to be able to provide this functionality.

'Click on Question mark
PointerM(Qmark.ico)
'Drag over to field
'Click on Field
MsgBox "THis is your help message for this field"
Screen.MousePointer = 0 'Returning mouse to default

Wouldn't that be neat:rolleyes:
 

Users who are viewing this thread

Back
Top Bottom