Solved

Access 2010 "On Mouse Move" event not working

Posted on 2013-06-21
6
1,052 Views
Last Modified: 2013-06-24
Hello Experts,

I'm having a problem with my event code in Access 2010.

I can't seem to get any code to run in several events. These events include: On Mouse Move, On Click, On Mouse Up, On Mouse Down, On Mouse Wheel.

I was having the same problem with "On Key Press", but that was resolved by setting "Key Preview" to "Yes"

In addition to the On Key Press event, I do have some other events setup: Before Update, and On Timer.

The code I have been using for testing is to just to open a test form. But it just won't work.

What is stopping my code from running?

Thanks in advance.
0
Comment
Question by:Jpoppi
  • 3
  • 3
6 Comments
 
LVL 77

Expert Comment

by:peter57r
ID: 39265307
Is your database in a trusted folder?

Are you sure you are using a form view which allows events and not say, 'layout view' which does not.
0
 
LVL 1

Author Comment

by:Jpoppi
ID: 39265377
Thanks for your reply peter57r,

I'm not the best at access, but I'll give you the best information I can:

The accdb front end file is on my desktop at the moment, and the back end is on a mapped drive, and I'm logged in as Administrator - I should have full access. When I make copies of the front end and open for the first time, it asks me to enable content. Which I do. I don't get asked this again after the first time.

In the current database settings, I have layout view disabled. Pretty sure I'm viewing the form as it should be, and as the end user sees it.

Other event code works, just not anything to do with the mouse, so it appears. I tried getting a message box to appear "On Click" on another form, but that doesn't work either.

Thanks again,

Justin
0
 
LVL 77

Accepted Solution

by:
peter57r earned 500 total points
ID: 39265392
Does the mouse work at all?
Can you move around the form by clicking into different textboxes?

I don't quite see how you could click into a textbox or on a button in form view without triggering the click event.  When you look at the event properties of a textbox do you see entries in the click property ?

Just one last thought - you are trying to use control events and not form events I take it?
A form never gets focus unless there is no control which can have the focus.
0
Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

 
LVL 1

Author Comment

by:Jpoppi
ID: 39265431
Thanks peter57r! You nailed it.

I was using the form events. I tried using the "On Mouse Move" event under the "Detail" property, and I was able to get it working first go.

I need the code to fire whenever there is user action (I'm building an inactivity function). Would the detail property be sufficient for this? Or is there something better?

Thanks again,

Justin
0
 
LVL 77

Expert Comment

by:peter57r
ID: 39267709
I have always used textboxes to detect mouse activity , on the few occasions it has been required.  But my requirements have always required me to know which box was being 'mouse-overed'.  I haven't used it just to see if someone is just waving the mouse around.
0
 
LVL 1

Author Comment

by:Jpoppi
ID: 39273671
Thanks again peter57r, I got it all working.

Because the database I'm working on is for primarily for a touchscreen computer, there isn't much "mouse movement". I was hoping it would pick up when a button was clicked or textbox selected, so I didn't have to put code or macros on every button / textbox.

I did however end up putting code/macro on everything that might be selected, to update the timerinterval property. If the timer elapses, (due to no user action) it saves/discards/closes all forms and brings up a login window.

It might not be the best way to do it, but it works. :D
0

Featured Post

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

In the article entitled Working with Objects – Part 1 (http://www.experts-exchange.com/Microsoft/Development/MS_Access/A_4942-Working-with-Objects-Part-1.html), you learned the basics of working with objects, properties, methods, and events. In Work…
Describes a method of obtaining an object variable to an already running instance of Microsoft Access so that it can be controlled via automation.
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.

758 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now