4 Replies - 1672 Views - Last Post: 04 February 2012 - 07:44 AM Rate Topic: -----

#1 Essel   User is offline

  • D.I.C Head

Reputation: 5
  • View blog
  • Posts: 118
  • Joined: 08-May 09

Accept button problem with barcode reader

Posted 04 February 2012 - 03:25 AM

please i have a sales form which i have set the its accept button is to the sell button on the form.so after adding all items and the user presses the enter key it starts selling which is actually what i want but the problem is i use a barcode to scan for items and immediately the item shows the accept is executed,thereby causing the sell button to execute.please how do i stop this
Is This A Good Question/Topic? 0
  • +

Replies To: Accept button problem with barcode reader

#2 RexGrammer   User is offline

  • Coding Dynamo
  • member icon

Reputation: 183
  • View blog
  • Posts: 785
  • Joined: 27-October 11

Re: Accept button problem with barcode reader

Posted 04 February 2012 - 03:41 AM

Could you share some relevant code please?
Was This Post Helpful? 0
  • +
  • -

#3 tlhIn`toq   User is offline

  • Xamarin Cert. Dev.
  • member icon

Reputation: 6534
  • View blog
  • Posts: 14,450
  • Joined: 02-June 10

Re: Accept button problem with barcode reader

Posted 04 February 2012 - 06:22 AM

Essel What this shows us is that you aren't familiar with breakpoints and how to debug your own code.Learning to debug one's own code is an essential skill. Sadly, one that apparently no college course teaches. Silly if you ask me.

Placing breakpoints and walking through the code line by line allows you to actually WATCH it execute. Visualizing what your code does will let you see why it behaves the way it does.

It would be well worth your time to do the tutorials on FAQ 2. A couple hours learning this skill will save you hundreds of hours of confusion in one project alone.

TOP most asked:
What does this error message mean?
FAQ 2: How do I debug
FAQ 3: How do I make Form1 talk to Form2



FAQ (Frequently Asked Questions - Updated Jan 2012

Spoiler

Was This Post Helpful? 0
  • +
  • -

#4 eclipsed4utoo   User is offline

  • Not Your Ordinary Programmer
  • member icon

Reputation: 1533
  • View blog
  • Posts: 5,972
  • Joined: 21-March 08

Re: Accept button problem with barcode reader

Posted 04 February 2012 - 07:38 AM

It's possible that your barcode scanner is returning a carriage return after the barcode. This is common among USB barcode scanners. If your form has focus(instead of a textbox), when the barcode is scanned, the carriage return will act as though the user hit ENTER. I think that's your problem.
Was This Post Helpful? 2
  • +
  • -

#5 tlhIn`toq   User is offline

  • Xamarin Cert. Dev.
  • member icon

Reputation: 6534
  • View blog
  • Posts: 14,450
  • Joined: 02-June 10

Re: Accept button problem with barcode reader

Posted 04 February 2012 - 07:44 AM

I always forget about scanners that are just keyboard wedges. I hate those things for exactly this reason. That's why I prefer scanners that are either serial or serial over USB.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1