• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Enter Press Event in Form

Istiyak

Member
Hi Ninja's,

Supposed i have a form which i have designed for some inventory scanning purpose.

In this form i have a text box in which i will scan barcode of particular inventory.

So when i will scan those barcode Code it should be work like after scanning it should check logics and then perform particular task, containt value in cells then again set focus on this text box ( This time textbox should empty for new scanning).

Guys what i want is scanner is performing "Enter Event", so how can i code that text box that when scanner send enter then form should perform that code.

i hope you all guys understand what i want to say.

Regards
Istiyak
 
Team,

i have code but "SET Focus" is not working, system directly setting focus on Last element of Forms i.e. Submit button on form
 
Sub mymacro()
MsgBox ("Enter Pressed")
TextBox1.Value = ""
UserForm1.TextBox1.SetFocus
End Sub

Private Sub CommandButton1_Click()
MsgBox ("Enter Pressed")
TextBox1.Value = ""
UserForm1.TextBox1.SetFocus
End Sub

Private Sub tExtBOX1_KeyDown(ByVal KeyCode As MSForms.ReturnInteger, ByVal Shift As Integer)
If KeyCode = vbKeyReturn Then
KeyCode = 0
Call CommandButton1_Click
End If
End Sub


Got above solution...let's rock
 
Back
Top