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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

KeyDown Problem - losing text box value

Status
Not open for further replies.

vzjfgm

Programmer
Jul 24, 2003
34
US
Hello,
I am having a problem with the following code. When the
returnkey is pressed the correct procedure is called but I lose the value in the txtpassword text box. The text box value is Null. Why is this happening? Please advise. Thank you!!!


Private Sub TxtPassword_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = vbKeyReturn Then
Call cmdEnter_Click
End If
End Sub
 
In your code add a line to move the focus to another control then back to the text box, this way the code will see the value that has been entered.

CMP

Funny thing about being unemployed, weekends don't mean quite so much, just means you get to hang out with your working friends. Primus
 
Thank you!!! That did the trick!!!! [bigsmile]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top