Hi
I have a form with 2 DateTimePickers controls, DTPicker(1) and DTPicker(2)
I have the procedure below but the pressing of the return key does not trigger the event. If I press a number key the event is triggered. How can I detect if the return key is press if the keyPress event does not work with all the keys?
Private Sub DTPicker_KeyPress(Index As Integer, KeyAscii As Integer)
If Index = 1 Then
If KeyAscii = Asc(vbCrLf) Then DTPicker(2).SetFocus
Else
If KeyAscii = Asc(vbCrLf) Then DTPicker(1).SetFocus
End If
End Sub
I have a form with 2 DateTimePickers controls, DTPicker(1) and DTPicker(2)
I have the procedure below but the pressing of the return key does not trigger the event. If I press a number key the event is triggered. How can I detect if the return key is press if the keyPress event does not work with all the keys?
Private Sub DTPicker_KeyPress(Index As Integer, KeyAscii As Integer)
If Index = 1 Then
If KeyAscii = Asc(vbCrLf) Then DTPicker(2).SetFocus
Else
If KeyAscii = Asc(vbCrLf) Then DTPicker(1).SetFocus
End If
End Sub