Hi,
I have a vexing problem that probably has a simple answer, and I'm sure this fine community knows what it is. When the following code runs in my application I get a problem that eludes me. The
AnswerInput textbox is used for input, and I use the
KeyPress event to trap the
Enter keypress. However, whenever the user presses the enter key, my computer beeps from the speaker. The procedures that are called have not been altered at all, and this is the new code that has been added just prior to the beeping starting. The beeping seems to occur after the
TestNextCard or
TestShowCard procedures return to this procedure.
What is causing the beeping? And how do I turn it off?
Any help is appreciated.
Regards,
Nick
Windows XP Pro, SP2
VB6
Code:
Private Sub AnswerInput_KeyPress(KeyAscii As Integer)
If Not AdvTestingMode Then
Exit Sub
End If
If AdvShowingMode = 1 Then
TestingStatus.Caption = "Showing"
If KeyAscii = 13 Then
Guess.ZOrder
TestNextCard
Exit Sub
End If
ElseIf AdvShowingMode = 0 Then
TestingStatus.Caption = "Testing"
If KeyAscii = 13 Then
If (AnswerInput.Text <> Empty And _
(Not IsNumeric(AnswerInput.Text) Or _
Val(AnswerInput.Text) < 0 Or _
Val(AnswerInput.Text) > 52)) Or _
AnswerInput.Text = Empty Then
AnswerInputKeyEntry = 99
Else
AnswerInputKeyEntry = Val(AnswerInput.Text)
End If
TestShowCard
Exit Sub
End If
End If
End Sub