i am usng key ascii 13(Enter key) to move between text fields... but the problem is that it produce some sound i dont want that it produce that sound, can any one know how to avoid the beep in vb6?????

Private Sub Text1_KeyPress(KeyAscii As Integer)
On Error Resume Next
If KeyAscii = 13 Then
Text2.SetFocus
End If
End Sub

Recommended Answers

All 2 Replies

did you write code

Beep

If not then I think no problem in your code.

thanks for response..
code is fine but it produce some sound when i press enter key and my problem is solved now... i google it and find this code which avoid making sound when user press enter key

If KeyAscii = vbKeyReturn Then KeyAscii = 0
End If

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.