user2204315
user2204315

Reputation:

Need a Warning within Access when NumLock is Off

One of my database forms was not working properly. It took me a while before I realised that NumLock was off. There are procedures to reverse the process when NumLock is turned off by pressing the key but it might not be just accidental pressing of the key that turns off NumLock. In MS Access, at the bottom right of the window you get "NUM LOCK" if it's on, nothing if it's off. Is there a way, say in vba, to warn if the words "NUM LOCK" do not appear?

Upvotes: 2

Views: 395

Answers (1)

Robert Harvey
Robert Harvey

Reputation: 180878

GetNumlock = CBool(GetKeyState(vbKeyNumlock) And 1)

Example:

If (CBool(GetKeyState(vbKeyNumlock) And 1) = True
    MsgBox "NumLock is on." 
End If

Upvotes: 1

Related Questions