Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SetFocus & Validate event 2

Status
Not open for further replies.

sunaj

Technical User
Feb 13, 2001
1,474
0
0
DK
Why does this not work?

--------------------------------------------
Private Sub Text1_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = vbKeyReturn Then Command1.SetFocus
End Sub

Private Sub Text1_Validate(Cancel As Boolean)
MsgBox "Validate"
End Sub
---------------------------------------------

-it works if I use the mouse to give focus to command1
Sunaj
'The gap between theory and practice is not as wide in theory as it is in practice'
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top