Hi,
Maybe this is obvious but I'm having trouble getting started. I searched through the forums but couldn't quite find what need. I'm looking for a simple routine, preferably in the On Key Down or or On Key Press event of a form to quickly navigate to a record based on the key pressed.
I have a form with names in a table layout (continuous form).
If the user is on the name field, I'd like it to navigate to the first record that contains first letter of the key pressed. So if a user presses "K", the form will go to the first record that starts with a K.
Yes, the names in the form are alphabetical, but in a list with over 100 names, this could help speed things up just a bit and save a lot of scrolling and looking.
I was thinking of using KeyCode and I already have an event to navigate by the arrow keys so I'm considering building on that.
I am thinking to use a Select Case and add the key codes for all the letters, but I'm not quite sure how to identify the appropriate record.
Maybe this is obvious but I'm having trouble getting started. I searched through the forums but couldn't quite find what need. I'm looking for a simple routine, preferably in the On Key Down or or On Key Press event of a form to quickly navigate to a record based on the key pressed.
I have a form with names in a table layout (continuous form).
If the user is on the name field, I'd like it to navigate to the first record that contains first letter of the key pressed. So if a user presses "K", the form will go to the first record that starts with a K.
Yes, the names in the form are alphabetical, but in a list with over 100 names, this could help speed things up just a bit and save a lot of scrolling and looking.
I was thinking of using KeyCode and I already have an event to navigate by the arrow keys so I'm considering building on that.
Code:
If KeyCode = 40 Then ' Down arrow
DoCmd.GoToRecord acForm, Me.Name, acNext
ElseIf KeyCode = 38 Then ' Up arrow
DoCmd.GoToRecord acForm, Me.Name, acPrevious
End If