Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Access 2010 "On Mouse Move" event not working

Posted on 2013-06-21
6
Medium Priority
?
1,291 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 2000 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.
1
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

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

What’s Wrong with Your Cloud Strategy ?

Even as many CIOs are embracing a cloud-first strategy, the reality is that moving to the cloud is a lengthy process and the end-state is likely to be a blend of multiple clouds—public and private. Learn why multicloud solutions matter in this webinar by Nimble Storage.

Question has a verified solution.

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

Preparing an email is something we should all take special care with – especially when the email is for somebody you may not know very well. The pressures of everyday working life stacked with a hectic office environment can make this a real challen…
Instead of error trapping or hard-coding for non-updateable fields when using QODBC, let VBA automatically disable them when forms open. This way, users can view but not change the data. Part 1 explained how to use schema tables to do this. Part 2 h…
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…

650 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