If you'd like to use the Arrow Keys to navigate through a ListBox even
if the ListBox does not have the focus then read on.
Go to Form properties and set the Key Preview to Yes.
Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
Select Case KeyCode
Case vbKeyDown
Me.List2 = Me.List2.ItemData(Me.List2.ListIndex + 1)
KeyCode = 0
Case vbKeyUp
Me.List2 = Me.List2.ItemData(Me.List2.ListIndex - 1)
KeyCode = 0
Case Else
End Select
End Sub
Tthe above code is for a ListBox named List2. Change the name to reflect
your ListBox. Also this is set to work with a ListBox WITHOUT Column
Headers turned on. You'll have to adjust it if you use Column Headers.
Finally the Arrow Keys are sent to oblivion with the Line KeyCode =0.
Your mileage may vary.
--
HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.