|
-
Apr 2nd, 2003, 02:24 PM
#1
Thread Starter
Member
why is form_keypress firing twice?
I have the keypreview to be true. Now whenever I press a key the form_keypress event is firing twice and giving me multiple values. I used a scanner , still getting multiple keys.
Any idea whats wrong?
-
Apr 2nd, 2003, 02:33 PM
#2
when you stop through your code.. is the keypress event being called for the second time before the first run through the event finishes?
-
Apr 2nd, 2003, 02:35 PM
#3
Thread Starter
Member
yes.As soon as it finishes the first time it goes into keypress event one more time.
-
Apr 2nd, 2003, 03:09 PM
#4
-
Apr 2nd, 2003, 03:27 PM
#5
Thread Starter
Member
Here is the code:
Private Sub Form_KeyPress(KeyAscii As Integer)
strcmd = strcmd & Chr(KeyAscii)
'If this is a cmd and not a barcode, skip the class.
If Len(strcmd) = 5 And Right(strcmd, 1) = "|" Then
'There is a pipe in the 5th character. Is this too short to be a barcode
If Mid(strcmd, 1, 2) = "11" Then
'this is a cmd
CmdProcessor (Mid(strcmd, 1, Len(strcmd) - 1))
End If
strcmd = ""
Exit Sub
End If
End Sub
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|