Reading only Certain Numbers from Scanner

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Access 2003

There are pre-made barcodes on the books that I am scanning. The codes have
a 10 digit number that sometimes starts with a 0. I really only need the
first 9 numbers as the 10th number is a test type field and is not included
as the sequence number. Example..

BookNumber-Test Scan Reads
065160982-6 651609826
065160983-4 651609834
065160984-1 651609841
134987461-8 1349874618
134987462-4 1349874624
134987463-9 1349874639

The test version throws off the scan of the book sequence. I store each
book in tblBooks and store them as the primary key (there are no duplicates)
with the three other information bits. How can I remove that last number
from the scan or read the last number as a seperate field of test version.
 
Ripper said:
Access 2003

There are pre-made barcodes on the books that I am scanning. The codes have
a 10 digit number that sometimes starts with a 0. I really only need the
first 9 numbers as the 10th number is a test type field and is not included
as the sequence number. Example..

BookNumber-Test Scan Reads
065160982-6 651609826
065160983-4 651609834
065160984-1 651609841
134987461-8 1349874618
134987462-4 1349874624
134987463-9 1349874639

The test version throws off the scan of the book sequence. I store each
book in tblBooks and store them as the primary key (there are no duplicates)
with the three other information bits. How can I remove that last number
from the scan or read the last number as a seperate field of test version.


You can calculate the scan value without the last digit by
using:
Left(scan, Len(scan) - 1)
 
Where do I calculate that? Is it in the text box where the scan goes?

Sorry for the confustion.
 
Ripper said:
Where do I calculate that? Is it in the text box where the scan goes?

Presumably, your scanner is putting the scaned value in a
text box (named txtBarCode). If so, then I think you want
that text box to be unbound (blank control source). Then
another text box (named txtISB) that's bound to the field in
the table can be set to the desired value by using a line of
code in txtBarCode's AfterUpdate event procedure:

Me.txtISB = Left(txtBarCode, Len(txtBarCode) - 1)
 
Back
Top