Moving to subform turns off NumLock
Moving to subform turns off NumLock
(OP)
Here's one for somebody. This is a project I built two years ago and never found a solution. On the main form there's a list box named "lact" and when an item is selected in the list box the curser is moved to a location on the subform named "sub1". The problem is that during the move the NumLock turns off and if one (like me) wants to use the number pad to enter data the NumLock needs to be manually turned back on each time. Below is the code I used back then to make this happen. (It's funny sometimes to look back and see how you did things in the past.) Any solutions to the NumLock problem from anyone?
Private Sub lact_AfterUpdate()
DoCmd.Requery "sub1"
DoCmd.GoToControl "sub1"
DoCmd.GoToRecord , "", acLast
SendKeys "~", False
SendKeys "~", False
SendKeys "~", False
End Sub
This database was built in Access 97.
Private Sub lact_AfterUpdate()
DoCmd.Requery "sub1"
DoCmd.GoToControl "sub1"
DoCmd.GoToRecord , "", acLast
SendKeys "~", False
SendKeys "~", False
SendKeys "~", False
End Sub
This database was built in Access 97.
RE: Moving to subform turns off NumLock
John A. Gilman
gms@uslink.net
RE: Moving to subform turns off NumLock
Private Sub lact_AfterUpdate()
Dim ctlrRdng As Control
Set ctlrRdng = Forms![frmDlyProdRdngs]![sub1].Form![rRdng]
DoCmd.Requery "sub1"
DoCmd.GoToControl "sub1"
DoCmd.GoToRecord , , acLast
DoCmd.GoToRecord , "", acNewRec
ctlrRdng.SetFocus
End Sub
The "acLast" allows me to view the previous days reading as I input the new reading. That's why I had the three Sendkeys in there. Glad I don't do things like that anymore.
RE: Moving to subform turns off NumLock
Keep on keepin on.
John A. Gilman
gms@uslink.net