View Single Post
  #5  
Old November 6th, 2009, 03:00 AM posted to microsoft.public.access.forms
Jeanette Cunningham
external usenet poster
 
Posts: 2,190
Default Programmatically change combo box sorting

Mmm, there may well be an issue with changing the combo row source in the
key down event.
Like Dorian, I have always provided a button or label to change the sort
order of a combo.



Jeanette Cunningham MS Access MVP -- Melbourne Victoria Australia



"alt.binaries.cd.genealogy" wrote in message
...
On Nov 4, 7:03 pm, "Jeanette Cunningham"
wrote:
Hi,
you can trap for use of shift key in the key down event. To use the key
down
event, you must set the form's Key Preview to Yes.

Here's some sample code ( not for the arrow keys).

Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = vbKeyD And ((Shift And acCtrlMask) 0) Then
MsgBox "Ctrl+D pressed."
End If
End Sub

vbKeyLeft LEFT ARROW key
vbKeyRight RIGHT ARROW key

Jeanette Cunningham MS Access MVP -- Melbourne Victoria Australia



Jeanette,

Thanks for the help with the Key_Down code. Mostly I have a problem
when setting the .RowSource in the the Key_Down event, the combo box
stops working correctly.