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!

vbKeyReturn problem (part 2)

Status
Not open for further replies.

jseva

IS-IT--Management
Mar 26, 2001
26
US
The following code doesn't work...

My vbKeyReturn key when pressed is not invoking the 'cmdTotal_Click procedure. If I press 'shift' and 'enter', it does. Why? How can I make it so that I don't have to press 'shift' with the 'enter' key? Please advise.

Private Sub cmdClear_KeyPress(KeyCode as integer)

Select Case KeyCode
Case Is = vbKeyBack
Call cmdBack_Click
Case Is = vbKeyReturn
Call cmdTotal_Click
End Select

End Sub
 
KeyCodes are for KeyDown and KeyUp.
Try
Private Sub cmdClear_KeyPress(KeyAscii as integer)

Select Case KeyAscii
Case Is = vbBack
Call cmdBack_Click
Case Is = vbCr
Call cmdTotal_Click
End Select

End Sub
Generate Forms/Controls Resizing/Tabbing Class
Compare Code (Text)
Generate Sort Class in VB or VBScript
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top