Auto Detect BarCode Scan entry OR Manual Entry - Cash Register

simonwar

Member
Joined
Sep 8, 2009
Messages
17
Programming Experience
Beginner
hi,

i am pulling together a cash register that will allow both bar code product entry and manual key entry.

imagine if you have a tin of beans in front of you, in a small corner shop they would probably type "47" and then hit "Produce". Fairly straight forward as I have the button Produce to act upon my code and update my salestrans.mdb

but,

if you scan the bar code I want the same form to handle both 'real' actions, (i assume that keyboard emulation barcode scanner includes "ENTER" after providing 13 digits)....

Q. in perhaps a long winded way i want to know how to kick off an event based on the "ENTER" key being activiated by the barcode scanner)?

i do not want to have to hit any buttons if i am scanning bar codes.

appreciate any help, i am a bit new to VB.
thanks, s.
 
Correct when scanning a barcode it should simulate hitting an enter key at the end. You can enter code in your TextBox_KeyUp event to trigger your code.

In the TextBox_KeyUp event, put the following to test for "Enter" keys

VB.NET:
TextBox1_KeyUp()

    If e.KeyData <> Keys.Enter Then Exit Sub

    'Processing Code Here

End Sub
 
Where do you think i can get a scanning BLEEP sound from ?

Works a treat:

Test code:
VB.NET:
Public Class Form1

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        TextBox1.Focus()
    End Sub

    Private Sub TextBox1_KeyUp(ByVal sender As System.Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles TextBox1.KeyUp
        If e.KeyData <> Keys.Enter Then Exit Sub
        ' MessageBox.Show("barcode input")
        Dim newitem As String
        newitem = TextBox1.Text
        ListBox1.Items.Add(newitem)
        TextBox1.Text = ""

    End Sub

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        'MessageBox.Show("product assigned input")
        Dim newitem As String
        newitem = TextBox1.Text
        ListBox1.Items.Add(newitem)
        TextBox1.Text = ""

    End Sub

End Class

Q. Any idea where I can get that supermarket BLEEP from when a barcode is entered correctly?

Any other help appreciated.

Nice one, S.
 
Pitch and frequency ?

Had parameters in VB6, if I'm not mistaken.

The default is pretty drab, it would be nice to have pitch and length prescribable?

Any ideas?

Nice one, S.
 
You certainly can add sound wav files & events to your procedure(s) but are you sure there not already built in? My scanner automatically plays sometype of beep when something is scanned without adding anything into my program.
 
Yes it does, and I'll look at wav file events, mainly when the scan is duff, or product not found type noise, saying that the beep would probably be fine and distinct from my scanners high pitch beep.

Thanks for your help. S.
 
Yes it does, and I'll look at wav file events, mainly when the scan is duff, or product not found type noise, saying that the beep would probably be fine and distinct from my scanners high pitch beep.

Thanks for your help. S.

I was thinking about this thread the other day. One of the workers at my company must have changed the sound file associated with the scanner so that the Simpsons "DOH" is played with every scan. Talk about annoying... :mad:

And yes I was thinking the same thing in my next programs upgrade as far as a different sound being played when the product/records are not found.

In my database error logs I have it log when scans when the record is not found. Going thru the records I was suprised that they could scan the same barcode multiple times and each time have it display a differing result (seems to be only barcodes from one particular customer though) varying in digit length when all of are codes are exactly the same length. What surprises me about this however is that barcodes have start and end characters. I would think that the scan would either work entirely or fail completly, Im stumped at how it could misread it.
 
Yes as far as reading the barcodes it does use keyboard emulation. Although barcodes can contain characters that you wont actually see displayed when reading them afterwards. As far as creation of the barcodes, at least the several different ones that I have created for company vendors; each having there own specification requirements, they all have had start, stop, check digit formulas that apply additional numbers to your barcode and even some which require switching/shift characters that allow for using multiple barcode subsets to make up the whole barcode. I cant say postiviely if all barcodes require the start & stop characters but all the ones I have needed to create have so far.
 
Back
Top