View Full Version : Numlock OFF all by itself ?! Please Help!


Doppenberg
05-31-2000, 02:42 AM
I have a very strange problem.

When I have a field in my form with a mask, i have the problem that when the user clicks on the field, the cursor is at the click position.
Even on an empty field, the cursor goes to the click point, so it can be in the middle of the field when the field is empty.
This only occurs when i use an inputmask.

To correct this I use the on-click-event of the field and i send the HOME key (or F2, but that works the same way).
The code is : Sendkeys "{HOME}"

Now when I click on such a field the cursor jumps to the left of the field, that's great!
The problem is that my numlock's LED disappears and my Numlock is disabled all by itself !
This is very annoying when entering a date.

Can anyone please help me ? Is there a way to put the cursor to the left (on an field with an inputmask) without the numlock key going crazy?

Thanks, Tim

PS. I just found out it is not just the Numlock-key, It's all three LED's, Numlock, Capslock, and Scroll-lock!

[This message has been edited by Doppenberg (edited 05-31-2000).]

R. Hicks
05-31-2000, 08:07 AM
Using SendKeys can sometimes result in strange behaviour somtimes. If you want the curser to be placed to the left of the entry try using the controls' On Enter event and use the following code:

Private Sub YourControlName_Enter()
Me![YourControlName].SelStart = 0
End Sub

"YourControlName" needs to be the name of your control.

Look up SelStart in Access Help for more details.

HTH
RDH

[This message has been edited by R. Hicks (edited 05-31-2000).]

Atomic Shrimp
02-07-2001, 05:08 AM
If you're still looking for a solution to the sendkeys/numlock problem, I've found one:
http://www.access-programmers.co.uk/ubb/Forum7/HTML/001060.html

HTH

Mike