Solved

Access 2010 "On Mouse Move" event not working

Posted on 2013-06-21
6
1,150 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
The Eight Noble Truths of Backup and Recovery

How can IT departments tackle the challenges of a Big Data world? This white paper provides a roadmap to success and helps companies ensure that all their data is safe and secure, no matter if it resides on-premise with physical or virtual machines or in the cloud.

 
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

Secure Your Active Directory - April 20, 2017

Active Directory plays a critical role in your company’s IT infrastructure and keeping it secure in today’s hacker-infested world is a must.
Microsoft published 300+ pages of guidance, but who has the time, money, and resources to implement? Register now to find an easier way.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In earlier versions of Windows (XP and before), you could drag a database to the taskbar, where it would appear as a taskbar icon to open that database.  This article shows how to recreate this functionality in Windows 7 through 10.
In Part II of this series, I will discuss how to identify all open instances of Excel and enumerate the workbooks, spreadsheets, and named ranges within each of those instances.
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

749 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