?
Solved

Access 2010 "On Mouse Move" event not working

Posted on 2013-06-21
6
Medium Priority
?
1,343 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:Justin
  • 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:Justin
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
Transaction-level recovery for Oracle database

Veeam Explore for Oracle delivers low RTOs and RPOs with agentless transaction log backup and transaction-level recovery of Oracle databases. You can restore the database to a precise point in time, even to a specific transaction.

 
LVL 1

Author Comment

by:Justin
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:Justin
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

Free Backup Tool for VMware and Hyper-V

Restore full virtual machine or individual guest files from 19 common file systems directly from the backup file. Schedule VM backups with PowerShell scripts. Set desired time, lean back and let the script to notify you via email upon completion.  

Question has a verified solution.

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

Access developers frequently have requirements to interact with Excel (import from or output to) in their applications.  You might be able to accomplish this with the TransferSpreadsheet and OutputTo methods, but in this series of articles I will di…
Sometimes MS breaks things just for fun... In Access 2003, only the maximum allowable SQL string length could cause problems as you built a recordset. Now, when using string data in a WHERE clause, the 'identifier' maximum is 128 characters. So, …
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …
Suggested Courses

831 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