Using a Barcode Reader

Dustin Cook

New member
Local time
Yesterday, 19:17
Joined
May 27, 2008
Messages
3
Hello all.

I have a problem with a barcode reader, and apparently this can be done - I just don't know how to set it up.

I am doing a stock take.

I have an access database set up with details of products (barcode, name, supplier, RRP, no, in box, etc).

Now, what I want to do, is scan a barcode, which will then bring up all the details for that item, and then add an extra field of quantity.

How can I do this? I'm just using a standard USB barcode scanner, and Windows XP with Microsoft 2000.

Many thanks in advance.

DC.
 
The barcode scanners I've worked with could all be programmed to send a Tab or Enter after the scan (in fact most did it out of the box). I just set up a textbox and code the after update event to do the tasks desired. As long as focus is in that textbox when you scan, it should work properly.
 
I don't really understand the question but let's try this:

Set the scanner up as a keyboard wedge and have it automatically add a "tab" after each scan.

In the field that you're scanning the bar code, put code in the lost focus event to look up the rest of the data from your table. Set the tab stop so the next field to receive focus is the quantity field.
 
OK, thanks.

What I want, is when you scan the barcode, all the details are brough up on a screen, and then you can edit the details.

Does that make any easier sense? How can I do this?
 
OK, thanks.

What I want, is when you scan the barcode, all the details are brough up on a screen, and then you can edit the details.

Does that make any easier sense? How can I do this?

The way I get this to happen on an unbound form is to make a combo box that is populated by a query with all the fields that you wish to either view or change/append. The key field to the combo is what ever the scanner will read.
Create locked text boxes to display all the data your end user needs to see.
Create text boxes for the data they can edit.
Populate the text boxes on the OnChange event of the combo box
Me.Text2 = Combo1.Column(1) etc
Create a command button to update the record and park a sql statement in the onclick event so that the end user can click to change the records.
Code the barcode reader with a linefeed on aquire so it will basically perform a change to the combo box once it reads the barcode.
 
Simple Software Solutions

There is a soulution for this in my sample tips and tricks mdb that can be obtained from my web site. Unfortunately the zip file exceeds the forum limit.

CodeMaster::cool:
http://www.icraftlimited.co.uk
 
Thanks for all the replies. We have been trying some different methods, but something still is not working, and we assume this must be 'easier' than it appears. (well here's hoping).

OK, so what we want to do, is using the product ID to search the database of the items. So on a form in access, there would be a blank field linked to the query. If you typed in a product ID, it would display all the fields relating to that product.

Then, we would edit the quantity field, and move to search for the next item (again using the query box).

Can this be done in a simpler way?
 
Last edited:
If you wanted to go with a bound form, code along the lines of that built by the "Find a record" combo box wizard could take you to the appropriate record after a scan. Depending on the total number of records, that could make the form a little "heavy" performance-wise though. I might go with a form that started out unbound (but had controls for the appropriate fields), and after the scan did something like:

Me.RecordSource = "SELECT Blah FROM TableName WHERE ProductID = " & Me.ScanTextBox

That would populate the form with the single record rather than the whole table. It occurs to me that the controls would start out with errors, but we could get around that.
 
would you happen to have the code to do this, this is exactly what i want to do with a database of my own, I have the scanner, barcode#'s & labels for each record, I just need to set up a serch box on my switchboard, but I have no clue as to how to do this. Thanks
 
A couple of methods have already been posted. Here's the adaptation of the combo wizard I mentioned:

Me.RecordsetClone.FindFirst "[PartNumber] = '" & Me.cboFindPart & "'"
Me.Bookmark = Me.RecordsetClone.Bookmark
Me.PartDesc.SetFocus
Me.cboFindPart = Null
 

Users who are viewing this thread

Back
Top Bottom