Accepting a scanned barcode value


   I am working with a form in VB6 linked to an Access db.  I need to be able to have a field on this form accept a scanned barcode value, then search for a record based on that value.  In access alone this works, but I've noticed in vb it does not.  
   The scanner and keyboard are both plugged into a spliter that is plugged into the keyboard jack.  All the barcode scanner does is send the scanned value and a carriage return.  I've noticed there is ther is no OnEnter event in vb.  Is there a way to trigger the search using an 'if' statement on the field, like:

if 'barcode value' And 'carriage return' then
  End If

Or is it something more.  I've notice that even though the search field on myvb form won't accept a carriage return, It doesn't even accept a barcode value.   Any ideas on how to do this (the easy way) would be extremely helpful.


Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

If you are scanning into a Textbox use the Keypress event

Private Sub Text1_KeyPress(KeyAscii As Integer)
If KeyAscii = vbKeyReturn Then
     MsgBox Text1.Text
End If
End Sub

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic Classic

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.