NumLock VBA programatically (1 Viewer)

cpampas

Registered User.
Local time
Today, 11:21
Joined
Jul 23, 2012
Messages
218
Hello,
I have a unbound text box (Text34), where a integer number should be entered, with following code:

Code:
Me.RecordsetClone.FindFirst "[MovimentoID] = " & Me![Text34]
Me.Bookmark = Me.RecordsetClone.Bookmark
Me.Text34 = Null
Text34.SetFocus

Code runs fine and finds the expected record, but right after that NumLock is disabled.
Is there a way to keep the Numlock on ?

I tried to add into the last line of code : SendKeys "{NUMLOCK}", True
but NO results

Any thoughts ?
 

theDBguy

I’m here to help
Staff member
Local time
Today, 11:21
Joined
Oct 29, 2018
Messages
21,499
I don't know how the numlock is getting affected. I don't see you using SendKeys in your code.
 

sonic8

AWF VIP
Local time
Today, 20:21
Joined
Oct 27, 2015
Messages
998
Code runs fine and finds the expected record, but right after that NumLock is disabled.
Is there a way to keep the Numlock on ?
I don't see a reason why your code would toggle the NumLock state. This usually only happens when using the SendKeys function, which should be avoided anyway. - So, maybe you review your code, whether there is something else triggering the NumLock issue.

In any case, you can use my Keyboard-State sample to set the NumLock state.
 

cpampas

Registered User.
Local time
Today, 11:21
Joined
Jul 23, 2012
Messages
218
Hello
I had a SendKeys function in another event of the form, that Ihave removed, and now it seems that all is working well
Thank you all for the kind help
 

Users who are viewing this thread

Top Bottom