Ok a simple question how to bind a command button to enter?
Printable View
Ok a simple question how to bind a command button to enter?
Set its 'default' property to TRUE
Or do it programmatically:
VB Code:
'method 1 Private Sub Form_Load() Me.KeyPreview = True End Sub Private Sub Form_KeyUp(KeyCode As Integer, Shift As Integer) If Shift = 0 And KeyCode = 13 Then Command1_Click End If End Sub 'OR 'method 2 Private Sub Text1_KeyPress(KeyAscii As Integer) If KeyAscii = 13 Then Command1_Click End If End Sub
Thx guys that helped